Skip to content

Commit

Permalink
add log
Browse files Browse the repository at this point in the history
Signed-off-by: okJiang <[email protected]>
  • Loading branch information
okJiang committed Jul 26, 2024
1 parent 024656b commit a039f09
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pkg/core/region.go
Original file line number Diff line number Diff line change
Expand Up @@ -1897,7 +1897,17 @@ func scanRegion(regionTree *regionTree, keyRange *KeyRange, limit int, outputMus
return nil, err
}

if !(exceedLimit()) && len(keyRange.EndKey) > 0 && len(lastRegion.GetEndKey()) > 0 &&
if exceedLimit() {
return res, nil
}

log.Info("just for test",
logutil.ZapRedactStringer("meta-region", RegionToHexMeta(lastRegion.GetMeta())),
zap.ByteString("key-range.start-key", HexRegionKey(keyRange.StartKey)),
zap.ByteString("key-range.end-key", HexRegionKey(keyRange.EndKey)),
)

if len(keyRange.EndKey) > 0 && len(lastRegion.GetEndKey()) > 0 &&
bytes.Compare(lastRegion.GetEndKey(), keyRange.EndKey) < 0 {
err = errs.ErrRegionNotAdjacent.FastGen(
"key range[%x, %x) found a hole region in the last, the last scanned region is [%x, %x), [%x, %x) is missing",
Expand Down
1 change: 1 addition & 0 deletions pkg/core/region_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1166,6 +1166,7 @@ func TestScanRegion(t *testing.T) {
re.Len(scanNoError([]byte("a"), []byte("b"), 0), 1)
scanError([]byte("a"), []byte("c"), 0)
re.Len(scanNoError([]byte("a"), []byte("c"), 1), 1)
scanNoError([]byte("b"), []byte("c"), 0)

// region1 | region2
// [a, b) | [b, c)
Expand Down

0 comments on commit a039f09

Please sign in to comment.