Skip to content

Commit

Permalink
Merge pull request #36739 from dt/backport19.1-36688
Browse files Browse the repository at this point in the history
release-19.1: storage: don't crash on new seqno error from rocks ingest
  • Loading branch information
vivekmenezes authored Apr 11, 2019
2 parents e131a5c + cb72e31 commit b652751
Showing 1 changed file with 12 additions and 2 deletions.
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

0 comments on commit b652751

Please sign in to comment.