Skip to content

Commit

Permalink
[dnm] kvserver: 10% synthetic reproposals
Browse files Browse the repository at this point in the history
Hoping to shake out something relevant for
cockroachdb#97102 or
cockroachdb#97141.

Not intended for merge. Can maybe turn this into a metamorphic var down
the road. For now running manually via `./experiment.sh`.

To date, it hasn't produced anything. For the first runs, I ~immediately
got a closed timestamp regression. This was puzzling, but then also
disappeared, so I think my OSX clock might have been adjusting over
those few minutes.

Epic: none
Release note: None
  • Loading branch information
tbg committed Feb 16, 2023
1 parent 9bb7478 commit 685052c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions experiment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -euxo pipefail
./dev build short
roachprod wipe local
roachprod put local cockroach
roachprod start local
roachprod sql local:1 -- -e 'set cluster setting kv.range_split.load_qps_threshold = 9999999'
roachprod ssh local:1 -- ./cockroach workload init kv --splits 1
roachprod ssh local:1 -- ./cockroach workload run kv --read-percent 0 {pgurl} --concurrency 512
4 changes: 4 additions & 0 deletions pkg/kv/kvserver/replica_proposal_buf.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ package kvserver

import (
"context"
"math/rand"
"sync"
"sync/atomic"

Expand Down Expand Up @@ -766,6 +767,9 @@ func (b *propBuf) allocateLAIAndClosedTimestampLocked(
if !p.Request.IsSingleRequestLeaseRequest() {
b.assignedLAI++
lai = b.assignedLAI
if rand.Intn(10) == 5 && lai > 1234 {
lai = 1234 // to spot it visually
}
}

if filter := b.testing.leaseIndexFilter; filter != nil {
Expand Down

0 comments on commit 685052c

Please sign in to comment.