Skip to content

storage: Remove or fix "initial metrics computation" #13560

@bdarnell

Description

@bdarnell

As soon as gossip is connected, we attempt to compute the store metrics:

cockroach/pkg/storage/store.go

Lines 1250 to 1262 in 6e9c78f

s.stopper.RunWorker(func() {
select {
case <-s.cfg.Gossip.Connected:
s.scanner.Start(s.cfg.Clock, s.stopper)
case <-s.stopper.ShouldStop():
return
}
})
// Run metrics computation up front to populate initial statistics.
if err = s.ComputeMetrics(ctx, -1); err != nil {
log.Infof(ctx, "%s: failed initial metrics computation: %s", s, err)
}

This (nearly) always fails because gossip becomes connected before the system config is available. It logs a INFO message and then we discard the error. (This line appears in the logs of nearly all our tests, and is the only message in the logs for many tests).

We should either wait for the system config to be available before computing metrics or remove the call completely since it's consistently failing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-cleanupTech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions