You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "KeDeng (Code Review)" <ge...@cloudera.org> on 2022/12/28 07:34:47 UTC

[kudu-CR] [www] add slow scans show

KeDeng has uploaded this change for review. ( http://gerrit.cloudera.org:8080/19392


Change subject: [www] add slow scans show
......................................................................

[www] add slow scans show

We can get historical completed scans from /scans page right now.
But it is not convenient for us to get slow scans.

I change the previous scan presentation into completed scan show and
add slow scans show. Slow scan defined only by the time used, which
threshold is --slow_scanner_threshold_ms.
The number of slow scans show is limit by --slow_scan_history_count.

Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
---
M src/kudu/client/scan_token-test.cc
M src/kudu/tserver/scanners.cc
M src/kudu/tserver/scanners.h
M src/kudu/tserver/tablet_server-test.cc
M src/kudu/tserver/tserver_path_handlers.cc
M www/scans.mustache
6 files changed, 292 insertions(+), 90 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/92/19392/1
-- 
To view, visit http://gerrit.cloudera.org:8080/19392
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
Gerrit-Change-Number: 19392
Gerrit-PatchSet: 1
Gerrit-Owner: KeDeng <kd...@gmail.com>

[kudu-CR] [www] add slow scans section

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/19392 )

Change subject: [www] add slow scans section
......................................................................


Patch Set 14: Code-Review+2

(4 comments)

http://gerrit.cloudera.org:8080/#/c/19392/11//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/19392/11//COMMIT_MSG@17
PS11, Line 17: 
> Yes, this is another implementation. I have also considered it. After all, 
Ah, I see -- thanks for the clarification.  Indeed, then it makes sense to implement this exactly the way you did.


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.h
File src/kudu/tserver/scanners.h:

http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.h@479
PS11, Line 479: 
> The 'RefCounted' is my choice in the alpha version. In this version, there 
Yup, that makes sense to me.  Thank you for the clarification!


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.cc
File src/kudu/tserver/scanners.cc:

http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.cc@361
PS11, Line 361:           "Slow scanner id: $0, of tablet $1, "
              :           "exceed the time threshold $2 ms for $3 ms.",
              :           it->first,
              :           scanner->tablet_id(),
              :           slow_scanner_threshold,
              :           delta_time.ToMilliseconds());
              :       descriptors.emplace_back(scanner-
> What I hope is that there are ways to obtain these slow scans logs if neces
If the idea was to track those scanner and found them a long time after there were running, I guess that's the right way of doing that.  I didn't realize that was the intention given that this patch already updates the 'Scans' page of the embedded webserver.

With that, this looks good enough to me.  I guess if people found their logs to be polluted with such messages, they can customize the corresponding flag.

VLOG(1) or VLOG(2) is also an option, but you'd need to set verbose mode beforehand.


http://gerrit.cloudera.org:8080/#/c/19392/14/src/kudu/tserver/scanners.cc
File src/kudu/tserver/scanners.cc:

http://gerrit.cloudera.org:8080/#/c/19392/14/src/kudu/tserver/scanners.cc@360
PS14, Line 360: VLOG(2)
With the explanation you provided at https://gerrit.cloudera.org/#/c/19392/11/src/kudu/tserver/scanners.cc@367 , it seems VLOG(1) or even LOG(INFO) might be a better option than VLOG(2).  VLOG(2) contains too much stuff from elsewhere.

Maybe, this should be configurable whether to log about slow scans or not?  Say, if that's gated by a run-time flag, then there is no risk of polluting the log even if the default slowness threshold isn't adjusted for a particular workload pattern when logging with LOG(INFO) here.

Let me know if you want to address this here or in a separate patch.  Either option looks good to me.  Thanks!



-- 
To view, visit http://gerrit.cloudera.org:8080/19392
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
Gerrit-Change-Number: 19392
Gerrit-PatchSet: 14
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Tue, 07 Feb 2023 04:53:51 +0000
Gerrit-HasComments: Yes

[kudu-CR] [www] add slow scans show

Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/19392

to look at the new patch set (#10).

Change subject: [www] add slow scans show
......................................................................

[www] add slow scans show

We can get historical completed scans from /scans page right now.
But it is not convenient for us to get slow scans.

I change the previous scan presentation into completed scan show and
add slow scans show. Slow scan defined only by the time used, which
threshold is --slow_scanner_threshold_ms.
The number of slow scans show is limit by --slow_scan_history_count.

Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
---
M src/kudu/client/scan_token-test.cc
M src/kudu/tserver/scanners.cc
M src/kudu/tserver/scanners.h
M src/kudu/tserver/tablet_server-test.cc
M src/kudu/tserver/tserver_path_handlers.cc
M www/scans.mustache
6 files changed, 296 insertions(+), 93 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/92/19392/10
-- 
To view, visit http://gerrit.cloudera.org:8080/19392
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
Gerrit-Change-Number: 19392
Gerrit-PatchSet: 10
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [www] add slow scans show

Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/19392

to look at the new patch set (#8).

Change subject: [www] add slow scans show
......................................................................

[www] add slow scans show

We can get historical completed scans from /scans page right now.
But it is not convenient for us to get slow scans.

I change the previous scan presentation into completed scan show and
add slow scans show. Slow scan defined only by the time used, which
threshold is --slow_scanner_threshold_ms.
The number of slow scans show is limit by --slow_scan_history_count.

Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
---
M src/kudu/client/scan_token-test.cc
M src/kudu/tserver/scanners.cc
M src/kudu/tserver/scanners.h
M src/kudu/tserver/tablet_server-test.cc
M src/kudu/tserver/tserver_path_handlers.cc
M www/scans.mustache
6 files changed, 296 insertions(+), 93 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/92/19392/8
-- 
To view, visit http://gerrit.cloudera.org:8080/19392
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
Gerrit-Change-Number: 19392
Gerrit-PatchSet: 8
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [www] add slow scans section

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/19392 )

Change subject: [www] add slow scans section
......................................................................

[www] add slow scans section

We can get the history of completed scans from /scans page right now.
But it is not easy to distinguish slow ones among those.

I introduced an extra section to the scan page to show slow scans
separately. A scan is called 'slow' if it takes more time than defined
by --slow_scanner_threshold_ms.
The number of elements in the slow scans history is limited by
--slow_scan_history_count.

Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
Reviewed-on: http://gerrit.cloudera.org:8080/19392
Tested-by: Kudu Jenkins
Reviewed-by: Alexey Serbin <al...@apache.org>
---
M src/kudu/client/scan_token-test.cc
M src/kudu/tserver/scanners.cc
M src/kudu/tserver/scanners.h
M src/kudu/tserver/tablet_server-test.cc
M src/kudu/tserver/tablet_server.cc
M src/kudu/tserver/tserver_path_handlers.cc
M www/scans.mustache
7 files changed, 379 insertions(+), 102 deletions(-)

Approvals:
  Kudu Jenkins: Verified
  Alexey Serbin: Looks good to me, approved

-- 
To view, visit http://gerrit.cloudera.org:8080/19392
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
Gerrit-Change-Number: 19392
Gerrit-PatchSet: 16
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [www] add slow scans section

Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
KeDeng has posted comments on this change. ( http://gerrit.cloudera.org:8080/19392 )

Change subject: [www] add slow scans section
......................................................................


Patch Set 15:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/19392/14/src/kudu/tserver/scanners.cc
File src/kudu/tserver/scanners.cc:

http://gerrit.cloudera.org:8080/#/c/19392/14/src/kudu/tserver/scanners.cc@360
PS14, Line 360: // TODO
> With the explanation you provided at https://gerrit.cloudera.org/#/c/19392/
Yes, you made a good suggestion. I will add a separate path to add the flag to control the slow scans show and this log print. Thanks a lot!



-- 
To view, visit http://gerrit.cloudera.org:8080/19392
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
Gerrit-Change-Number: 19392
Gerrit-PatchSet: 15
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Tue, 07 Feb 2023 06:22:54 +0000
Gerrit-HasComments: Yes

[kudu-CR] [www] add slow scans section

Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
Hello Alexey Serbin, Kudu Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/19392

to look at the new patch set (#12).

Change subject: [www] add slow scans section
......................................................................

[www] add slow scans section

We can get the history of completed scans from /scans page right now.
But it is not easy to distinguish slow ones among those.

I introduced an extra section to the scan page to show slow scans
separately. A scan is called 'slow' if it takes more time than defined
by --slow_scanner_threshold_ms.
The number of elements in the slow scans history is limited by
--slow_scan_history_count.

Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
---
M src/kudu/client/scan_token-test.cc
M src/kudu/tserver/scanners.cc
M src/kudu/tserver/scanners.h
M src/kudu/tserver/tablet_server-test.cc
M src/kudu/tserver/tablet_server.cc
M src/kudu/tserver/tserver_path_handlers.cc
M www/scans.mustache
7 files changed, 383 insertions(+), 103 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/92/19392/12
-- 
To view, visit http://gerrit.cloudera.org:8080/19392
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
Gerrit-Change-Number: 19392
Gerrit-PatchSet: 12
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [www] add slow scans show

Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/19392

to look at the new patch set (#2).

Change subject: [www] add slow scans show
......................................................................

[www] add slow scans show

We can get historical completed scans from /scans page right now.
But it is not convenient for us to get slow scans.

I change the previous scan presentation into completed scan show and
add slow scans show. Slow scan defined only by the time used, which
threshold is --slow_scanner_threshold_ms.
The number of slow scans show is limit by --slow_scan_history_count.

Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
---
M src/kudu/client/scan_token-test.cc
M src/kudu/tserver/scanners.cc
M src/kudu/tserver/scanners.h
M src/kudu/tserver/tablet_server-test.cc
M src/kudu/tserver/tserver_path_handlers.cc
M www/scans.mustache
6 files changed, 292 insertions(+), 90 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/92/19392/2
-- 
To view, visit http://gerrit.cloudera.org:8080/19392
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
Gerrit-Change-Number: 19392
Gerrit-PatchSet: 2
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [www] add slow scans show

Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/19392

to look at the new patch set (#3).

Change subject: [www] add slow scans show
......................................................................

[www] add slow scans show

We can get historical completed scans from /scans page right now.
But it is not convenient for us to get slow scans.

I change the previous scan presentation into completed scan show and
add slow scans show. Slow scan defined only by the time used, which
threshold is --slow_scanner_threshold_ms.
The number of slow scans show is limit by --slow_scan_history_count.

Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
---
M src/kudu/client/scan_token-test.cc
M src/kudu/tserver/scanners.cc
M src/kudu/tserver/scanners.h
M src/kudu/tserver/tablet_server-test.cc
M src/kudu/tserver/tserver_path_handlers.cc
M www/scans.mustache
6 files changed, 296 insertions(+), 93 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/92/19392/3
-- 
To view, visit http://gerrit.cloudera.org:8080/19392
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
Gerrit-Change-Number: 19392
Gerrit-PatchSet: 3
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [www] add slow scans section

Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
Hello Alexey Serbin, Kudu Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/19392

to look at the new patch set (#14).

Change subject: [www] add slow scans section
......................................................................

[www] add slow scans section

We can get the history of completed scans from /scans page right now.
But it is not easy to distinguish slow ones among those.

I introduced an extra section to the scan page to show slow scans
separately. A scan is called 'slow' if it takes more time than defined
by --slow_scanner_threshold_ms.
The number of elements in the slow scans history is limited by
--slow_scan_history_count.

Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
---
M src/kudu/client/scan_token-test.cc
M src/kudu/tserver/scanners.cc
M src/kudu/tserver/scanners.h
M src/kudu/tserver/tablet_server-test.cc
M src/kudu/tserver/tablet_server.cc
M src/kudu/tserver/tserver_path_handlers.cc
M www/scans.mustache
7 files changed, 385 insertions(+), 103 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/92/19392/14
-- 
To view, visit http://gerrit.cloudera.org:8080/19392
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
Gerrit-Change-Number: 19392
Gerrit-PatchSet: 14
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [www] add slow scans show

Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/19392

to look at the new patch set (#6).

Change subject: [www] add slow scans show
......................................................................

[www] add slow scans show

We can get historical completed scans from /scans page right now.
But it is not convenient for us to get slow scans.

I change the previous scan presentation into completed scan show and
add slow scans show. Slow scan defined only by the time used, which
threshold is --slow_scanner_threshold_ms.
The number of slow scans show is limit by --slow_scan_history_count.

Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
---
M src/kudu/client/scan_token-test.cc
M src/kudu/tserver/scanners.cc
M src/kudu/tserver/scanners.h
M src/kudu/tserver/tablet_server-test.cc
M src/kudu/tserver/tserver_path_handlers.cc
M www/scans.mustache
6 files changed, 296 insertions(+), 93 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/92/19392/6
-- 
To view, visit http://gerrit.cloudera.org:8080/19392
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
Gerrit-Change-Number: 19392
Gerrit-PatchSet: 6
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [www] add slow scans show

Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/19392

to look at the new patch set (#9).

Change subject: [www] add slow scans show
......................................................................

[www] add slow scans show

We can get historical completed scans from /scans page right now.
But it is not convenient for us to get slow scans.

I change the previous scan presentation into completed scan show and
add slow scans show. Slow scan defined only by the time used, which
threshold is --slow_scanner_threshold_ms.
The number of slow scans show is limit by --slow_scan_history_count.

Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
---
M src/kudu/client/scan_token-test.cc
M src/kudu/tserver/scanners.cc
M src/kudu/tserver/scanners.h
M src/kudu/tserver/tablet_server-test.cc
M src/kudu/tserver/tserver_path_handlers.cc
M www/scans.mustache
6 files changed, 296 insertions(+), 93 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/92/19392/9
-- 
To view, visit http://gerrit.cloudera.org:8080/19392
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
Gerrit-Change-Number: 19392
Gerrit-PatchSet: 9
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [www] add slow scans section

Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
KeDeng has posted comments on this change. ( http://gerrit.cloudera.org:8080/19392 )

Change subject: [www] add slow scans section
......................................................................


Patch Set 11:

(25 comments)

Thanks for your reviews. I've change the code as your suggestion. Please help to reconfirm at your convenient time.

http://gerrit.cloudera.org:8080/#/c/19392/11//COMMIT_MSG
Commit Message:

PS11: 
> Could you add a test for the newly introduced ScannerManager::ListSlowScans
Done


http://gerrit.cloudera.org:8080/#/c/19392/11//COMMIT_MSG@7
PS11, Line 7: show
> section
Done


http://gerrit.cloudera.org:8080/#/c/19392/11//COMMIT_MSG@9
PS11, Line 9: historical completed scans
> the history of completed scans
Done


http://gerrit.cloudera.org:8080/#/c/19392/11//COMMIT_MSG@10
PS11, Line 10: convenient for us to get slow scans
> easy to distinguish slow ones among those
Done


http://gerrit.cloudera.org:8080/#/c/19392/11//COMMIT_MSG@12
PS11, Line 12: change the previous scan presentation into completed scan show and
             : add slow scans show
> introduced an extra section to the scan page to show slow scans separately
Done


http://gerrit.cloudera.org:8080/#/c/19392/11//COMMIT_MSG@13
PS11, Line 13: Slow scan defined only by the time used, which
             : threshold is --slow_scanner_threshold_ms
> A scan is called 'slow' if it takes more time than defined by --slow_scanne
Done


http://gerrit.cloudera.org:8080/#/c/19392/11//COMMIT_MSG@15
PS11, Line 15: The number of slow scans show is limit by --slow_scan_history_count
> The number of elements in the slow scans history is limited by --slow_scan_
Done


http://gerrit.cloudera.org:8080/#/c/19392/11//COMMIT_MSG@17
PS11, Line 17: Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
> BTW, did you consider an alternative approach: instead of two separate list
Yes, this is another implementation. I have also considered it. After all, this method is less changed. But when I tested this way, I found that it might not achieve my original purpose.



The goal of adding this feature is to filter out slow scans, not the slow ones from the recently completed scans. After all, if the most recent records are completed quickly, we will not be able to obtain any information useful for slow scans.


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.h
File src/kudu/tserver/scanners.h:

http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.h@115
PS11, Line 115: scoped_refptr<ScanDescriptor>
> Consider introducing a typedef for scoped_refptr<ScanDescriptor> (say, Shar
Done


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.h@117
PS11, Line 117: recently
> recent
Done


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.h@118
PS11, Line 118: Slow scan defined only by the time used, which threshold is
              :   // --slow_scanner_threshold_ms.
> A scan is 'slow' if it takes more than --slow_scanner_threshold_ms to compl
Done


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.h@120
PS11, Line 120: The member number of return vector is limit by --slow_scan_history_count
> The number of elements in the result vector is limited by --slow_scan_histo
Done


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.h@126
PS11, Line 126: whose scan exceeds time threshold
> whose scan times exceed the threshold
Done


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.h@478
PS11, Line 478: ScanDescriptor is copyable
> If I'm not mistaken, ScanDescriptor is copyable even without wrapping it in
Yes, you are right. I will update the code annotation.


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.h@479
PS11, Line 479: : public RefCountedThreadSafe<ScanDescriptor> {
> Just curious: why RefCountedThreadSafe seems to be more  preferable over st
The 'RefCounted' is my choice in the alpha version. In this version, there is no problem with the slow scans display function, but some unit tests involve the concurrent use of 'ScanDescriptor'. Finally, I use 'RefCountedThreadSafe' to replace to solve these problems.


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.cc
File src/kudu/tserver/scanners.cc:

http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.cc@68
PS11, Line 68: 60000
> nit: for better readability, consider replacing with 60 * 1000L
Done


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.cc@68
PS11, Line 68: minutes
> minute
Done


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.cc@69
PS11, Line 69: Number of milliseconds for the threshold of slow scan."
> What do you think of introducing a special value for the flag (e.g., -1 or 
Sounds like good. I will implement this function in the next submission.


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.cc@75
PS11, Line 75: The slow "
             :              "scans define with --slow_scanner_threshold_ms
> The threshold for a slow scan is defined with --slow_scanner_threshold_ms
Done


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.cc@153
PS11, Line 153:   {
              :     std::lock_guard<percpu_rwlock> l(completed_scans_lock_);
              :     completed_scans_.clear();
              :   }
              :   {
              :     std::lock_guard<percpu_rwlock> l(slow_scans_lock_);
              :     slow_scans_.clear();
              :   }
> Why is it needed?  The containers would be automatically cleaned up on dest
Done


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.cc@291
PS11, Line 291: desc
> Why not to continue using the move semantics here?
Done


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.cc@321
PS11, Line 321:   unordered_map<string, scoped_refptr<ScanDescriptor>> scans;
              :   {
              :     kudu::shared_lock<rw_spinlock> l(slow_scans_lock_.get_lock());
              :     for (const auto& scan : slow_scans_) {
              :       InsertOrUpdate(&scans, scan->scanner_id, scan);
              :     }
              :   }
> What's the purpose of using unordered dictionary/map here if later on the r
This is mainly to prevent the occurrence of duplicate records.


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.cc@355
PS11, Line 355: FLAGS_slow_scanner_threshold_ms
> There are 3 accesses to this flag in the scope of this method.  Every acces
Done


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.cc@361
PS11, Line 361:       LOG(INFO) << Substitute(
              :           "Slow scanner id: $0, of tablet $1, "
              :           "exceed the time threshold $2 ms for $3 ms.",
              :           it->first,
              :           scanner->tablet_id(),
              :           FLAGS_slow_scanner_threshold_ms,
              :           delta_time.ToMilliseconds());
> Do you really want this to be logged for every scanner which goes beyond th
What I hope is that there are ways to obtain these slow scans logs if necessary. I can turn it into Vlog. What do you think?


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.cc@436
PS11, Line 436:   if (slow_scans_.capacity() == 0) {
              :     return;
              :   }
              :   if (slow_scans_.size() == slow_scans_.capacity()) {
              :     slow_scans_[slow_scans_offset_++] = descriptor;
              :     if (slow_scans_offset_ == slow_scans_.capacity()) {
              :       slow_scans_offset_ = 0;
              :     }
              :   } else {
              :     slow_scans_.emplace_back(descriptor);
              :   }
> Instead of duplicating this code from RecordCompletedScanUnlocked(), consid
Done



-- 
To view, visit http://gerrit.cloudera.org:8080/19392
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
Gerrit-Change-Number: 19392
Gerrit-PatchSet: 11
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Fri, 03 Feb 2023 08:59:55 +0000
Gerrit-HasComments: Yes

[kudu-CR] [www] add slow scans section

Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
Hello Alexey Serbin, Kudu Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/19392

to look at the new patch set (#15).

Change subject: [www] add slow scans section
......................................................................

[www] add slow scans section

We can get the history of completed scans from /scans page right now.
But it is not easy to distinguish slow ones among those.

I introduced an extra section to the scan page to show slow scans
separately. A scan is called 'slow' if it takes more time than defined
by --slow_scanner_threshold_ms.
The number of elements in the slow scans history is limited by
--slow_scan_history_count.

Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
---
M src/kudu/client/scan_token-test.cc
M src/kudu/tserver/scanners.cc
M src/kudu/tserver/scanners.h
M src/kudu/tserver/tablet_server-test.cc
M src/kudu/tserver/tablet_server.cc
M src/kudu/tserver/tserver_path_handlers.cc
M www/scans.mustache
7 files changed, 379 insertions(+), 102 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/92/19392/15
-- 
To view, visit http://gerrit.cloudera.org:8080/19392
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
Gerrit-Change-Number: 19392
Gerrit-PatchSet: 15
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [www] add slow scans show

Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/19392

to look at the new patch set (#7).

Change subject: [www] add slow scans show
......................................................................

[www] add slow scans show

We can get historical completed scans from /scans page right now.
But it is not convenient for us to get slow scans.

I change the previous scan presentation into completed scan show and
add slow scans show. Slow scan defined only by the time used, which
threshold is --slow_scanner_threshold_ms.
The number of slow scans show is limit by --slow_scan_history_count.

Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
---
M src/kudu/client/scan_token-test.cc
M src/kudu/tserver/scanners.cc
M src/kudu/tserver/scanners.h
M src/kudu/tserver/tablet_server-test.cc
M src/kudu/tserver/tserver_path_handlers.cc
M www/scans.mustache
6 files changed, 298 insertions(+), 93 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/92/19392/7
-- 
To view, visit http://gerrit.cloudera.org:8080/19392
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
Gerrit-Change-Number: 19392
Gerrit-PatchSet: 7
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [www] add slow scans show

Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/19392

to look at the new patch set (#4).

Change subject: [www] add slow scans show
......................................................................

[www] add slow scans show

We can get historical completed scans from /scans page right now.
But it is not convenient for us to get slow scans.

I change the previous scan presentation into completed scan show and
add slow scans show. Slow scan defined only by the time used, which
threshold is --slow_scanner_threshold_ms.
The number of slow scans show is limit by --slow_scan_history_count.

Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
---
M src/kudu/client/scan_token-test.cc
M src/kudu/tserver/scanners.cc
M src/kudu/tserver/scanners.h
M src/kudu/tserver/tablet_server-test.cc
M src/kudu/tserver/tserver_path_handlers.cc
M www/scans.mustache
6 files changed, 296 insertions(+), 93 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/92/19392/4
-- 
To view, visit http://gerrit.cloudera.org:8080/19392
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
Gerrit-Change-Number: 19392
Gerrit-PatchSet: 4
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [www] add slow scans section

Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
Hello Alexey Serbin, Kudu Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/19392

to look at the new patch set (#13).

Change subject: [www] add slow scans section
......................................................................

[www] add slow scans section

We can get the history of completed scans from /scans page right now.
But it is not easy to distinguish slow ones among those.

I introduced an extra section to the scan page to show slow scans
separately. A scan is called 'slow' if it takes more time than defined
by --slow_scanner_threshold_ms.
The number of elements in the slow scans history is limited by
--slow_scan_history_count.

Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
---
M src/kudu/client/scan_token-test.cc
M src/kudu/tserver/scanners.cc
M src/kudu/tserver/scanners.h
M src/kudu/tserver/tablet_server-test.cc
M src/kudu/tserver/tablet_server.cc
M src/kudu/tserver/tserver_path_handlers.cc
M www/scans.mustache
7 files changed, 383 insertions(+), 103 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/92/19392/13
-- 
To view, visit http://gerrit.cloudera.org:8080/19392
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
Gerrit-Change-Number: 19392
Gerrit-PatchSet: 13
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [www] add slow scans section

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/19392 )

Change subject: [www] add slow scans section
......................................................................


Patch Set 15: Code-Review+2

Thank you for the contribution!


-- 
To view, visit http://gerrit.cloudera.org:8080/19392
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
Gerrit-Change-Number: 19392
Gerrit-PatchSet: 15
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Tue, 07 Feb 2023 07:52:02 +0000
Gerrit-HasComments: No

[kudu-CR] [www] add slow scans show

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/19392 )

Change subject: [www] add slow scans show
......................................................................


Patch Set 11:

(25 comments)

Thank you for adding this new functionality.  It seems to be useful.

Just curious whether you considered an alternative approach: adding an extra 'is_slow' field into the scan descriptor and updating it correspondingly, and in the UI of the embedded web server it's possible to sort by that field (more details in the comment for the Commit Message).

http://gerrit.cloudera.org:8080/#/c/19392/11//COMMIT_MSG
Commit Message:

PS11: 
Could you add a test for the newly introduced ScannerManager::ListSlowScans()?  tablet_server-test.cc or scan_token-test.cc look like good places to add a new test scenario.

Tablet servers have a special flag --scanner_inject_latency_on_each_batch_ms to inject latency into scanning process, so it's easy to make a scan 'slow' even if it scans just a single row.


http://gerrit.cloudera.org:8080/#/c/19392/11//COMMIT_MSG@7
PS11, Line 7: show
section


http://gerrit.cloudera.org:8080/#/c/19392/11//COMMIT_MSG@9
PS11, Line 9: historical completed scans
the history of completed scans


http://gerrit.cloudera.org:8080/#/c/19392/11//COMMIT_MSG@10
PS11, Line 10: convenient for us to get slow scans
easy to distinguish slow ones among those


http://gerrit.cloudera.org:8080/#/c/19392/11//COMMIT_MSG@12
PS11, Line 12: change the previous scan presentation into completed scan show and
             : add slow scans show
introduced an extra section to the scan page to show slow scans separately


http://gerrit.cloudera.org:8080/#/c/19392/11//COMMIT_MSG@13
PS11, Line 13: Slow scan defined only by the time used, which
             : threshold is --slow_scanner_threshold_ms
A scan is called 'slow' if it takes more time than defined by --slow_scanner_threshold_ms


http://gerrit.cloudera.org:8080/#/c/19392/11//COMMIT_MSG@15
PS11, Line 15: The number of slow scans show is limit by --slow_scan_history_count
The number of elements in the slow scans history is limited by --slow_scan_history_count


http://gerrit.cloudera.org:8080/#/c/19392/11//COMMIT_MSG@17
PS11, Line 17: Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
BTW, did you consider an alternative approach: instead of two separate lists (with possibility of duplicating elements), just add an extra field into the ScanDescriptor: 'is_slow' that's assigned correspondingly.  Now, in the WebUI that would be an extra column that is possible to sort  the list by, so by sorting the list by that column the slow scans would be in the beginning or the end of the list depending on how many times the column header was clicked at.

What do you think?


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.h
File src/kudu/tserver/scanners.h:

http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.h@115
PS11, Line 115: scoped_refptr<ScanDescriptor>
Consider introducing a typedef for scoped_refptr<ScanDescriptor> (say, SharedScanDescriptor) and use it everywhere?


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.h@117
PS11, Line 117: recently
recent


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.h@118
PS11, Line 118: Slow scan defined only by the time used, which threshold is
              :   // --slow_scanner_threshold_ms.
A scan is 'slow' if it takes more than --slow_scanner_threshold_ms to complete.


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.h@120
PS11, Line 120: The member number of return vector is limit by --slow_scan_history_count
The number of elements in the result vector is limited by --slow_scan_history_count.


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.h@126
PS11, Line 126: whose scan exceeds time threshold
whose scan times exceed the threshold


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.h@478
PS11, Line 478: ScanDescriptor is copyable
If I'm not mistaken, ScanDescriptor is copyable even without wrapping it into RefCounted.  It would be great to document the precise rationale behind switching to the wrapper for ScanDescriptor.  Probably, you meant that that's to avoid duplicating data for elements in slow_scans_ and completed_scans_?


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.h@479
PS11, Line 479: : public RefCountedThreadSafe<ScanDescriptor> {
Just curious: why RefCountedThreadSafe seems to be more  preferable over std::shared_ptr in this case?


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.cc
File src/kudu/tserver/scanners.cc:

http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.cc@68
PS11, Line 68: 60000
nit: for better readability, consider replacing with 60 * 1000L


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.cc@68
PS11, Line 68: minutes
minute


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.cc@69
PS11, Line 69: Number of milliseconds for the threshold of slow scan."
What do you think of introducing a special value for the flag (e.g., -1 or 0) that would mean no scan is considered slow?  Since we don't know what's the prevalent workload for a Kudu cluster, it could turn out that every scan is a full table scan with huge amount of data returned, so even if 60 seconds looks like a reasonable default value, TODO


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.cc@75
PS11, Line 75: The slow "
             :              "scans define with --slow_scanner_threshold_ms
The threshold for a slow scan is defined with --slow_scanner_threshold_ms


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.cc@153
PS11, Line 153:   {
              :     std::lock_guard<percpu_rwlock> l(completed_scans_lock_);
              :     completed_scans_.clear();
              :   }
              :   {
              :     std::lock_guard<percpu_rwlock> l(slow_scans_lock_);
              :     slow_scans_.clear();
              :   }
Why is it needed?  The containers would be automatically cleaned up on destruction by the C++ runtime.


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.cc@291
PS11, Line 291: desc
Why not to continue using the move semantics here?


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.cc@321
PS11, Line 321:   unordered_map<string, scoped_refptr<ScanDescriptor>> scans;
              :   {
              :     kudu::shared_lock<rw_spinlock> l(slow_scans_lock_.get_lock());
              :     for (const auto& scan : slow_scans_) {
              :       InsertOrUpdate(&scans, scan->scanner_id, scan);
              :     }
              :   }
What's the purpose of using unordered dictionary/map here if later on the result container is sorted anyways?  Why not to use result vector 'ret' right away?


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.cc@355
PS11, Line 355: FLAGS_slow_scanner_threshold_ms
There are 3 accesses to this flag in the scope of this method.  Every access is an extra call and it involves some synchronization while fetching the value.  Consider fetching the value of the flag just once, storing it in the local variable, and then re-using the local variable in the scope of this method.


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.cc@361
PS11, Line 361:       LOG(INFO) << Substitute(
              :           "Slow scanner id: $0, of tablet $1, "
              :           "exceed the time threshold $2 ms for $3 ms.",
              :           it->first,
              :           scanner->tablet_id(),
              :           FLAGS_slow_scanner_threshold_ms,
              :           delta_time.ToMilliseconds());
Do you really want this to be logged for every scanner which goes beyond the defined 'slow' threshold?  My concern is that this might pollute the INFO log in case of heavy workload of many scans when the slow threshold isn't configured to take into account the regular patterns in the cluster.


http://gerrit.cloudera.org:8080/#/c/19392/11/src/kudu/tserver/scanners.cc@436
PS11, Line 436:   if (slow_scans_.capacity() == 0) {
              :     return;
              :   }
              :   if (slow_scans_.size() == slow_scans_.capacity()) {
              :     slow_scans_[slow_scans_offset_++] = descriptor;
              :     if (slow_scans_offset_ == slow_scans_.capacity()) {
              :       slow_scans_offset_ = 0;
              :     }
              :   } else {
              :     slow_scans_.emplace_back(descriptor);
              :   }
Instead of duplicating this code from RecordCompletedScanUnlocked(), consider extracting this circular buffer's logic into a function and use it both in ScannerManager::RecordCompletedScanUnlocked() and ScannerManager::RecordSlowScanUnlocked() method.



-- 
To view, visit http://gerrit.cloudera.org:8080/19392
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibd1dcac8b81c5eefd306e7020c9c52b3f28e603c
Gerrit-Change-Number: 19392
Gerrit-PatchSet: 11
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Sun, 22 Jan 2023 06:06:45 +0000
Gerrit-HasComments: Yes