Skip to content

Commit

Permalink
Keep priority on scanner's subsequent scans
Browse files Browse the repository at this point in the history
If a scanner needs to scan multiple times ensure all scanners get the
priority set in the initial hrpc.Scan.
  • Loading branch information
aaronbee committed Aug 15, 2024
1 parent e08f807 commit 5bc64cc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,18 @@ func (s *scanner) request() (*pb.ScanResponse, hrpc.RegionInfo, error) {
s.rpc.Options()...)
} else {
// continuing to scan current region
var priority uint32
if p := s.rpc.Priority(); p != nil {
priority = *p
}
rpc, err = hrpc.NewScanRange(s.rpc.Context(),
s.rpc.Table(),
s.startRow,
nil,
hrpc.ScannerID(s.curRegionScannerID),
hrpc.NumberOfRows(s.rpc.NumberOfRows()))
hrpc.NumberOfRows(s.rpc.NumberOfRows()),
hrpc.Priority(priority),
)
}
if err != nil {
return nil, nil, err
Expand Down

0 comments on commit 5bc64cc

Please sign in to comment.