Skip to content

Comments

kvserver: add ff index to TestFlowControlSendQueueRange*#136512

Closed
kvoli wants to merge 8 commits intocockroachdb:masterfrom
kvoli:241202.rac2-send-queue-test-inspect
Closed

kvserver: add ff index to TestFlowControlSendQueueRange*#136512
kvoli wants to merge 8 commits intocockroachdb:masterfrom
kvoli:241202.rac2-send-queue-test-inspect

Conversation

@kvoli
Copy link
Contributor

@kvoli kvoli commented Dec 2, 2024

First two commits from #136330
Third commit from #136258


kvflowcontrol: add force flush index to inspectz (range) handle

This commit introduces a new field on kvflowinspectpb.Handle,
ForceFlushIndex.

ForceFlushIndex is an index up to (and including) which the range
controller running in pull mode must force-flush all send streams.

This is intended for use in live debugging and asserting on state in
testing.


sql: add force_flush_index to internal.kv_flow_control_handles_v2

Add a new column force_flush_index to
crdb_internal.kv_flow_control_handles_v2.

The column value represents an index up to (and including) which the
range controller running in pull mode must force-flush all send streams.


kvserver: add ff index to TestFlowControlSendQueueRangeSplitMerge

Add new echo testdata assertions on the force_flush_index of the test
ranges pre-split, post-split and post-merge, in
TestFlowControlSendQueueRangeSplitMerge.


kvserver: add ff index to TestFlowControlSendQueueRangeMigrate

Add new echo testdata assertions on the force_flush_index of the test
ranges pre-migrate and post-migrate in
TestFlowControlSendQueueRangeMigrate.

Part of: #132614
Release note: None

sumeerbhola and others added 3 commits November 27, 2024 17:54
…geController

This is used to set the highest index up to which all send-queues in
pull mode must be force-flushed.

Informs cockroachdb#135601

Epic: CRDB-37515

Release note: None
- 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,
`TestFlowControlSendQueueRangeSplitMerge`.

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, split it, write a 1 MiB put to the
-- RHS range, merge the ranges, and write a 1 MiB put to the merged range. We
-- expect that at each stage where a send queue develops n1->s3, the send queue
-- will be flushed by the range merge and range split range operations.
```

Part of: cockroachdb#132614
Release note: None
@blathers-crl
Copy link

blathers-crl bot commented Dec 2, 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 added 5 commits December 2, 2024 14:53
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
This commit introduces a new field on `kvflowinspectpb.Handle`,
`ForceFlushIndex`.

`ForceFlushIndex` is an index up to (and including) which the range
controller running in pull mode must force-flush all send streams.

This is intended for use in live debugging and asserting on state in
testing.

Part of: cockroachdb#132614
Release note: None
Add a new column `force_flush_index` to
`crdb_internal.kv_flow_control_handles_v2`.

The column value represents an index up to (and including) which the
range controller running in pull mode must force-flush all send streams.

Part of: cockroachdb#132614
Release note: None
Add new echo testdata assertions on the `force_flush_index` of the test
ranges pre-split, post-split and post-merge, in
`TestFlowControlSendQueueRangeSplitMerge`.

Part of: cockroachdb#132614
Release note: None
Add new echo testdata assertions on the force_flush_index of the test
ranges pre-migrate and post-migrate in
`TestFlowControlSendQueueRangeMigrate`.

Part of: cockroachdb#132614
Release note: None
@kvoli kvoli force-pushed the 241202.rac2-send-queue-test-inspect branch from 2c45a5f to 1f453b1 Compare December 2, 2024 19:57
@kvoli kvoli self-assigned this Dec 2, 2024
@kvoli kvoli closed this Dec 2, 2024
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