Skip to content

Commit

Permalink
Merge #72288
Browse files Browse the repository at this point in the history
72288: storage/metamorphic: Increment endTime in ClearTimeRange r=nicktrav a=itsbilal

Eliminates a panic when endTime ends up being the zero
timestamp, and startTime is slightly ahead of endTime
as it gets next()'d in TBI creation but endTime doesn't.

Fixes #72269
Fixes #72261

Release note: None.

Co-authored-by: Bilal Akhtar <[email protected]>
  • Loading branch information
craig[bot] and itsbilal committed Nov 1, 2021
2 parents 83ace64 + d54673d commit 039ed5f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/storage/metamorphic/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,11 @@ var opGenerators = []opGenerator{
if endTime.Less(startTime) {
startTime, endTime = endTime, startTime
}
// This is to avoid a panic where startTime == endTime == hlc.Timestamp{}
// and where startTime gets next()'d in the time-bound iterator creation
// but endTime doesn't, making it seem like a start timestamp is set
// but an end timestamp is not.
endTime = endTime.Next()
return &mvccClearTimeRangeOp{
m: m,
writer: writer,
Expand Down

0 comments on commit 039ed5f

Please sign in to comment.