-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kvserver: add TestFlowControlSendQueueRangeMigrate test #136264
base: master
Are you sure you want to change the base?
kvserver: add TestFlowControlSendQueueRangeMigrate test #136264
Conversation
Your pull request contains more than 1000 changes. It is strongly encouraged to split big PRs into smaller chunks. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
b390d22
to
cd62ab6
Compare
Should be good for review, ignoring the first commit (I won't merge this until after we merge the split-out fixes from #136077). ptal @sumeerbhola. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice test!
Reviewed 3 of 4 files at r2, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @kvoli)
pkg/kv/kvserver/kvserverbase/knobs.go
line 57 at r2 (raw file):
// OverrideDoTimelyApplicationToAllReplicas overrides setting the timely // replication directive which force flushes rac2 send queues to all
This comment is overly broad. This bool only affects below-raft migrations, and it is only making the code pretend that the cluster version is recent enough. I am guessing this was needed since the test is starting from an older cluster version, in order to exercise migrations, and we don't have two cluster versions more recent that V25_1_AddRangeForceFlushKey since this is a new cluster version.
- ReplicatedEvalResult.DoTimelyApplicationToAllReplicas is added and set in splitTriggerHelper, MergeTrigger, Migrate, Subsume. - The previous setting to true is gated on cluster version V25_1_AddRangeForceFlushKey. - This causes ReplicaState.ForceFlushIndex to be set, and RangeForceFlushKey (a replicated range-id local key) to be written when applying the corresponding batch to the state machine. The index is set to the index of the entry being applied, and is monotonically increasing. - replica_rac2.Processor and rac2.RangeController have existing ForceFlushIndexChangedLocked methods that are called whenever the Replica sees a change in the force-flush-index. Fixes cockroachdb#135601 Epic: CRDB-37515 Release note: None
Add a new rac2 flow control integration test, `TestFlowControlSendQueueRangeMigrate`. This test takes the following steps: ```sql -- We will exhaust the tokens across all streams while admission is blocked on -- n3, using a single 4 MiB (deduction, the write itself is small) write. Then, -- we will write a 1 MiB put to the range, migrate the range, and write a 1 MiB -- put to the migrated range. We expect that the migration will trigger a force -- flush of the send queue. ``` Part of: cockroachdb#132614 Release note: None
cd62ab6
to
5a21e39
Compare
I'll probably merge this tomorrow morning sometime, after addressing the comment. |
First commit from #136330.
Add a new rac2 flow control integration test,
TestFlowControlSendQueueRangeMigrate
.This test takes the following steps:
Part of: #132614
Release note: None