cockroachdb / cockroachdb/cockroach

admission: remainingTicks == 1 logic in ioLoadListener.allocateTokensTick is not robust

Open
#139,081 0 comments 0 reactions 0 assignees View on GitHub
A-admission-control C-enhancement T-admission-control
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

It is possible that due to small delays, we never see that last tick.
This is relied on by `kvStoreTokenGranter` to reset various elastic tokens to 0 in case they accrued a big deficit.

In an experiment, we observe the following sequence where the only constraint on elastic work is happening via the diskBandwidthLimiter computed tokens. Note that even though the tokenUtilization drops below 1 from the second log entry onwards, it is the 5th log entry that starts showing some growth in elastic tokensUsed (instead of the 3rd log entry).

diskBandwidthLimiter (tokenUtilization 1.30, tokensUsed (elastic 304 KiB, snapshot 0 B, regular 5.3 GiB) tokens (write 4.1 GiB (prev 4.1 GiB), read 0 B (prev 0 B)), writeBW 371 MiB/s, readBW 0 B/s, provisioned 350 MiB/s)

diskBandwidthLimiter (tokenUtilization 0.84, tokensUsed (elastic 307 KiB, snapshot 0 B, regular 3.4 GiB) tokens (write 4.1 GiB (prev 4.1 GiB), read 0 B (prev 0 B)), writeBW 299 MiB/s, readBW 0 B/s, provisioned 350 MiB/s)

diskBandwidthLimiter (tokenUtilization 0.69, tokensUsed (elastic 302 KiB, snapshot 0 B, regular 2.8 GiB) tokens (write 4.1 GiB (prev 4.1 GiB), read 0 B (prev 0 B)), writeBW 205 MiB/s, readBW 0 B/s, provisioned 350 MiB/s)

diskBandwidthLimiter (tokenUtilization 0.71, tokensUsed (elastic 288 KiB, snapshot 0 B, regular 2.9 GiB) tokens (write 4.1 GiB (prev 4.1 GiB), read 0 B (prev 0 B)), writeBW 210 MiB/s, readBW 0 B/s, provisioned 350 MiB/s)

diskBandwidthLimiter (tokenUtilization 0.74, tokensUsed (elastic 37 MiB, snapshot 0 B, regular 3.0 GiB) tokens (write 4.1 GiB (prev 4.1 GiB), read 0 B (prev 0 B)), writeBW 187 MiB/s, readBW 0 B/s, provisioned 350 MiB/s)

diskBandwidthLimiter (tokenUtilization 0.76, tokensUsed (elastic 248 MiB, snapshot 0 B, regular 2.9 GiB) tokens (write 4.1 GiB (prev 4.1 GiB), read 0 B (prev 0 B)), writeBW 195 MiB/s, readBW 0 B/s, provisioned 350 MiB/s)

diskBandwidthLimiter (tokenUtilization 0.84, tokensUsed (elastic 697 MiB, snapshot 0 B, regular 2.8 GiB) tokens (write 4.1 GiB (prev 4.1 GiB), read 0 B (prev 0 B)), writeBW 210 MiB/s, readBW 0 B/s, provisioned 350 MiB/s)

Jira issue: CRDB-46493

Epic CRDB-55046

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.