File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,13 @@ func rewriteBackupSpanKey(
175
175
return newKey , nil
176
176
}
177
177
178
+ var permanentRestoreError = errors .New ("permanent restore error" )
179
+
180
+ func shouldFastFailRestore (err error ) bool {
181
+ return errors .Is (err , permanentRestoreError ) ||
182
+ pebble .IsCorruptionError (err ) && errors .Is (err , backupFileReadError )
183
+ }
184
+
178
185
// restoreWithRetry attempts to run restore with retry logic and logs retries
179
186
// accordingly.
180
187
func restoreWithRetry (
@@ -217,9 +224,10 @@ func restoreWithRetry(
217
224
return roachpb.RowCount {}, jobs .MarkPauseRequestError (errors .UnwrapAll (err ))
218
225
}
219
226
220
- if pebble . IsCorruptionError (err ) && errors . Is ( err , backupFileReadError ) {
227
+ if shouldFastFailRestore (err ) {
221
228
return roachpb.RowCount {}, jobs .MarkAsPermanentJobError (err )
222
229
}
230
+
223
231
// If we are draining, it is unlikely we can start a
224
232
// new DistSQL flow. Exit with a retryable error so
225
233
// that another node can pick up the job.
Original file line number Diff line number Diff line change @@ -310,7 +310,7 @@ func sendAddRemoteSSTWorker(
310
310
}
311
311
currentLayer = file .Layer
312
312
if file .HasRangeKeys {
313
- return errors .Newf ( "online restore of range keys not supported" )
313
+ return errors .Wrapf ( permanentRestoreError , "online restore of range keys not supported" )
314
314
}
315
315
if err := assertCommonPrefix (file .BackupFileEntrySpan , entry .ElidedPrefix ); err != nil {
316
316
return err
You can’t perform that action at this time.
0 commit comments