kvserver: co-construct AllocatorSync in NewStore#170638
Conversation
Production code (server.go) pairs MMAllocator with an AllocatorSync on the StoreConfig. A number of test entry points populate MMAllocator (via TestStoreConfig) and StorePool but leave AllocatorSync unset. The MMA store rebalancer worked around this with a buildutil-gated fallback that lazily constructed an AllocatorSync in test builds and panicked otherwise. That gate was tripping benchmarks (which are compiled without the crdb_test tag), e.g. BenchmarkStoreGetReplica and BenchmarkMVCCGCWithForegroundTraffic. Co-construct AllocatorSync inside NewStore when MMAllocator is set but AllocatorSync is not, mirroring what server.go already does explicitly. The fallback in newMMAStoreRebalancer is replaced with a plain non-nil assertion, and the now-redundant explicit construction in localtestcluster is dropped. Fixes #170455. Fixes #170456. Release note: None Epic: none Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
|
😎 Merged successfully - details. |
|
Detected infrastructure failure (matched: self-hosted runner lost communication with the server). Automatically rerunning failed jobs. (run link) |
Follow-up to dropping the mmaintegration import from pkg/testutils/localtestcluster/local_test_cluster.go. Release note: None Epic: none Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
angeladietz
left a comment
There was a problem hiding this comment.
LGTM. out of curiosity, would it also have been an option to just specify the AllocatorSync in all the tests, to make the tests more representative of production code?
|
Based on the specified backports for this PR, I applied new labels to the following linked issue(s). Please adjust the labels as needed to match the branches actually affected by the issue(s), including adding any known older branches. Issue #170455: branch-release-26.2. Issue #170456: branch-release-26.2. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
|
Encountered an error creating backports. Some common things that can go wrong:
You might need to create your backport manually using the backport tool. merge conflict cherry-picking c09e0f8 to blathers/backport-release-26.2-170638 Backport to branch 26.2.x failed. See errors above. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
Yes, I looked at both and was on the fence (because I consider "test-only init paths in prod" a risk generally). But it was tedious to construct an AllocatorSync in ~12 places. Let me take another look though. |
Production code (
server.go) pairsMMAllocatorwith anAllocatorSynconthe
StoreConfig. A number of test entry points populateMMAllocator(viaTestStoreConfig) andStorePoolbut leaveAllocatorSyncunset. The MMAstore rebalancer worked around this with a
buildutil-gated fallback thatlazily constructed an
AllocatorSyncin test builds and panicked otherwise.That gate was tripping benchmarks, which are compiled without the
crdb_testtag, producing failures like:
This PR co-constructs
AllocatorSyncinsideNewStorewhenMMAllocatorisset but
AllocatorSyncis not, mirroring whatserver.goalready doesexplicitly. The fallback in
newMMAStoreRebalanceris replaced with a plainnon-nil assertion, and the now-redundant explicit construction in
localtestclusteris dropped.Verified locally with
./dev bench(which builds with--crdb_test_off,matching the failing TC
RoachprodMicrobenchmarkWeeklyWipconfiguration):Fixes #170455.
Fixes #170456.
Release note: None
Epic: none