Skip to content

Commit

Permalink
Merge #32429
Browse files Browse the repository at this point in the history
32429: storage: fix TestApplyPaginatedCommittedEntries, use MaxCommittedSizePerReady r=nvanbenschoten a=nvanbenschoten

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

Co-authored-by: Nathan VanBenschoten <[email protected]>
  • Loading branch information
craig[bot] and nvanbenschoten committed Nov 16, 2018
2 parents 9f54fc1 + e8c6948 commit ecbef84
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions pkg/storage/replica_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()

Expand All @@ -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 {
Expand Down

0 comments on commit ecbef84

Please sign in to comment.