Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

storage: don't crash on new seqno error from rocks ingest #36688

Merged
merged 1 commit into from
Apr 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions pkg/storage/replica_proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,18 @@ func addSSTablePreApply(
log.Fatalf(ctx, "failed to move ingest sst: %v", rmErr)
}
const seqNoMsg = "Global seqno is required, but disabled"
if err, ok := ingestErr.(*engine.RocksDBError); ok && !strings.Contains(ingestErr.Error(), seqNoMsg) {
log.Fatalf(ctx, "while ingesting %s: %s", ingestPath, err)
const seqNoOnReIngest = "external file have non zero sequence number"
// Repeated ingestion is still possible even with the link count checked
// above, since rocks might have already compacted away the file.
// However it does not flush compacted files from its cache, so it can
// still react poorly to attempting to ingest again. If we get an error
// that indicates we can't ingest, we'll make a copy and try again. That
// attempt must succeed or we'll fatal, so any persistent error is still
// going to be surfaced.
ingestErrMsg := ingestErr.Error()
isSeqNoErr := strings.Contains(ingestErrMsg, seqNoMsg) || strings.Contains(ingestErrMsg, seqNoOnReIngest)
if _, ok := ingestErr.(*engine.RocksDBError); !ok || !isSeqNoErr {
log.Fatalf(ctx, "while ingesting %s: %s", ingestPath, ingestErr)
}
}
}
Expand Down