Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
108357: jobs: fix mixed-version jobs flake r=knz a=adityamaru

Similar to #107570 this is a short term fix for when an a query is executed with an AS OF SYSTEM TIME picks a transaction timestamp before the job_info migration has run. In which case parts of the jobs infrastructure will attempt to query the job_info column even though it doesn't exist at the transaction's timestamp.

As a short term fix, when we encounter an UndefinedObject error for the job_info table we generate a synthetic retryable error so that the txn is pushed to a higher timestamp at which the upgrade will have completed and the job_info table will be visible. The longer term fix is being tracked in #106764.

On master I can no longer reproduce the failure in #105032 but on 23.1 with this change I can successfully run 30 iterations of the test on a seed (-8690666577594439584) which previously saw occurrences of this flake.

Fixes: #103239
Fixes: #105032

Release note: None

108583: rangefeed: deflake `TestBudgetReleaseOnOneStreamError` r=erikgrinaker a=erikgrinaker

The test could fail with `REASON_SLOW_CONSUMER` if the registration goroutine did not drain the queue in time (1 ms). Increase the timeout.

Resolves #108555.

Epic: none
Release note: None

Co-authored-by: adityamaru <[email protected]>
Co-authored-by: Erik Grinaker <[email protected]>
  • Loading branch information
3 people committed Aug 12, 2023
3 parents a37cff6 + 79cc2ea + e35eb38 commit 9184ffb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion pkg/jobs/job_info_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,10 @@ func (i InfoStorage) Write(ctx context.Context, infoKey string, value []byte) er
if value == nil {
return errors.AssertionFailedf("missing value (infoKey %q)", infoKey)
}
return i.write(ctx, infoKey, value)
if err := i.write(ctx, infoKey, value); err != nil {
return MaybeGenerateForcedRetryableError(ctx, i.txn.KV(), err)
}
return nil
}

// Delete removes the info record for the provided infoKey.
Expand Down
2 changes: 1 addition & 1 deletion pkg/kv/kvserver/rangefeed/processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,7 @@ func TestBudgetReleaseOnOneStreamError(t *testing.T) {
PushTxnsInterval: pushTxnInterval,
PushTxnsAge: pushTxnAge,
EventChanCap: channelCapacity,
EventChanTimeout: time.Millisecond,
EventChanTimeout: 100 * time.Millisecond, // enough time for registration to process events
MemBudget: fb,
Metrics: NewMetrics(),
})
Expand Down

0 comments on commit 9184ffb

Please sign in to comment.