Skip to content

[WIP] admission: generalize store write admission control#75120

Closed
sumeerbhola wants to merge 1 commit intocockroachdb:masterfrom
sumeerbhola:admission_bytes
Closed

[WIP] admission: generalize store write admission control#75120
sumeerbhola wants to merge 1 commit intocockroachdb:masterfrom
sumeerbhola:admission_bytes

Conversation

@sumeerbhola
Copy link
Copy Markdown
Collaborator

The store write admission control path now uses a StoreWorkQueue
which wraps a WorkQueue and provides additional functionality:

  • Work can specify WriteBytes and whether it is an IngestRequest.
    This is used to decide how many byte tokens to consume.
  • Done work specifies how many bytes were ingested into L0, so
    token consumption can be adjusted.

The main framework change is that a single work item can consume
multiple (byte) tokens, which ripples through the various
interfaces including requester, granter. There is associated
cleanup: kvGranter that was handling both slots and tokens is
eliminated since in practice it was only doing one or the other.
Instead for the slot case the slotGranter is reused. For the token
case the kvStoreTokenGranter is created.

The main logic change is in ioLoadListener which computes byte
tokens and various estimates.

There are TODOs to fix tests that will fail.

Informs #75066

Release note: None

The store write admission control path now uses a StoreWorkQueue
which wraps a WorkQueue and provides additional functionality:
- Work can specify WriteBytes and whether it is an IngestRequest.
  This is used to decide how many byte tokens to consume.
- Done work specifies how many bytes were ingested into L0, so
  token consumption can be adjusted.

The main framework change is that a single work item can consume
multiple (byte) tokens, which ripples through the various
interfaces including requester, granter. There is associated
cleanup: kvGranter that was handling both slots and tokens is
eliminated since in practice it was only doing one or the other.
Instead for the slot case the slotGranter is reused. For the token
case the kvStoreTokenGranter is created.

The main logic change is in ioLoadListener which computes byte
tokens and various estimates.

There are TODOs to fix tests that will fail.

Informs cockroachdb#75066

Release note: None
@sumeerbhola sumeerbhola requested a review from a team January 19, 2022 02:08
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@sumeerbhola
Copy link
Copy Markdown
Collaborator Author

see comment in #75066 (comment)

@irfansharif
Copy link
Copy Markdown
Contributor

I believe this work was done through #80480 (was reading through admission code and learning about inflight PRs, came across this).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants