Skip to content

Commit 44853b2

Browse files
craig[bot]jbowenssumeerbholabghal
committed
149860: storage: remove seekVersion's next-before-seek optimization r=jbowens a=jbowens The pebble.Iterator has its own try-seek-using-next optimization that happens automatically when performing successive seeks with increasing keys. This obviates the need for the pebbleMVCCScanner performing its own next-before-seek optimization. Simplify the code through removing the optimization from seekVersion. ``` goos: linux goarch: amd64 cpu: Intel(R) Xeon(R) CPU @ 2.80GHz │ old.txt │ new.txt │ │ sec/op │ sec/op vs base │ MVCCGet/batch=false/versions=1/valueSize=8/numRangeKeys=0 4.803µ ± 1% 4.841µ ± 2% ~ (p=0.394 n=6) MVCCGet/batch=false/versions=1/valueSize=8/numRangeKeys=1 8.157µ ± 2% 8.293µ ± 1% ~ (p=0.165 n=6) MVCCGet/batch=false/versions=1/valueSize=8/numRangeKeys=100 22.36µ ± 1% 22.31µ ± 1% ~ (p=0.485 n=6) MVCCGet/batch=false/versions=10/valueSize=8/numRangeKeys=0 16.53µ ± 3% 15.47µ ± 1% -6.39% (p=0.002 n=6) MVCCGet/batch=false/versions=10/valueSize=8/numRangeKeys=1 20.32µ ± 2% 19.72µ ± 2% -2.99% (p=0.002 n=6) MVCCGet/batch=false/versions=10/valueSize=8/numRangeKeys=100 34.39µ ± 4% 32.81µ ± 2% -4.58% (p=0.002 n=6) MVCCGet/batch=false/versions=100/valueSize=8/numRangeKeys=0 50.68µ ± 2% 47.36µ ± 2% -6.54% (p=0.002 n=6) MVCCGet/batch=false/versions=100/valueSize=8/numRangeKeys=1 56.52µ ± 1% 52.67µ ± 1% -6.82% (p=0.002 n=6) MVCCGet/batch=false/versions=100/valueSize=8/numRangeKeys=100 79.00µ ± 1% 75.10µ ± 3% -4.94% (p=0.002 n=6) MVCCGet/batch=true/versions=1/valueSize=8/numRangeKeys=0 2.447µ ± 1% 2.485µ ± 1% +1.53% (p=0.009 n=6) MVCCGet/batch=true/versions=1/valueSize=8/numRangeKeys=1 3.812µ ± 2% 3.791µ ± 1% ~ (p=0.485 n=6) MVCCGet/batch=true/versions=1/valueSize=8/numRangeKeys=100 9.370µ ± 3% 9.179µ ± 4% ~ (p=0.180 n=6) MVCCGet/batch=true/versions=10/valueSize=8/numRangeKeys=0 14.04µ ± 2% 13.47µ ± 1% -4.02% (p=0.002 n=6) MVCCGet/batch=true/versions=10/valueSize=8/numRangeKeys=1 16.50µ ± 1% 15.75µ ± 2% -4.53% (p=0.002 n=6) MVCCGet/batch=true/versions=10/valueSize=8/numRangeKeys=100 24.84µ ± 3% 24.39µ ± 2% ~ (p=0.061 n=6) MVCCGet/batch=true/versions=100/valueSize=8/numRangeKeys=0 48.35µ ± 1% 45.72µ ± 1% -5.44% (p=0.002 n=6) MVCCGet/batch=true/versions=100/valueSize=8/numRangeKeys=1 51.77µ ± 2% 49.16µ ± 1% -5.04% (p=0.002 n=6) MVCCGet/batch=true/versions=100/valueSize=8/numRangeKeys=100 68.89µ ± 1% 66.10µ ± 1% -4.05% (p=0.002 n=6) geomean 19.69µ 19.07µ -3.15% ``` Epic: none Release note: none 150014: kvserver: add storage.disk.{read,write}-max.iops r=RaduBerinde,annrpom a=sumeerbhola Example with kv50: <img width="783" height="759" alt="Screenshot 2025-07-11 at 4 08 11 PM" src="https://github.com/user-attachments/assets/e8e3e282-f28f-4f68-85dd-4668cfb15793" /> Fixes #150002 Epic: none Release note: None 150019: sql: standardize retryable spelling r=bghal a=bghal Fixes the spelling in the `sql` package. ``` (r|R)etriable $1etryable pkg/sql/*.go ``` Epic: none Release note: None Co-authored-by: Jackson Owens <[email protected]> Co-authored-by: sumeerbhola <[email protected]> Co-authored-by: Brendan Gerrity <[email protected]>
4 parents cbdd88b + 345c33f + 006c443 + e15d25f commit 44853b2

26 files changed

+390
-396
lines changed

docs/generated/metrics/metrics.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16185,6 +16185,14 @@ layers:
1618516185
unit: BYTES
1618616186
aggregation: AVG
1618716187
derivative: NONE
16188+
- name: storage.disk.read-max.iops
16189+
exported_name: storage_disk_read_max_iops
16190+
description: Maximum rate of read operations performed on the disk (as reported by the OS)
16191+
y_axis_label: Operations
16192+
type: GAUGE
16193+
unit: COUNT
16194+
aggregation: AVG
16195+
derivative: NONE
1618816196
- name: storage.disk.read.bytes
1618916197
exported_name: storage_disk_read_bytes
1619016198
description: Bytes read from the store's disk since this process started (as reported by the OS)
@@ -16225,6 +16233,14 @@ layers:
1622516233
unit: BYTES
1622616234
aggregation: AVG
1622716235
derivative: NONE
16236+
- name: storage.disk.write-max.iops
16237+
exported_name: storage_disk_write_max_iops
16238+
description: Maximum rate of write operations performed on the disk (as reported by the OS)
16239+
y_axis_label: Operations
16240+
type: GAUGE
16241+
unit: COUNT
16242+
aggregation: AVG
16243+
derivative: NONE
1622816244
- name: storage.disk.write.bytes
1622916245
exported_name: storage_disk_write_bytes
1623016246
description: Bytes written to the store's disk since this process started (as reported by the OS)

pkg/kv/kvserver/metrics.go

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2761,8 +2761,19 @@ Note that the measurement does not include the duration for replicating the eval
27612761
Measurement: "Operations",
27622762
Help: "IO operations currently in progress on the store's disk (as reported by the OS)",
27632763
}
2764-
// The disk rate metrics are computed using data sampled on the interval,
2765-
// COCKROACH_DISK_STATS_POLLING_INTERVAL.
2764+
// The max disk rate metrics are computed using data sampled at
2765+
// DefaultDiskStatsPollingInterval, which defaults to 100ms, and scaled up
2766+
// to be a per-second rate. This is useful to observe short duration spikes
2767+
// which could result in throttling (and higher observed operation latency),
2768+
// that are not visible by computing the rate over the counter metrics that
2769+
// are sampled at the longer DefaultMetricsSampleInterval (10s).
2770+
//
2771+
// The expected usage is when a latency histogram, such as the fsync latency
2772+
// or disk read latency shows high tail latency, while the normal rate
2773+
// metrics show disk bandwidth and IOPS lower than the provisioned values.
2774+
// If these max rate metrics show usage close to the provisioned value, one
2775+
// can blame the high usage for the higher latency, and not blame it on
2776+
// unrelated slowness in the disk infrastructure.
27662777
metaDiskReadMaxBytesPerSecond = metric.Metadata{
27672778
Name: "storage.disk.read-max.bytespersecond",
27682779
Unit: metric.Unit_BYTES,
@@ -2775,6 +2786,18 @@ Note that the measurement does not include the duration for replicating the eval
27752786
Measurement: "Bytes",
27762787
Help: "Maximum rate at which bytes were written to disk (as reported by the OS)",
27772788
}
2789+
metaDiskReadMaxIOPS = metric.Metadata{
2790+
Name: "storage.disk.read-max.iops",
2791+
Unit: metric.Unit_COUNT,
2792+
Measurement: "Operations",
2793+
Help: "Maximum rate of read operations performed on the disk (as reported by the OS)",
2794+
}
2795+
metaDiskWriteMaxIOPS = metric.Metadata{
2796+
Name: "storage.disk.write-max.iops",
2797+
Unit: metric.Unit_COUNT,
2798+
Measurement: "Operations",
2799+
Help: "Maximum rate of write operations performed on the disk (as reported by the OS)",
2800+
}
27782801
)
27792802

27802803
// StoreMetrics is the set of metrics for a given store.
@@ -3212,6 +3235,8 @@ type StoreMetrics struct {
32123235
DiskIopsInProgress *metric.Gauge
32133236
DiskReadMaxBytesPerSecond *metric.Gauge
32143237
DiskWriteMaxBytesPerSecond *metric.Gauge
3238+
DiskReadMaxIOPS *metric.Gauge
3239+
DiskWriteMaxIOPS *metric.Gauge
32153240
}
32163241

32173242
// TenantsStorageMetrics are metrics which are aggregated over all tenants
@@ -3990,6 +4015,8 @@ func newStoreMetrics(histogramWindow time.Duration) *StoreMetrics {
39904015
DiskIopsInProgress: metric.NewGauge(metaDiskIopsInProgress),
39914016
DiskReadMaxBytesPerSecond: metric.NewGauge(metaDiskReadMaxBytesPerSecond),
39924017
DiskWriteMaxBytesPerSecond: metric.NewGauge(metaDiskWriteMaxBytesPerSecond),
4018+
DiskReadMaxIOPS: metric.NewGauge(metaDiskReadMaxIOPS),
4019+
DiskWriteMaxIOPS: metric.NewGauge(metaDiskWriteMaxIOPS),
39934020

39944021
// Estimated MVCC stats in split.
39954022
SplitsWithEstimatedStats: metric.NewCounter(metaSplitEstimatedStats),
@@ -4262,11 +4289,14 @@ func (sm *StoreMetrics) updateDiskStats(
42624289
log.Errorf(ctx, "not updating cumulative stats due to %s", cumulativeStatsErr)
42634290
}
42644291
maxRollingStats := rollingStats.Max()
4265-
// maxRollingStats is computed as the change in stats every 100ms, so we
4266-
// scale them to represent the change in stats every 1s.
4292+
// maxRollingStats is computed as the change in stats every 100ms
4293+
// (DefaultDiskStatsPollingInterval), so we scale them to represent the
4294+
// change in stats every 1s.
42674295
perSecondMultiplier := int(time.Second / disk.DefaultDiskStatsPollingInterval)
42684296
sm.DiskReadMaxBytesPerSecond.Update(int64(maxRollingStats.BytesRead() * perSecondMultiplier))
42694297
sm.DiskWriteMaxBytesPerSecond.Update(int64(maxRollingStats.BytesWritten() * perSecondMultiplier))
4298+
sm.DiskReadMaxIOPS.Update(int64(maxRollingStats.ReadsCount * perSecondMultiplier))
4299+
sm.DiskWriteMaxIOPS.Update(int64(maxRollingStats.WritesCount * perSecondMultiplier))
42704300
}
42714301

42724302
func (sm *StoreMetrics) handleMetricsResult(ctx context.Context, metric result.Metrics) {

pkg/sql/conn_executor.go

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,13 @@ var detailedLatencyMetricLabel = "fingerprint"
281281
// the fact that there's two distinct categories of errors to speak of. There
282282
// are "query execution errors" and there are the rest. Most things fall in the
283283
// former category: invalid queries, queries that fail constraints at runtime,
284-
// data unavailability errors, retriable errors (i.e. serializability
284+
// data unavailability errors, retryable errors (i.e. serializability
285285
// violations) "internal errors" (e.g. connection problems in the cluster). This
286286
// category of errors doesn't represent dramatic events as far as the connExecutor
287287
// is concerned: they produce "results" for the query to be passed to the client
288288
// just like more successful queries do and they produce Events for the
289289
// state machine just like the successful queries (the events in question
290-
// are generally event{non}RetriableErr and they generally cause the
290+
// are generally event{non}RetryableErr and they generally cause the
291291
// state machine to move to the Aborted state, but the connExecutor doesn't
292292
// concern itself with this). The way the connExecutor reacts to these errors is
293293
// the same as how it reacts to a successful query completing: it moves the
@@ -1374,19 +1374,19 @@ func (ex *connExecutor) close(ctx context.Context, closeType closeType) {
13741374

13751375
var payloadErr error
13761376
if closeType == normalClose {
1377-
// We'll cleanup the SQL txn by creating a non-retriable (commit:true) event.
1377+
// We'll cleanup the SQL txn by creating a non-retryable (commit:true) event.
13781378
// This event is guaranteed to be accepted in every state.
1379-
ev := eventNonRetriableErr{IsCommit: fsm.True}
1379+
ev := eventNonRetryableErr{IsCommit: fsm.True}
13801380
payloadErr = connExecutorNormalCloseErr
1381-
payload := eventNonRetriableErrPayload{err: payloadErr}
1381+
payload := eventNonRetryableErrPayload{err: payloadErr}
13821382
if err := ex.machine.ApplyWithPayload(ctx, ev, payload); err != nil {
13831383
log.Warningf(ctx, "error while cleaning up connExecutor: %s", err)
13841384
}
13851385
switch t := ex.machine.CurState().(type) {
13861386
case stateNoTxn:
13871387
// No txn to finish.
13881388
case stateAborted:
1389-
// A non-retriable error with IsCommit set to true causes the transaction
1389+
// A non-retryable error with IsCommit set to true causes the transaction
13901390
// to be cleaned up.
13911391
case stateCommitWait:
13921392
ex.state.finishSQLTxn()
@@ -2397,8 +2397,8 @@ func (ex *connExecutor) execCmd() (retErr error) {
23972397
if !ok {
23982398
err := pgerror.Newf(
23992399
pgcode.InvalidCursorName, "unknown portal %q", portalName)
2400-
ev = eventNonRetriableErr{IsCommit: fsm.False}
2401-
payload = eventNonRetriableErrPayload{err: err}
2400+
ev = eventNonRetryableErr{IsCommit: fsm.False}
2401+
payload = eventNonRetryableErrPayload{err: err}
24022402
res = ex.clientComm.CreateErrorResult(pos)
24032403
return nil
24042404
}
@@ -2512,8 +2512,8 @@ func (ex *connExecutor) execCmd() (retErr error) {
25122512
ev, payload = ex.execDelPrepStmt(ctx, tcmd)
25132513
case SendError:
25142514
res = ex.clientComm.CreateErrorResult(pos)
2515-
ev = eventNonRetriableErr{IsCommit: fsm.False}
2516-
payload = eventNonRetriableErrPayload{err: tcmd.Err}
2515+
ev = eventNonRetryableErr{IsCommit: fsm.False}
2516+
payload = eventNonRetryableErrPayload{err: tcmd.Err}
25172517
case Sync:
25182518
// The Postgres docs say: "At completion of each series of extended-query
25192519
// messages, the frontend should issue a Sync message. This parameterless
@@ -2595,7 +2595,7 @@ func (ex *connExecutor) execCmd() (retErr error) {
25952595
// otherwise there will be leftover bytes.
25962596
shouldClosePausablePortalsAndCursors := func(payload fsm.EventPayload) bool {
25972597
switch payload.(type) {
2598-
case eventNonRetriableErrPayload, eventRetriableErrPayload:
2598+
case eventNonRetryableErrPayload, eventRetryableErrPayload:
25992599
return true
26002600
default:
26012601
return false
@@ -3039,10 +3039,10 @@ func (ex *connExecutor) execCopyOut(
30393039
// Even in the cases where the error is a retryable error, we want to
30403040
// intercept the event and payload returned here to ensure that the query
30413041
// is not retried.
3042-
retEv = eventNonRetriableErr{
3042+
retEv = eventNonRetryableErr{
30433043
IsCommit: fsm.FromBool(false),
30443044
}
3045-
retPayload = eventNonRetriableErrPayload{err: cancelchecker.QueryCanceledError}
3045+
retPayload = eventNonRetryableErrPayload{err: cancelchecker.QueryCanceledError}
30463046
}
30473047

30483048
// If the query timed out, we intercept the error, payload, and event here
@@ -3058,15 +3058,15 @@ func (ex *connExecutor) execCopyOut(
30583058
if queryTimedOut {
30593059
// A timed out query should never produce retryable errors/events/payloads
30603060
// so we intercept and overwrite them all here.
3061-
retEv = eventNonRetriableErr{
3061+
retEv = eventNonRetryableErr{
30623062
IsCommit: fsm.FromBool(false),
30633063
}
3064-
retPayload = eventNonRetriableErrPayload{err: sqlerrors.QueryTimeoutError}
3064+
retPayload = eventNonRetryableErrPayload{err: sqlerrors.QueryTimeoutError}
30653065
} else if txnTimedOut {
3066-
retEv = eventNonRetriableErr{
3066+
retEv = eventNonRetryableErr{
30673067
IsCommit: fsm.FromBool(false),
30683068
}
3069-
retPayload = eventNonRetriableErrPayload{err: sqlerrors.TxnTimeoutError}
3069+
retPayload = eventNonRetryableErrPayload{err: sqlerrors.TxnTimeoutError}
30703070
}
30713071
}(ctx)
30723072

@@ -3139,8 +3139,8 @@ func (ex *connExecutor) execCopyOut(
31393139

31403140
return nil
31413141
}); copyErr != nil {
3142-
ev := eventNonRetriableErr{IsCommit: fsm.False}
3143-
payload := eventNonRetriableErrPayload{err: copyErr}
3142+
ev := eventNonRetryableErr{IsCommit: fsm.False}
3143+
payload := eventNonRetryableErrPayload{err: copyErr}
31443144
return ev, payload
31453145
}
31463146
return nil, nil
@@ -3272,8 +3272,8 @@ func (ex *connExecutor) execCopyIn(
32723272
)
32733273
}
32743274
if copyErr != nil {
3275-
ev := eventNonRetriableErr{IsCommit: fsm.False}
3276-
payload := eventNonRetriableErrPayload{err: copyErr}
3275+
ev := eventNonRetryableErr{IsCommit: fsm.False}
3276+
payload := eventNonRetryableErrPayload{err: copyErr}
32773277
return ev, payload
32783278
}
32793279

@@ -3313,10 +3313,10 @@ func (ex *connExecutor) execCopyIn(
33133313
// Even in the cases where the error is a retryable error, we want to
33143314
// intercept the event and payload returned here to ensure that the query
33153315
// is not retried.
3316-
retEv = eventNonRetriableErr{
3316+
retEv = eventNonRetryableErr{
33173317
IsCommit: fsm.FromBool(false),
33183318
}
3319-
retPayload = eventNonRetriableErrPayload{err: cancelchecker.QueryCanceledError}
3319+
retPayload = eventNonRetryableErrPayload{err: cancelchecker.QueryCanceledError}
33203320
}
33213321

33223322
cm.Close(ctx)
@@ -3334,15 +3334,15 @@ func (ex *connExecutor) execCopyIn(
33343334
if queryTimedOut {
33353335
// A timed out query should never produce retryable errors/events/payloads
33363336
// so we intercept and overwrite them all here.
3337-
retEv = eventNonRetriableErr{
3337+
retEv = eventNonRetryableErr{
33383338
IsCommit: fsm.FromBool(false),
33393339
}
3340-
retPayload = eventNonRetriableErrPayload{err: sqlerrors.QueryTimeoutError}
3340+
retPayload = eventNonRetryableErrPayload{err: sqlerrors.QueryTimeoutError}
33413341
} else if txnTimedOut {
3342-
retEv = eventNonRetriableErr{
3342+
retEv = eventNonRetryableErr{
33433343
IsCommit: fsm.FromBool(false),
33443344
}
3345-
retPayload = eventNonRetriableErrPayload{err: sqlerrors.TxnTimeoutError}
3345+
retPayload = eventNonRetryableErrPayload{err: sqlerrors.TxnTimeoutError}
33463346
}
33473347
}(ctx)
33483348

@@ -3406,16 +3406,16 @@ func (ex *connExecutor) execCopyIn(
34063406
}
34073407
return cm.run(ctx)
34083408
}); copyErr != nil {
3409-
// TODO(andrei): We don't have a full retriable error story for the copy machine.
3409+
// TODO(andrei): We don't have a full retryable error story for the copy machine.
34103410
// When running outside of a txn, the copyMachine should probably do retries
34113411
// internally - this is partially done, see `copyMachine.insertRows`.
34123412
// When not, it's unclear what we should do. For now, we abort
34133413
// the txn (if any).
34143414
// We also don't have a story for distinguishing communication errors (which
34153415
// should terminate the connection) from query errors. For now, we treat all
34163416
// errors as query errors.
3417-
ev := eventNonRetriableErr{IsCommit: fsm.False}
3418-
payload := eventNonRetriableErrPayload{err: copyErr}
3417+
ev := eventNonRetryableErr{IsCommit: fsm.False}
3418+
payload := eventNonRetryableErrPayload{err: copyErr}
34193419
return ev, payload
34203420
}
34213421
return nil, nil
@@ -3471,25 +3471,25 @@ func isCommit(stmt tree.Statement) bool {
34713471
return ok
34723472
}
34733473

3474-
var retriableMinTimestampBoundUnsatisfiableError = errors.Newf(
3475-
"retriable MinTimestampBoundUnsatisfiableError",
3474+
var retryableMinTimestampBoundUnsatisfiableError = errors.Newf(
3475+
"retryable MinTimestampBoundUnsatisfiableError",
34763476
)
34773477

3478-
// errIsRetriable is true if the error is a client-visible retry error
3478+
// errIsRetryable is true if the error is a client-visible retry error
34793479
// or the error is a special error that is handled internally and retried.
3480-
func errIsRetriable(err error) bool {
3480+
func errIsRetryable(err error) bool {
34813481
return errors.HasInterface(err, (*pgerror.ClientVisibleRetryError)(nil)) ||
3482-
errors.Is(err, retriableMinTimestampBoundUnsatisfiableError) ||
3482+
errors.Is(err, retryableMinTimestampBoundUnsatisfiableError) ||
34833483
descs.IsTwoVersionInvariantViolationError(err)
34843484
}
34853485

3486-
// convertRetriableErrorIntoUserVisibleError converts internal retriable
3486+
// convertRetryableErrorIntoUserVisibleError converts internal retryable
34873487
// errors into external, so that the client goes and retries this
34883488
// transaction. One example of this is two version invariant errors, which
34893489
// happens when a schema change is waiting for a schema change transition to
34903490
// propagate. When this happens, we either need to retry externally or internally,
34913491
// depending on if we are in an explicit transaction.
3492-
func (ex *connExecutor) convertRetriableErrorIntoUserVisibleError(
3492+
func (ex *connExecutor) convertRetryableErrorIntoUserVisibleError(
34933493
ctx context.Context, origErr error,
34943494
) (modifiedErr error, err error) {
34953495
if descs.IsTwoVersionInvariantViolationError(origErr) {
@@ -3505,8 +3505,8 @@ func (ex *connExecutor) convertRetriableErrorIntoUserVisibleError(
35053505
return origErr, nil
35063506
}
35073507

3508-
// makeErrEvent takes an error and returns either an eventRetriableErr or an
3509-
// eventNonRetriableErr, depending on the error type.
3508+
// makeErrEvent takes an error and returns either an eventRetryableErr or an
3509+
// eventNonRetryableErr, depending on the error type.
35103510
func (ex *connExecutor) makeErrEvent(err error, stmt tree.Statement) (fsm.Event, fsm.EventPayload) {
35113511
// Check for MinTimestampBoundUnsatisfiableError errors.
35123512
// If this is detected, it means we are potentially able to retry with a lower
@@ -3530,41 +3530,41 @@ func (ex *connExecutor) makeErrEvent(err error, stmt tree.Statement) (fsm.Event,
35303530
)
35313531
}
35323532
if aost.Timestamp.Less(minTSErr.MinTimestampBound) {
3533-
err = errors.Mark(err, retriableMinTimestampBoundUnsatisfiableError)
3533+
err = errors.Mark(err, retryableMinTimestampBoundUnsatisfiableError)
35343534
}
35353535
}
35363536
}
35373537

3538-
retriable := errIsRetriable(err)
3539-
if retriable && execinfra.IsDynamicQueryHasNoHomeRegionError(err) {
3538+
retryable := errIsRetryable(err)
3539+
if retryable && execinfra.IsDynamicQueryHasNoHomeRegionError(err) {
35403540
// Retry only # of remote regions times if the retry is due to the
35413541
// enforce_home_region setting.
3542-
retriable = int(ex.state.mu.autoRetryCounter) < len(ex.planner.EvalContext().RemoteRegions)
3543-
if !retriable {
3542+
retryable = int(ex.state.mu.autoRetryCounter) < len(ex.planner.EvalContext().RemoteRegions)
3543+
if !retryable {
35443544
err = execinfra.MaybeGetNonRetryableDynamicQueryHasNoHomeRegionError(err)
35453545
}
35463546
}
3547-
if retriable {
3547+
if retryable {
35483548
var rc rewindCapability
35493549
var canAutoRetry bool
35503550
if ex.implicitTxn() || !ex.sessionData().InjectRetryErrorsEnabled {
35513551
rc, canAutoRetry = ex.getRewindTxnCapability()
35523552
}
35533553

3554-
ev := eventRetriableErr{
3554+
ev := eventRetryableErr{
35553555
IsCommit: fsm.FromBool(isCommit(stmt)),
35563556
CanAutoRetry: fsm.FromBool(canAutoRetry),
35573557
}
3558-
payload := eventRetriableErrPayload{
3558+
payload := eventRetryableErrPayload{
35593559
err: err,
35603560
rewCap: rc,
35613561
}
35623562
return ev, payload
35633563
}
3564-
ev := eventNonRetriableErr{
3564+
ev := eventNonRetryableErr{
35653565
IsCommit: fsm.FromBool(isCommit(stmt)),
35663566
}
3567-
payload := eventNonRetriableErrPayload{err: err}
3567+
payload := eventNonRetryableErrPayload{err: err}
35683568
return ev, payload
35693569
}
35703570

@@ -3974,7 +3974,7 @@ func (ex *connExecutor) initPlanner(ctx context.Context, p *planner) {
39743974
func (ex *connExecutor) maybeAdjustMaxTimestampBound(p *planner, txn *kv.Txn) {
39753975
if autoRetryReason := ex.state.mu.autoRetryReason; autoRetryReason != nil {
39763976
// If we are retrying due to an unsatisfiable timestamp bound which is
3977-
// retriable, it means we were unable to serve the previous minimum
3977+
// retryable, it means we were unable to serve the previous minimum
39783978
// timestamp as there was a schema update in between. When retrying, we
39793979
// want to keep the same minimum timestamp for the AOST read, but set
39803980
// the maximum timestamp to the point just before our failed read to

0 commit comments

Comments
 (0)