Skip to content

Commit

Permalink
Merge pull request #58259 from pbardea/backport20.2-58219
Browse files Browse the repository at this point in the history
release-20.2: storageccl: tolerate rewriting span keys ending in interleaved sentinel
  • Loading branch information
pbardea authored Dec 23, 2020
2 parents 6643175 + bcfe2e6 commit e90d2bf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/ccl/storageccl/key_rewriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,11 @@ func (kr *KeyRewriter) RewriteKey(key []byte, isFromSpan bool) ([]byte, bool, er
if !ok {
return key, true, nil
}
if len(k) == 0 {
// We have seen some span keys end in an interleaved sentinel.
// Check if we ran out of key before getting to an interleave child?
return key, true, nil
}
prefix := key[:len(key)-len(k)]
k, ok, err = kr.RewriteKey(k, isFromSpan)
if err != nil {
Expand Down

0 comments on commit e90d2bf

Please sign in to comment.