Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Rename OhShitStore™ to powerstore" #742

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions f3.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
func (s *f3State) stop(ctx context.Context) (err error) {
log.Info("stopping F3 internals")
if serr := s.ps.Stop(ctx); serr != nil {
err = multierr.Append(err, fmt.Errorf("failed to stop powerstore: %w", serr))
err = multierr.Append(err, fmt.Errorf("failed to stop ohshitstore: %w", serr))

Check warning on line 262 in f3.go

View check run for this annotation

Codecov / codecov/patch

f3.go#L262

Added line #L262 was not covered by tests
}
if serr := s.runner.Stop(ctx); serr != nil {
err = multierr.Append(err, fmt.Errorf("failed to stop gpbft: %w", serr))
Expand All @@ -275,7 +275,7 @@

func (s *f3State) start(ctx context.Context) error {
if err := s.ps.Start(ctx); err != nil {
return fmt.Errorf("failed to start the powerstore: %w", err)
return fmt.Errorf("failed to start the ohshitstore: %w", err)

Check warning on line 278 in f3.go

View check run for this annotation

Codecov / codecov/patch

f3.go#L278

Added line #L278 was not covered by tests
}
if err := s.certsub.Start(ctx); err != nil {
return fmt.Errorf("failed to start the certificate subscriber: %w", err)
Expand Down Expand Up @@ -329,7 +329,7 @@
return fmt.Errorf("failed to open certstore: %w", err)
}

pds := measurements.NewMeteredDatastore(meter, "f3_powerstore_datastore_", m.ds)
pds := measurements.NewMeteredDatastore(meter, "f3_ohshitstore_datastore_", m.ds)
state.ps, err = powerstore.New(ctx, mPowerEc, pds, state.cs, state.manifest)
if err != nil {
return fmt.Errorf("failed to construct the oshitstore: %w", err)
Expand Down
10 changes: 5 additions & 5 deletions internal/powerstore/powerstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"golang.org/x/sync/errgroup"
)

var log = logging.Logger("f3/powerstore")
var log = logging.Logger("f3/ohshitstore")

var _ ec.Backend = (*Store)(nil)

Expand Down Expand Up @@ -50,7 +50,7 @@
return &Store{
Backend: ec,

ds: namespace.Wrap(ds, datastore.NewKey("/powerstore")),
ds: namespace.Wrap(ds, datastore.NewKey("/ohshitstore")),
cs: cs,
manifest: manifest,
clock: clock.GetClock(ctx),
Expand Down Expand Up @@ -236,7 +236,7 @@

if !initialized && f3Base > ecHead-stopThreshold {
initialized = true
log.Debugw("Clearing the powerstore on initialization because we're caught-up.")
log.Debugw("Clearing the OhShitStore on initialization because we're caught-up.")

Check warning on line 239 in internal/powerstore/powerstore.go

View check run for this annotation

Codecov / codecov/patch

internal/powerstore/powerstore.go#L239

Added line #L239 was not covered by tests
ps.deleteAll(ctx)
ps.lastStoredEpoch = -1
ps.lastStoredPt = nil
Expand All @@ -249,14 +249,14 @@
log.Debugw("skipping catch-up because we're within the start threshold")
continue
}
log.Warnf("Uh-oh, F3 has fallen behind EC by more than %d epochs! Engaging the powerstore™.", startThreshold)
log.Warnf("Uh-oh, F3 has fallen behind EC by more than %d epochs! Engaging the OhShitStore™.", startThreshold)
ps.lastStoredEpoch, ps.lastStoredPt, err = ps.mostRecentPowerTable(ctx)
if err != nil {
log.Errorw("failed to lookup most recent power table", "error", err)
continue
}
} else if f3Base > ecHead-stopThreshold {
log.Infow("Stopping the powerstore because we're caught-up")
log.Infow("Stopping the OhShitStore™ because we're caught-up")
ps.deleteAll(ctx)
ps.lastStoredEpoch = -1
ps.lastStoredPt = nil
Expand Down
2 changes: 1 addition & 1 deletion internal/powerstore/powerstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func TestPowerStore(t *testing.T) {
// Ok, now we're going to try falling behind and catching up a few times.

isDsEmpty := func() bool {
res, err := ds.Query(ctx, query.Query{Prefix: "/powerstore"})
res, err := ds.Query(ctx, query.Query{Prefix: "/ohshitstore"})
require.NoError(t, err)
defer res.Close()
_, ok := res.NextSync()
Expand Down
Loading