Skip to content

Commit

Permalink
Merge #138088
Browse files Browse the repository at this point in the history
138088: ccl/multiregionccl: deflake TestRegionLivenessProberForLeases r=annrpom a=annrpom

In our `TestingRequestFilter`, we should ensure that the length of our delete request key is at least the same length as the prefix key; otherwise, we risk indexing out of bounds during our prefix key check.

Epic: none
Fixes: #138058

Release note: None

Co-authored-by: Annie Pompa <[email protected]>
  • Loading branch information
craig[bot] and annrpom committed Jan 8, 2025
2 parents a26ce67 + 391fc1c commit 164ce7c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/ccl/multiregionccl/regionliveness_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,9 @@ func TestRegionLivenessProberForLeases(t *testing.T) {
keyToBlockMu.Lock()
keyPrefix := keyToBlock
keyToBlockMu.Unlock()
if keyPrefix == nil || !deleteRequest.Key[:len(keyPrefix)].Equal(keyPrefix) {
isPrefixToDelReq := len(deleteRequest.Key) >= len(keyPrefix) &&
!deleteRequest.Key[:len(keyPrefix)].Equal(keyPrefix)
if keyPrefix == nil || isPrefixToDelReq {
return nil
}
recoveryStart <- struct{}{}
Expand Down

0 comments on commit 164ce7c

Please sign in to comment.