From e8c6948fea93b9ec039d04c2fb48e0d6f2458646 Mon Sep 17 00:00:00 2001 From: Nathan VanBenschoten Date: Fri, 16 Nov 2018 16:38:18 -0500 Subject: [PATCH] storage: fix TestApplyPaginatedCommittedEntries, use MaxCommittedSizePerReady I forgot to point 4787e3c towards this test. With that change, the test was passing even without the corresponding fix. This commit changes the test to also adopt `RaftMaxCommittedSizePerReady`, so that it fails again without the fix from 38b4827. Release note: None --- pkg/storage/replica_test.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pkg/storage/replica_test.go b/pkg/storage/replica_test.go index a2e85fb72a1c..e03c072144f6 100644 --- a/pkg/storage/replica_test.go +++ b/pkg/storage/replica_test.go @@ -9671,11 +9671,9 @@ func TestApplyPaginatedCommittedEntries(t *testing.T) { tc := testContext{} tsc := TestStoreConfig(nil) - // Drop the RaftMaxSizePerMsg so that even small Raft entries have their - // application paginated. - // TODO(nvanbenschoten): Switch this to using the new MaxCommitedSizePerReady - // configuration once #31511 is addressed. - tsc.RaftMaxSizePerMsg = 128 + // Drop the RaftMaxCommittedSizePerReady so that even small Raft entries + // trigger pagination during entry application. + tsc.RaftMaxCommittedSizePerReady = 128 // Slow down the tick interval dramatically so that Raft groups can't rely // on ticks to trigger Raft ready iterations. tsc.RaftTickInterval = 5 * time.Second @@ -9722,7 +9720,7 @@ func TestApplyPaginatedCommittedEntries(t *testing.T) { for i := 0; i < 50; i++ { var ba2 roachpb.BatchRequest key := roachpb.Key("a") - put := putArgs(key, make([]byte, 2*tsc.RaftMaxSizePerMsg)) + put := putArgs(key, make([]byte, 2*tsc.RaftMaxCommittedSizePerReady)) ba2.Add(&put) ba2.Timestamp = tc.Clock().Now() @@ -9735,7 +9733,7 @@ func TestApplyPaginatedCommittedEntries(t *testing.T) { // Stop blocking Raft application. All of the proposals should quickly // commit and apply, even if their application is paginated due to the - // small RaftMaxSizePerMsg. + // small RaftMaxCommittedSizePerReady. close(blockRaftApplication) const maxWait = 10 * time.Second select {