You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
162285: kvserver: remove kv.Sender implementation from Store, Stores, Replica r=tbg a=sumeerbhola
Previously, Store, Stores, and Replica all implemented kv.Sender via their Send methods. This allowed callers to use them interchangeably with other Senders, but obscured an important detail: these Send methods were called from code that did not integrate with admission control.
This commit removes the Send methods from these types. They now implement only SenderWithWriteBytes, which returns the StoreWriteBytes that callers that use admission control must handle appropriately.
For test code that needs a kv.Sender, ToSenderForTesting provides an explicit wrapper that discards the StoreWriteBytes. The "ForTesting" suffix makes it clear that this wrapper bypasses admission control accounting and should only be used in tests.
This change makes admission control bypass explicit: any code path that converts these types to kv.Sender must now visibly call ToSenderForTesting, making it easy to audit which paths skip admission control.
Release note: None
Epic: None
Co-authored-by: sumeerbhola <sumeer@cockroachlabs.com>
0 commit comments