You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Alexey Serbin (Code Review)" <ge...@cloudera.org> on 2021/06/16 07:24:38 UTC

[kudu-CR] WIP [tools] add --row count only and --report scanner stats flags

Alexey Serbin has uploaded this change for review. ( http://gerrit.cloudera.org:8080/17598


Change subject: WIP [tools] add --row_count_only and --report_scanner_stats flags
......................................................................

WIP [tools] add --row_count_only and --report_scanner_stats flags

This patch updates `kudu table scan` and `kudu perf table_scan` CLI
tools to introduce two new flags:
  * --row_count_only
  * --report_scanner_stats

I also added a few generic test scenarios for the new functionality.

The motivation for this patch the necessity to:
  * have an explicit option to run something similar to
    SELECT COUNT(1) FROM <table_name> when using `kudu perf scan_table`
    and `kudu table scan` CLI tools
  * report on the scanner metrics while running a query like
    SELECT COUNT(1) FROM <table_name>

WIP:
  * make sure the newly added tests pass

Change-Id: Ia64e1a0b26996f0087d2473d15350d590581a69c
---
M src/kudu/tools/kudu-tool-test.cc
M src/kudu/tools/table_scanner.cc
M src/kudu/tools/tool_action_common.cc
M src/kudu/tools/tool_action_perf.cc
M src/kudu/tools/tool_action_table.cc
5 files changed, 114 insertions(+), 12 deletions(-)



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia64e1a0b26996f0087d2473d15350d590581a69c
Gerrit-Change-Number: 17598
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>

[kudu-CR] [tools] add --row count only and --report scanner stats flags

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

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

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

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

Change subject: [tools] add --row_count_only and --report_scanner_stats flags
......................................................................

[tools] add --row_count_only and --report_scanner_stats flags

This patch updates `kudu table scan` and `kudu perf table_scan` CLI
tools to introduce two new flags:
  * --row_count_only
  * --report_scanner_stats

The motivation for this patch the necessity to:
  * have an explicit option to run something similar to
    SELECT COUNT(1) FROM <table_name> when using `kudu perf scan_table`
    and `kudu table scan` CLI tools
  * report on the scanner metrics while running a query like
    SELECT COUNT(1) FROM <table_name>

I also added a few generic test scenarios to cover the newly introduced
new functionality.

Another notable change in behavior is not polluting the output of the
table rows with scanner stats by default: only the summary is printed
in the very end unless --report_scanner_stats is specified (of course,
scanner stats have been enriched with this patch as well).

A few examples of the output from the updated CLI tools:

  kudu table scan 10.17.240.17:9876 \
      default.loadgen_auto_d61d513aeec4478d9c4638e434565dee \
      --row_count_only
  Total count 3000000 cost 0.16833 seconds

  kudu perf table_scan 10.17.240.17:9876 \
      default.loadgen_auto_d61d513aeec4478d9c4638e434565dee \
      --tablets=e1195e0e0e6842b3a9c19ef6de696440 \
      --row_count_only \
      --report_scanner_stats
  T e1195e0e0e6842b3a9c19ef6de696440 scanned 93753 rows in 0.050205518 seconds
                 NextBatch() calls               1
                        bytes_read               0
             cfile_cache_hit_bytes               0
            cfile_cache_miss_bytes               0
                  cpu_system_nanos         1000000
                    cpu_user_nanos        38994000
              queue_duration_nanos          131807
              total_duration_nanos        41545038
  Total count 93753 cost 0.051109 second

  kudu perf table_scan 10.17.240.17:9876 \
      default.loadgen_auto_d61d513aeec4478d9c4638e434565dee \
      --tablets=e1195e0e0e6842b3a9c19ef6de696440 \
      --columns=* \
      --report_scanner_stats
  T e1195e0e0e6842b3a9c19ef6de696440 scanned 93753 rows in 0.084285734 seconds
                 NextBatch() calls               6
                        bytes_read         3262005
             cfile_cache_hit_bytes               0
            cfile_cache_miss_bytes         3524539
                  cpu_system_nanos        21998000
                    cpu_user_nanos       164975000
              queue_duration_nanos          339230
              total_duration_nanos        51007394
  Total count 93753 cost 0.0854584 seconds

Change-Id: Ia64e1a0b26996f0087d2473d15350d590581a69c
---
M src/kudu/tools/kudu-tool-test.cc
M src/kudu/tools/table_scanner.cc
M src/kudu/tools/tool_action_common.cc
M src/kudu/tools/tool_action_perf.cc
M src/kudu/tools/tool_action_table.cc
5 files changed, 137 insertions(+), 13 deletions(-)


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia64e1a0b26996f0087d2473d15350d590581a69c
Gerrit-Change-Number: 17598
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [tools] add --row count only and --report scanner stats flags

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

Change subject: [tools] add --row_count_only and --report_scanner_stats flags
......................................................................


Patch Set 2:

(1 comment)

Neat addition! Though it looks like the newly updated tests aren't happy yet.

http://gerrit.cloudera.org:8080/#/c/17598/2/src/kudu/tools/kudu-tool-test.cc
File src/kudu/tools/kudu-tool-test.cc:

http://gerrit.cloudera.org:8080/#/c/17598/2/src/kudu/tools/kudu-tool-test.cc@2848
PS2, Line 2848:     ASSERT_TRUE(s.ok()) << s.ToString() << ": " << err;
nit: would it make sense to also check there are no row outputs? I guess that might be tricky, so maybe not.



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia64e1a0b26996f0087d2473d15350d590581a69c
Gerrit-Change-Number: 17598
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 16 Jun 2021 20:16:02 +0000
Gerrit-HasComments: Yes

[kudu-CR] [tools] add --row count only and --report scanner stats flags

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

Change subject: [tools] add --row_count_only and --report_scanner_stats flags
......................................................................

[tools] add --row_count_only and --report_scanner_stats flags

This patch updates `kudu table scan` and `kudu perf table_scan` CLI
tools to introduce two new flags:
  * --row_count_only
  * --report_scanner_stats

The motivation for this patch the necessity to:
  * have an explicit option to run something similar to
    SELECT COUNT(1) FROM <table_name> when using `kudu perf scan_table`
    and `kudu table scan` CLI tools
  * report on the scanner metrics while running a query like
    SELECT COUNT(1) FROM <table_name>

I also added a few generic test scenarios to cover the newly introduced
new functionality.

Another notable change in behavior is not polluting the output of the
table rows with scanner stats by default: only the summary is printed
in the very end unless --report_scanner_stats is specified (of course,
scanner stats have been enriched with this patch as well).

A few examples of the output from the updated CLI tools:

  kudu table scan 10.17.240.17:9876 \
      default.loadgen_auto_d61d513aeec4478d9c4638e434565dee \
      --row_count_only
  Total count 3000000 cost 0.16833 seconds

  kudu perf table_scan 10.17.240.17:9876 \
      default.loadgen_auto_d61d513aeec4478d9c4638e434565dee \
      --tablets=e1195e0e0e6842b3a9c19ef6de696440 \
      --row_count_only \
      --report_scanner_stats
  T e1195e0e0e6842b3a9c19ef6de696440 scanned 93753 rows in 0.050205518 seconds
                 NextBatch() calls               1
                        bytes_read               0
             cfile_cache_hit_bytes               0
            cfile_cache_miss_bytes               0
                  cpu_system_nanos         1000000
                    cpu_user_nanos        38994000
              queue_duration_nanos          131807
              total_duration_nanos        41545038
  Total count 93753 cost 0.051109 second

  kudu perf table_scan 10.17.240.17:9876 \
      default.loadgen_auto_d61d513aeec4478d9c4638e434565dee \
      --tablets=e1195e0e0e6842b3a9c19ef6de696440 \
      --columns=* \
      --report_scanner_stats
  T e1195e0e0e6842b3a9c19ef6de696440 scanned 93753 rows in 0.084285734 seconds
                 NextBatch() calls               6
                        bytes_read         3262005
             cfile_cache_hit_bytes               0
            cfile_cache_miss_bytes         3524539
                  cpu_system_nanos        21998000
                    cpu_user_nanos       164975000
              queue_duration_nanos          339230
              total_duration_nanos        51007394
  Total count 93753 cost 0.0854584 seconds

Change-Id: Ia64e1a0b26996f0087d2473d15350d590581a69c
Reviewed-on: http://gerrit.cloudera.org:8080/17598
Reviewed-by: Andrew Wong <aw...@cloudera.com>
Tested-by: Kudu Jenkins
---
M src/kudu/tools/kudu-tool-test.cc
M src/kudu/tools/table_scanner.cc
M src/kudu/tools/tool_action_common.cc
M src/kudu/tools/tool_action_perf.cc
M src/kudu/tools/tool_action_table.cc
5 files changed, 146 insertions(+), 14 deletions(-)

Approvals:
  Andrew Wong: Looks good to me, approved
  Kudu Jenkins: Verified

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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia64e1a0b26996f0087d2473d15350d590581a69c
Gerrit-Change-Number: 17598
Gerrit-PatchSet: 4
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [tools] add --row count only and --report scanner stats flags

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

Change subject: [tools] add --row_count_only and --report_scanner_stats flags
......................................................................


Patch Set 2:

(1 comment)

> (1 comment)
 > 
 > Neat addition! Though it looks like the newly updated tests aren't
 > happy yet.

Thank you for the review!

I updated the tests, so no ASAN warnings are reported.

We talked about those warnings offline, and it seems it's still a mystery why with higher numbers for kudu perf loadgen the test reports ASAN warnings, although I ran the test with the following "instrumentation" and saw all allocated memory was deallocated successfully.  I guess we can take care of that separately.

diff --git a/src/kudu/common/partial_row.cc b/src/kudu/common/partial_row.cc
index 6951e6a6d..67a962aeb 100644
--- a/src/kudu/common/partial_row.cc
+++ b/src/kudu/common/partial_row.cc
@@ -253,6 +253,8 @@ void KuduPartialRow::DeallocateStringIfSet(int col_idx, const ColumnSchema& col)
         LOG(FATAL) << "Unexpected type " << col.type_info()->type();
         break;
     }
+    LOG(INFO) << Substitute("CALLING delete on $0",
+                            reinterpret_cast<uintptr_t>(dst->data()));
     delete [] dst->data();
     BitmapClear(owned_strings_bitmap_, col_idx);
   }
@@ -442,6 +444,8 @@ Status KuduPartialRow::SetSliceCopy(int col_idx, const Slice& val) {
     case STRING:
     case BINARY:
       auto relocated = new uint8_t[val.size()];
+      LOG(INFO) << Substitute("CALLING new: $0",
+                              reinterpret_cast<uintptr_t>(relocated));
       memcpy(relocated, val.data(), val.size());
       relocated_val = Slice(relocated, val.size());
       break;

http://gerrit.cloudera.org:8080/#/c/17598/2/src/kudu/tools/kudu-tool-test.cc
File src/kudu/tools/kudu-tool-test.cc:

http://gerrit.cloudera.org:8080/#/c/17598/2/src/kudu/tools/kudu-tool-test.cc@2848
PS2, Line 2848:     ASSERT_TRUE(s.ok()) << s.ToString() << ": " << err;
> nit: would it make sense to also check there are no row outputs? I guess th
Good point.  Done.



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia64e1a0b26996f0087d2473d15350d590581a69c
Gerrit-Change-Number: 17598
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Thu, 17 Jun 2021 02:25:59 +0000
Gerrit-HasComments: Yes

[kudu-CR] [tools] add --row count only and --report scanner stats flags

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

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

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

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

Change subject: [tools] add --row_count_only and --report_scanner_stats flags
......................................................................

[tools] add --row_count_only and --report_scanner_stats flags

This patch updates `kudu table scan` and `kudu perf table_scan` CLI
tools to introduce two new flags:
  * --row_count_only
  * --report_scanner_stats

The motivation for this patch the necessity to:
  * have an explicit option to run something similar to
    SELECT COUNT(1) FROM <table_name> when using `kudu perf scan_table`
    and `kudu table scan` CLI tools
  * report on the scanner metrics while running a query like
    SELECT COUNT(1) FROM <table_name>

I also added a few generic test scenarios to cover the newly introduced
new functionality.

Another notable change in behavior is not polluting the output of the
table rows with scanner stats by default: only the summary is printed
in the very end unless --report_scanner_stats is specified (of course,
scanner stats have been enriched with this patch as well).

A few examples of the output from the updated CLI tools:

  kudu table scan 10.17.240.17:9876 \
      default.loadgen_auto_d61d513aeec4478d9c4638e434565dee \
      --row_count_only
  Total count 3000000 cost 0.16833 seconds

  kudu perf table_scan 10.17.240.17:9876 \
      default.loadgen_auto_d61d513aeec4478d9c4638e434565dee \
      --tablets=e1195e0e0e6842b3a9c19ef6de696440 \
      --row_count_only \
      --report_scanner_stats
  T e1195e0e0e6842b3a9c19ef6de696440 scanned 93753 rows in 0.050205518 seconds
                 NextBatch() calls               1
                        bytes_read               0
             cfile_cache_hit_bytes               0
            cfile_cache_miss_bytes               0
                  cpu_system_nanos         1000000
                    cpu_user_nanos        38994000
              queue_duration_nanos          131807
              total_duration_nanos        41545038
  Total count 93753 cost 0.051109 second

  kudu perf table_scan 10.17.240.17:9876 \
      default.loadgen_auto_d61d513aeec4478d9c4638e434565dee \
      --tablets=e1195e0e0e6842b3a9c19ef6de696440 \
      --columns=* \
      --report_scanner_stats
  T e1195e0e0e6842b3a9c19ef6de696440 scanned 93753 rows in 0.084285734 seconds
                 NextBatch() calls               6
                        bytes_read         3262005
             cfile_cache_hit_bytes               0
            cfile_cache_miss_bytes         3524539
                  cpu_system_nanos        21998000
                    cpu_user_nanos       164975000
              queue_duration_nanos          339230
              total_duration_nanos        51007394
  Total count 93753 cost 0.0854584 seconds

Change-Id: Ia64e1a0b26996f0087d2473d15350d590581a69c
---
M src/kudu/tools/kudu-tool-test.cc
M src/kudu/tools/table_scanner.cc
M src/kudu/tools/tool_action_common.cc
M src/kudu/tools/tool_action_perf.cc
M src/kudu/tools/tool_action_table.cc
5 files changed, 146 insertions(+), 14 deletions(-)


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia64e1a0b26996f0087d2473d15350d590581a69c
Gerrit-Change-Number: 17598
Gerrit-PatchSet: 3
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] WIP [tools] add --row count only and --report scanner stats flags

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

Change subject: WIP [tools] add --row_count_only and --report_scanner_stats flags
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/17598/1//COMMIT_MSG
Commit Message:

PS1: 
Example output from the updated tools:


./bin/kudu table scan 10.17.240.17:9876 default.loadgen_auto_f83d5610d9ef48cda0f8815103727e8f --tablets=ee45403b6bc54e169b721566535f5b41 --report_scanner_stats --row_count_only
T ee45403b6bc54e169b721566535f5b41 scanned 93753 rows in 0.018626037 seconds
               NextBatch() calls               1
                      bytes_read               0
           cfile_cache_hit_bytes               0
          cfile_cache_miss_bytes               0
                cpu_system_nanos               0
                  cpu_user_nanos         7999000
            queue_duration_nanos           63100
            total_duration_nanos         9324381
Total count 93753 cost 0.0195678 seconds


./bin/kudu perf table_scan 10.17.240.17:9876 default.loadgen_auto_f83d5610d9ef48cda0f8815103727e8f --tablets=ee45403b6bc54e169b721566535f5b41  --row_count_only
Total count 93753 cost 0.0185584 seconds



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia64e1a0b26996f0087d2473d15350d590581a69c
Gerrit-Change-Number: 17598
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 16 Jun 2021 07:33:16 +0000
Gerrit-HasComments: Yes

[kudu-CR] [tools] add --row count only and --report scanner stats flags

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

Change subject: [tools] add --row_count_only and --report_scanner_stats flags
......................................................................


Patch Set 2: Code-Review+2


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia64e1a0b26996f0087d2473d15350d590581a69c
Gerrit-Change-Number: 17598
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 16 Jun 2021 20:16:14 +0000
Gerrit-HasComments: No

[kudu-CR] [tools] add --row count only and --report scanner stats flags

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

Change subject: [tools] add --row_count_only and --report_scanner_stats flags
......................................................................


Patch Set 3: Code-Review+2


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia64e1a0b26996f0087d2473d15350d590581a69c
Gerrit-Change-Number: 17598
Gerrit-PatchSet: 3
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Thu, 17 Jun 2021 02:36:36 +0000
Gerrit-HasComments: No