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

release-25.1: kvserver: alias range_id in flow control integration tests #139567

Open
wants to merge 7 commits into
base: release-25.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
kvserver: print all flow control integration test puts
Previously, some `TestFlowControl.*` put requests were not printed to
the datadriven test file, only printed to the test log. This commit
updates these tests:

```
TestFlowControlRangeSplitMergeV2
TestFlowControlAdmissionPostSplitMergeV2
```

To also print to the datadriven test file on puts. The test log is also
still written to.

Epic: None
Release note: None
  • Loading branch information
kvoli committed Jan 21, 2025
commit f3f779fb0833f5ef26158f973f818cc9f877e1bf
32 changes: 16 additions & 16 deletions pkg/kv/kvserver/flow_control_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@ func TestFlowControlRangeSplitMergeV2(t *testing.T) {
// formed when adding one of the replicas, before being quickly
// drained.
h.resetV2TokenMetrics(ctx)
h.log("sending put request to pre-split range")
h.comment("(Sending 1 MiB put request to pre-split range.)")
h.put(ctx, k, 1<<20 /* 1MiB */, testFlowModeToPri(mode))
h.log("sent put request to pre-split range")
h.comment("(Sent 1 MiB put request to pre-split range.)")

h.waitForAllTokensReturned(ctx, 3, 0 /* serverIdx */)
h.comment(`
Expand All @@ -222,13 +222,13 @@ func TestFlowControlRangeSplitMergeV2(t *testing.T) {
left, right := tc.SplitRangeOrFatal(t, k.Next())
h.waitForConnectedStreams(ctx, right.RangeID, 3, 0 /* serverIdx */)

h.log("sending 2MiB put request to post-split LHS")
h.comment("(Sending 2 MiB put request to post-split LHS range.)")
h.put(ctx, k, 2<<20 /* 2MiB */, testFlowModeToPri(mode))
h.log("sent 2MiB put request to post-split LHS")
h.comment("(Sent 2 MiB put request to post-split LHS range.)")

h.log("sending 3MiB put request to post-split RHS")
h.comment("(Sending 3 MiB put request to post-split RHS range.)")
h.put(ctx, roachpb.Key(right.StartKey), 3<<20 /* 3MiB */, testFlowModeToPri(mode))
h.log("sent 3MiB put request to post-split RHS")
h.comment("(Sent 3 MiB put request to post-split RHS range.)")

h.waitForAllTokensReturned(ctx, 3, 0 /* serverIdx */)
h.comment(`
Expand All @@ -245,9 +245,9 @@ func TestFlowControlRangeSplitMergeV2(t *testing.T) {
h.comment(`-- (Merging ranges.)`)
merged := tc.MergeRangesOrFatal(t, left.StartKey.AsRawKey())

h.log("sending 4MiB put request to post-merge range")
h.comment("(Sending 4 MiB put request to post-merge range.)")
h.put(ctx, roachpb.Key(merged.StartKey), 4<<20 /* 4MiB */, testFlowModeToPri(mode))
h.log("sent 4MiB put request to post-merged range")
h.comment("(Sent 4 MiB put request to post-merge range.)")

h.waitForAllTokensReturned(ctx, 3, 0 /* serverIdx */)
h.comment(`
Expand Down Expand Up @@ -443,10 +443,10 @@ func TestFlowControlAdmissionPostSplitMergeV2(t *testing.T) {
// drained.
h.resetV2TokenMetrics(ctx)

h.log("sending put request to pre-split range")
h.comment(`(Sending 2 x 1 MiB put request to pre-split range)`)
h.put(ctx, k, 1<<20 /* 1MiB */, testFlowModeToPri(mode))
h.put(ctx, k.Next(), 1<<20 /* 1MiB */, testFlowModeToPri(mode))
h.log("sent put request to pre-split range")
h.comment(`(Sent 2 x 1 MiB put request to pre-split range)`)

h.comment(`
-- Flow token metrics from n1 after issuing a 2*1MiB 3x replicated write
Expand All @@ -460,13 +460,13 @@ func TestFlowControlAdmissionPostSplitMergeV2(t *testing.T) {
left, right := tc.SplitRangeOrFatal(t, k.Next())
h.waitForConnectedStreams(ctx, right.RangeID, 3, 0 /* serverIdx */)

h.log("sending 2MiB put request to post-split LHS")
h.comment(`(Sending 2 MiB put request to post-split LHS range)`)
h.put(ctx, k, 2<<20 /* 2MiB */, testFlowModeToPri(mode))
h.log("sent 2MiB put request to post-split LHS")
h.comment(`(Sent 2 MiB put request to post-split LHS range)`)

h.log("sending 3MiB put request to post-split RHS")
h.comment(`(Sending 3 MiB put request to post-split RHS range)`)
h.put(ctx, roachpb.Key(right.StartKey), 3<<20 /* 3MiB */, testFlowModeToPri(mode))
h.log("sent 3MiB put request to post-split RHS")
h.comment(`(Sent 3 MiB put request to post-split RHS range)`)

h.comment(`
-- Flow token metrics from n1 after further issuing 2MiB and 3MiB writes to
Expand All @@ -482,9 +482,9 @@ func TestFlowControlAdmissionPostSplitMergeV2(t *testing.T) {
h.comment(`-- (Merging ranges.)`)
merged := tc.MergeRangesOrFatal(t, left.StartKey.AsRawKey())

h.log("sending 4MiB put request to post-merge range")
h.comment(`(Sending 4 MiB put request to post-merge range)`)
h.put(ctx, roachpb.Key(merged.StartKey), 4<<20 /* 4MiB */, testFlowModeToPri(mode))
h.log("sent 4MiB put request to post-merged range")
h.comment(`(Sent 4 MiB put request to post-merge range)`)

h.comment(`
-- Flow token metrics from n1 after issuing 4MiB of replicated writes to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
echo
----
----
(Sending 2 x 1 MiB put request to pre-split range)


(Sent 2 x 1 MiB put request to pre-split range)


-- Flow token metrics from n1 after issuing a 2*1MiB 3x replicated write
-- that are yet to get admitted. We see 2*3*1MiB=6MiB deductions of
-- {regular,elastic} tokens with no corresponding returns. The 2*1MiB writes
Expand Down Expand Up @@ -50,6 +56,18 @@ ORDER BY
-- (Splitting range.)


(Sending 2 MiB put request to post-split LHS range)


(Sent 2 MiB put request to post-split LHS range)


(Sending 3 MiB put request to post-split RHS range)


(Sent 3 MiB put request to post-split RHS range)


-- Flow token metrics from n1 after further issuing 2MiB and 3MiB writes to
-- post-split LHS and RHS ranges respectively. We should see 15MiB extra tokens
-- deducted which comes from (2MiB+3MiB)*3=15MiB. So we stand at
Expand Down Expand Up @@ -109,6 +127,12 @@ ORDER BY
-- (Merging ranges.)


(Sending 4 MiB put request to post-merge range)


(Sent 4 MiB put request to post-merge range)


-- Flow token metrics from n1 after issuing 4MiB of replicated writes to
-- the post-merged range. We should see 12MiB extra tokens deducted which comes
-- from 4MiB*3=12MiB. So we stand at 21MiB+12MiB=33MiB tokens deducted now. The
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
echo
----
----
(Sending 2 x 1 MiB put request to pre-split range)


(Sent 2 x 1 MiB put request to pre-split range)


-- Flow token metrics from n1 after issuing a 2*1MiB 3x replicated write
-- that are yet to get admitted. We see 2*3*1MiB=6MiB deductions of
-- {regular,elastic} tokens with no corresponding returns. The 2*1MiB writes
Expand Down Expand Up @@ -50,6 +56,18 @@ ORDER BY
-- (Splitting range.)


(Sending 2 MiB put request to post-split LHS range)


(Sent 2 MiB put request to post-split LHS range)


(Sending 3 MiB put request to post-split RHS range)


(Sent 3 MiB put request to post-split RHS range)


-- Flow token metrics from n1 after further issuing 2MiB and 3MiB writes to
-- post-split LHS and RHS ranges respectively. We should see 15MiB extra tokens
-- deducted which comes from (2MiB+3MiB)*3=15MiB. So we stand at
Expand Down Expand Up @@ -109,6 +127,12 @@ ORDER BY
-- (Merging ranges.)


(Sending 4 MiB put request to post-merge range)


(Sent 4 MiB put request to post-merge range)


-- Flow token metrics from n1 after issuing 4MiB of replicated writes to
-- the post-merged range. We should see 12MiB extra tokens deducted which comes
-- from 4MiB*3=12MiB. So we stand at 21MiB+12MiB=33MiB tokens deducted now. The
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
echo
----
----
(Sending 2 x 1 MiB put request to pre-split range)


(Sent 2 x 1 MiB put request to pre-split range)


-- Flow token metrics from n1 after issuing a 2*1MiB 3x replicated write
-- that are yet to get admitted. We see 2*3*1MiB=6MiB deductions of
-- {regular,elastic} tokens with no corresponding returns. The 2*1MiB writes
Expand Down Expand Up @@ -43,6 +49,18 @@ ORDER BY
-- (Splitting range.)


(Sending 2 MiB put request to post-split LHS range)


(Sent 2 MiB put request to post-split LHS range)


(Sending 3 MiB put request to post-split RHS range)


(Sent 3 MiB put request to post-split RHS range)


-- Flow token metrics from n1 after further issuing 2MiB and 3MiB writes to
-- post-split LHS and RHS ranges respectively. We should see 15MiB extra tokens
-- deducted which comes from (2MiB+3MiB)*3=15MiB. So we stand at
Expand Down Expand Up @@ -102,6 +120,12 @@ ORDER BY
-- (Merging ranges.)


(Sending 4 MiB put request to post-merge range)


(Sent 4 MiB put request to post-merge range)


-- Flow token metrics from n1 after issuing 4MiB of replicated writes to
-- the post-merged range. We should see 12MiB extra tokens deducted which comes
-- from 4MiB*3=12MiB. So we stand at 21MiB+12MiB=33MiB tokens deducted now. The
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
echo
----
----
(Sending 2 x 1 MiB put request to pre-split range)


(Sent 2 x 1 MiB put request to pre-split range)


-- Flow token metrics from n1 after issuing a 2*1MiB 3x replicated write
-- that are yet to get admitted. We see 2*3*1MiB=6MiB deductions of
-- {regular,elastic} tokens with no corresponding returns. The 2*1MiB writes
Expand Down Expand Up @@ -43,6 +49,18 @@ ORDER BY
-- (Splitting range.)


(Sending 2 MiB put request to post-split LHS range)


(Sent 2 MiB put request to post-split LHS range)


(Sending 3 MiB put request to post-split RHS range)


(Sent 3 MiB put request to post-split RHS range)


-- Flow token metrics from n1 after further issuing 2MiB and 3MiB writes to
-- post-split LHS and RHS ranges respectively. We should see 15MiB extra tokens
-- deducted which comes from (2MiB+3MiB)*3=15MiB. So we stand at
Expand Down Expand Up @@ -102,6 +120,12 @@ ORDER BY
-- (Merging ranges.)


(Sending 4 MiB put request to post-merge range)


(Sent 4 MiB put request to post-merge range)


-- Flow token metrics from n1 after issuing 4MiB of replicated writes to
-- the post-merged range. We should see 12MiB extra tokens deducted which comes
-- from 4MiB*3=12MiB. So we stand at 21MiB+12MiB=33MiB tokens deducted now. The
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
echo
----
----
(Sending 1 MiB put request to pre-split range.)


(Sent 1 MiB put request to pre-split range.)


-- Flow token metrics from n1 after issuing + admitting the 1MiB 3x
-- replicated write to the pre-split range. There should be 3MiB of
-- {regular,elastic} tokens {deducted,returned}.
Expand Down Expand Up @@ -49,6 +55,18 @@ ORDER BY
-- (Splitting range.)


(Sending 2 MiB put request to post-split LHS range.)


(Sent 2 MiB put request to post-split LHS range.)


(Sending 3 MiB put request to post-split RHS range.)


(Sent 3 MiB put request to post-split RHS range.)


-- Flow token metrics from n1 after further issuing 2MiB and 3MiB writes to
-- post-split LHS and RHS ranges respectively. We should see 15MiB extra tokens
-- {deducted,returned}, which comes from (2MiB+3MiB)*3=15MiB. So we stand at
Expand Down Expand Up @@ -108,6 +126,12 @@ ORDER BY
-- (Merging ranges.)


(Sending 4 MiB put request to post-merge range.)


(Sent 4 MiB put request to post-merge range.)


-- Flow token metrics from n1 after issuing 4MiB of replicated writes to
-- the post-merged range. We should see 12MiB extra tokens {deducted,returned},
-- which comes from 4MiB*3=12MiB. So we stand at 18MiB+12MiB=30MiB now.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
echo
----
----
(Sending 1 MiB put request to pre-split range.)


(Sent 1 MiB put request to pre-split range.)


-- Flow token metrics from n1 after issuing + admitting the 1MiB 3x
-- replicated write to the pre-split range. There should be 3MiB of
-- {regular,elastic} tokens {deducted,returned}.
Expand Down Expand Up @@ -49,6 +55,18 @@ ORDER BY
-- (Splitting range.)


(Sending 2 MiB put request to post-split LHS range.)


(Sent 2 MiB put request to post-split LHS range.)


(Sending 3 MiB put request to post-split RHS range.)


(Sent 3 MiB put request to post-split RHS range.)


-- Flow token metrics from n1 after further issuing 2MiB and 3MiB writes to
-- post-split LHS and RHS ranges respectively. We should see 15MiB extra tokens
-- {deducted,returned}, which comes from (2MiB+3MiB)*3=15MiB. So we stand at
Expand Down Expand Up @@ -108,6 +126,12 @@ ORDER BY
-- (Merging ranges.)


(Sending 4 MiB put request to post-merge range.)


(Sent 4 MiB put request to post-merge range.)


-- Flow token metrics from n1 after issuing 4MiB of replicated writes to
-- the post-merged range. We should see 12MiB extra tokens {deducted,returned},
-- which comes from 4MiB*3=12MiB. So we stand at 18MiB+12MiB=30MiB now.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
echo
----
----
(Sending 1 MiB put request to pre-split range.)


(Sent 1 MiB put request to pre-split range.)


-- Flow token metrics from n1 after issuing + admitting the 1MiB 3x
-- replicated write to the pre-split range. There should be 3MiB of
-- {regular,elastic} tokens {deducted,returned}.
Expand Down Expand Up @@ -42,6 +48,18 @@ ORDER BY
-- (Splitting range.)


(Sending 2 MiB put request to post-split LHS range.)


(Sent 2 MiB put request to post-split LHS range.)


(Sending 3 MiB put request to post-split RHS range.)


(Sent 3 MiB put request to post-split RHS range.)


-- Flow token metrics from n1 after further issuing 2MiB and 3MiB writes to
-- post-split LHS and RHS ranges respectively. We should see 15MiB extra tokens
-- {deducted,returned}, which comes from (2MiB+3MiB)*3=15MiB. So we stand at
Expand Down Expand Up @@ -101,6 +119,12 @@ ORDER BY
-- (Merging ranges.)


(Sending 4 MiB put request to post-merge range.)


(Sent 4 MiB put request to post-merge range.)


-- Flow token metrics from n1 after issuing 4MiB of replicated writes to
-- the post-merged range. We should see 12MiB extra tokens {deducted,returned},
-- which comes from 4MiB*3=12MiB. So we stand at 18MiB+12MiB=30MiB now.
Expand Down
Loading