Skip to content

Commit b5cef20

Browse files
craig[bot]erikgrinaker
andcommitted
Merge #110332
110332: rangefeed: increase the txn push interval to 1 second r=erikgrinaker a=erikgrinaker With a default rangefeed closed timestamp interval of 3 seconds, and a default txn age of 10 seconds, there doesn't appear to be a good reason for attempting to push txns every 250 milliseconds. This patch increases the push interval to 1 second, and adds an environment variable `COCKROACH_RANGEFEED_PUSH_TXNS_INTERVAL` to control it. Epic: none Release note (ops change): Rangefeeds regularly attempt to push long-running transactions to a future timestamp in order to emit checkpoints. The interval at which this is attempted has been increased from 250 milliseconds to 1 seconds. This is now configurable via the environment variable `COCKROACH_RANGEFEED_PUSH_TXNS_INTERVAL`. Co-authored-by: Erik Grinaker <grinaker@cockroachlabs.com>
2 parents 0310d11 + fbc7f66 commit b5cef20

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

pkg/kv/kvserver/rangefeed/processor.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,25 @@ import (
1919
"github.com/cockroachdb/cockroach/pkg/kv/kvpb"
2020
"github.com/cockroachdb/cockroach/pkg/roachpb"
2121
"github.com/cockroachdb/cockroach/pkg/storage/enginepb"
22+
"github.com/cockroachdb/cockroach/pkg/util/envutil"
2223
"github.com/cockroachdb/cockroach/pkg/util/future"
2324
"github.com/cockroachdb/cockroach/pkg/util/hlc"
2425
"github.com/cockroachdb/cockroach/pkg/util/log"
2526
"github.com/cockroachdb/cockroach/pkg/util/stop"
2627
"github.com/cockroachdb/errors"
2728
)
2829

29-
const (
30+
var (
3031
// DefaultPushTxnsInterval is the default interval at which a Processor will
3132
// push all transactions in the unresolvedIntentQueue that are above the age
3233
// specified by PushTxnsAge.
33-
DefaultPushTxnsInterval = 250 * time.Millisecond
34+
DefaultPushTxnsInterval = envutil.EnvOrDefaultDuration(
35+
"COCKROACH_RANGEFEED_PUSH_TXNS_INTERVAL", time.Second)
36+
3437
// defaultPushTxnsAge is the default age at which a Processor will begin to
3538
// consider a transaction old enough to push.
36-
defaultPushTxnsAge = 10 * time.Second
39+
defaultPushTxnsAge = envutil.EnvOrDefaultDuration(
40+
"COCKROACH_RANGEFEED_PUSH_TXNS_AGE", 10*time.Second)
3741
)
3842

3943
// newErrBufferCapacityExceeded creates an error that is returned to subscribers

0 commit comments

Comments
 (0)