Skip to content

Commit

Permalink
kvpb: mark subsume as isWrite
Browse files Browse the repository at this point in the history
Now that subsume is required to force flush all replication streams up
to the lease applied index it froze the range at, it also needs to be
marked as a write in order to pass through the replication code path,
which update the range controller force flush index.

Part of: #132614
Release note: None
  • Loading branch information
kvoli committed Dec 3, 2024
1 parent ef46c67 commit e4f0e32
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions pkg/kv/kvnemesis/kvnemesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,14 @@ func testKVNemesisImpl(t *testing.T, cfg kvnemesisTestCfg) {
if config.NumReplicas > cfg.numNodes {
config.NumReplicas = cfg.numNodes
}
if cfg.invalidLeaseAppliedIndexProb > 0 {
// Merge requests issue a subsume request, which uses the lease applied
// index to freeze the range and force flush to the frozen index. Injecting
// invalid lease applied indices will cause the merge to fail on the
// subsume.
config.Ops.Merge.MergeIsSplit = 0
config.Ops.Merge.MergeNotSplit = 0
}
logger := newTBridge(t)
env := &Env{SQLDBs: sqlDBs, Tracker: tr, L: logger}
failures, err := RunNemesis(ctx, rng, env, config, cfg.concurrency, cfg.numSteps, dbs...)
Expand Down
2 changes: 1 addition & 1 deletion pkg/kv/kvpb/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -2113,7 +2113,7 @@ func (r *RefreshRangeRequest) flags() flag {
return isRead | isTxn | isRange | updatesTSCache
}

func (*SubsumeRequest) flags() flag { return isRead | isAlone | updatesTSCache }
func (*SubsumeRequest) flags() flag { return isWrite | isAlone | updatesTSCache }
func (*RangeStatsRequest) flags() flag { return isRead }
func (*QueryResolvedTimestampRequest) flags() flag {
return isRead | isRange | requiresClosedTSOlderThanStorageSnapshot
Expand Down

0 comments on commit e4f0e32

Please sign in to comment.