Skip to content

Commit

Permalink
Merge #73395 #74552
Browse files Browse the repository at this point in the history
73395: changefeedccl: Explicitly set min_resolved_frequency. r=miretskiy a=miretskiy

Previously, the `resolved` was used to control the frequency of
of aggregators emitting checkpoint information to the frontier.
Now, this frequency is controlled via `min_checkpoint_frequency`.
Set checkpoint frequency to 10s, so that checkpoints are emitted
more frequently.  The default of 30s causes latency verifier
to fail at 1 minute since it's now very easy to simply miss
sending frontier updates (so latency can go up to almost 1 minute),
plus the closed timestamp setting of 10 second can exceed
required thresholds.

Fixes #73295
Fixes #73294
Fixes #72806

Release Notes: none

74552: kv: Allow nil when checking for empty lease. r=knz a=miretskiy

Treat nil lease as empty when checking for empty lease.
Recent changes in #66374
as well as in #74315 changed
how lease is stored as well as modified receiver type.  As a result,
attempts to print empty `EvictionToken{}` will result in a nil panic.

Release Notes: None

Co-authored-by: Yevgeniy Miretskiy <[email protected]>
  • Loading branch information
craig[bot] and Yevgeniy Miretskiy committed Jan 7, 2022
3 parents e73cce6 + 534345f + a5787e8 commit 72c74dc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/cmd/roachtest/tests/cdc.go
Original file line number Diff line number Diff line change
Expand Up @@ -1741,9 +1741,9 @@ func createChangefeed(db *gosql.DB, targets, sinkURL string, args cdcTestArgs) (
createStmt := fmt.Sprintf(`CREATE CHANGEFEED FOR %s INTO $1`, targets)
extraArgs := []interface{}{sinkURL}
if args.whichSink == cloudStorageSink || args.whichSink == webhookSink {
createStmt += ` WITH resolved='10s', envelope=wrapped`
createStmt += ` WITH resolved='10s', envelope=wrapped, min_checkpoint_frequency='10s'`
} else {
createStmt += ` WITH resolved`
createStmt += ` WITH resolved, min_checkpoint_frequency='10s'`
}
if !args.initialScan {
createStmt += `, cursor='-1s'`
Expand Down
2 changes: 1 addition & 1 deletion pkg/roachpb/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -1887,7 +1887,7 @@ func (l *Lease) SafeFormat(w redact.SafePrinter, _ rune) {

// Empty returns true for the Lease zero-value.
func (l *Lease) Empty() bool {
return *l == (Lease{})
return l == nil || *l == (Lease{})
}

// OwnedBy returns whether the given store is the lease owner.
Expand Down
2 changes: 1 addition & 1 deletion pkg/roachpb/string_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func TestLeaseString(t *testing.T) {
},
{
lease: nil,
expected: "<nil>",
expected: "<empty>",
},
{
lease: &roachpb.Lease{
Expand Down

0 comments on commit 72c74dc

Please sign in to comment.