cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
30.15k stars 3.81k forks source link

kvserver/liveness: liveness storage sends batch requests without admission header #130014

Open stevendanna opened 2 months ago

stevendanna commented 2 months ago

Describe the problem

At least one source of the reports found in #112680 is likely the following to uses of the Get and Scan methods onkv.DB in liveness.Storage:

https://github.com/cockroachdb/cockroach/blob/a1cfb1b5573b1f606ea9527ae93025c2ef667e4e/pkg/kv/kvserver/liveness/storage.go#L73

https://github.com/cockroachdb/cockroach/blob/a1cfb1b5573b1f606ea9527ae93025c2ef667e4e/pkg/kv/kvserver/liveness/storage.go#L201

Replacing these two uses a db.Txn() avoids the warning in a good number of the reproductions I've seen locally. We likely don't want a Txn here though, so we'll want to use a different API that allows us to pass in an admission header.

Jira issue: CRDB-41842

blathers-crl[bot] commented 2 months ago

Hi @stevendanna, please add branch-* labels to identify which branch(es) this C-bug affects.

:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

aadityasondhi commented 2 months ago

Thanks for reporting this and finding the source!