Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kvoli
Copy link
Collaborator

@kvoli kvoli commented Nov 27, 2024

First commit from #136330.


Add a new rac2 flow control integration test,
TestFlowControlSendQueueRangeMigrate.

This test takes the following steps:

-- 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: #132614
Release note: None

@kvoli kvoli self-assigned this Nov 27, 2024
Copy link

blathers-crl bot commented Nov 27, 2024

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.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@kvoli kvoli force-pushed the 241126.rac2-send-queue-test-migrate branch from b390d22 to cd62ab6 Compare November 27, 2024 20:20
@kvoli
Copy link
Collaborator Author

kvoli commented Nov 27, 2024

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.

@kvoli kvoli marked this pull request as ready for review November 27, 2024 20:26
@kvoli kvoli requested review from a team as code owners November 27, 2024 20:26
Copy link
Collaborator

@sumeerbhola sumeerbhola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice test!

:lgtm:

Reviewed 3 of 4 files at r2, all commit messages.
Reviewable status: :shipit: 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.

sumeerbhola and others added 2 commits December 2, 2024 16:04
- 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
@kvoli kvoli force-pushed the 241126.rac2-send-queue-test-migrate branch from cd62ab6 to 5a21e39 Compare December 2, 2024 22:13
@kvoli
Copy link
Collaborator Author

kvoli commented Dec 2, 2024

I'll probably merge this tomorrow morning sometime, after addressing the comment.

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