From 5bc64ccecf2c7d5968d723734cae040c73a94338 Mon Sep 17 00:00:00 2001 From: Aaron Beitch Date: Thu, 15 Aug 2024 14:50:04 -0700 Subject: [PATCH] Keep priority on scanner's subsequent scans If a scanner needs to scan multiple times ensure all scanners get the priority set in the initial hrpc.Scan. --- scanner.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scanner.go b/scanner.go index a5aaa69..94af507 100644 --- a/scanner.go +++ b/scanner.go @@ -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