You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Yingchun Lai (Code Review)" <ge...@cloudera.org> on 2019/04/16 10:17:26 UTC

[kudu-CR] [ksck] Make ksck tool to be more concurrency

Yingchun Lai has uploaded this change for review. ( http://gerrit.cloudera.org:8080/13024


Change subject: [ksck] Make ksck tool to be more concurrency
......................................................................

[ksck] Make ksck tool to be more concurrency

Though ksck fetch tserver info concurrently now, it's still slow when to
fetch info from clusters which have thousands of tables, much more
slower when CLI tool and clusters are in different IDCs.
This patch make it more concurrency to fetch masters info and tables
info.

Change-Id: I2f3f0e3f5115a46dd3afc83dda75e7241618eea4
---
M src/kudu/tools/ksck-test.cc
M src/kudu/tools/ksck.cc
M src/kudu/tools/ksck.h
M src/kudu/tools/ksck_remote.cc
M src/kudu/tools/ksck_remote.h
5 files changed, 150 insertions(+), 62 deletions(-)



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2f3f0e3f5115a46dd3afc83dda75e7241618eea4
Gerrit-Change-Number: 13024
Gerrit-PatchSet: 1
Gerrit-Owner: Yingchun Lai <40...@qq.com>

[kudu-CR] [ksck] Make ksck tool more concurrent

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

Change subject: [ksck] Make ksck tool more concurrent
......................................................................


Patch Set 7:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/13024/6/src/kudu/tools/ksck.cc
File src/kudu/tools/ksck.cc:

http://gerrit.cloudera.org:8080/#/c/13024/6/src/kudu/tools/ksck.cc@340
PS6, Line 340:     RETURN_NOT_OK(pool_->SubmitFunc([&]() {
> Can be RETURN_NOT_OK.
Done


http://gerrit.cloudera.org:8080/#/c/13024/6/src/kudu/tools/ksck.cc@373
PS6, Line 373:           std::lock_guard<simple_spinlock> lock(tablet_server_summaries_lock);
> This needs to acquire tablet_server_summaries_lock as well, so that multipl
Done


http://gerrit.cloudera.org:8080/#/c/13024/6/src/kudu/tools/ksck_remote.cc
File src/kudu/tools/ksck_remote.cc:

http://gerrit.cloudera.org:8080/#/c/13024/6/src/kudu/tools/ksck_remote.cc@534
PS6, Line 534:           LOG(ERROR) << Substitute("unable to open table $0: $1", table_name, s.ToString());
> Why do you need to acquire this? I don't think table_name access needs to b
Done



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2f3f0e3f5115a46dd3afc83dda75e7241618eea4
Gerrit-Change-Number: 13024
Gerrit-PatchSet: 7
Gerrit-Owner: Yingchun Lai <40...@qq.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Reviewer: Yingchun Lai <40...@qq.com>
Gerrit-Comment-Date: Fri, 19 Apr 2019 06:43:22 +0000
Gerrit-HasComments: Yes

[kudu-CR] [ksck] Make ksck tool more concurrent

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

Change subject: [ksck] Make ksck tool more concurrent
......................................................................


Patch Set 3:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/13024/4/src/kudu/tools/ksck.cc
File src/kudu/tools/ksck.cc:

http://gerrit.cloudera.org:8080/#/c/13024/4/src/kudu/tools/ksck.cc@166
PS4, Line 166:   gscoped_ptr<ThreadPool> pool;
             :   RETURN_NOT_OK(ThreadPoolBuilder("CheckMasterHealth")
             :                 .set_max_threads(FLAGS_fetch_info_concurrency > 0 ?
             :                     FLAGS_fetch_info_concurrency : num_masters)
             :                 .set_idle_timeou
> Why do this here and not in the constructor?
Done


http://gerrit.cloudera.org:8080/#/c/13024/4/src/kudu/tools/ksck_remote.cc
File src/kudu/tools/ksck_remote.cc:

http://gerrit.cloudera.org:8080/#/c/13024/4/src/kudu/tools/ksck_remote.cc@512
PS4, Line 512:                     .set_max_threads(FLAGS_fetch_info_concurrency)
             :                     .set_idle_timeout(MonoDelta::FromMilliseconds(10))
             :                     .Build(&pool));
             : 
> Likewise, this seems better placed in the RemoteKsckCluster constructor.
Done



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2f3f0e3f5115a46dd3afc83dda75e7241618eea4
Gerrit-Change-Number: 13024
Gerrit-PatchSet: 3
Gerrit-Owner: Yingchun Lai <40...@qq.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Reviewer: Yingchun Lai <40...@qq.com>
Gerrit-Comment-Date: Thu, 18 Apr 2019 06:22:26 +0000
Gerrit-HasComments: Yes

[kudu-CR] [ksck] Make ksck tool more concurrent

Posted by "Yingchun Lai (Code Review)" <ge...@cloudera.org>.
Hello Will Berkeley, Kudu Jenkins, Adar Dembo, 

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

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

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

Change subject: [ksck] Make ksck tool more concurrent
......................................................................

[ksck] Make ksck tool more concurrent

Though ksck fetches tserver info concurrently now, it's still slow when
fetching info from clusters that have thousands of tables when the CLI
and the cluster are in different regions.
This patch make it more concurrent when fetching master info and table
info.

Change-Id: I2f3f0e3f5115a46dd3afc83dda75e7241618eea4
---
M src/kudu/tools/ksck-test.cc
M src/kudu/tools/ksck.cc
M src/kudu/tools/ksck.h
M src/kudu/tools/ksck_remote.cc
M src/kudu/tools/ksck_remote.h
M src/kudu/tools/tool_action_cluster.cc
6 files changed, 153 insertions(+), 69 deletions(-)


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I2f3f0e3f5115a46dd3afc83dda75e7241618eea4
Gerrit-Change-Number: 13024
Gerrit-PatchSet: 4
Gerrit-Owner: Yingchun Lai <40...@qq.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Reviewer: Yingchun Lai <40...@qq.com>

[kudu-CR] [ksck] Make ksck tool more concurrent

Posted by "Yingchun Lai (Code Review)" <ge...@cloudera.org>.
Hello Will Berkeley, Kudu Jenkins, Adar Dembo, 

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

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

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

Change subject: [ksck] Make ksck tool more concurrent
......................................................................

[ksck] Make ksck tool more concurrent

Though ksck fetches tserver info concurrently now, it's still slow when
fetching info from clusters that have thousands of tables when the CLI
and the cluster are in different regions.
This patch make it more concurrent when fetching master info and table
info.

Change-Id: I2f3f0e3f5115a46dd3afc83dda75e7241618eea4
---
M src/kudu/tools/ksck-test.cc
M src/kudu/tools/ksck.cc
M src/kudu/tools/ksck.h
M src/kudu/tools/ksck_remote.cc
M src/kudu/tools/ksck_remote.h
M src/kudu/tools/tool_action_cluster.cc
6 files changed, 152 insertions(+), 63 deletions(-)


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I2f3f0e3f5115a46dd3afc83dda75e7241618eea4
Gerrit-Change-Number: 13024
Gerrit-PatchSet: 3
Gerrit-Owner: Yingchun Lai <40...@qq.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Reviewer: Yingchun Lai <40...@qq.com>

[kudu-CR] [ksck] Make ksck tool more concurrent

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

Change subject: [ksck] Make ksck tool more concurrent
......................................................................


Patch Set 5:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/13024/5/src/kudu/tools/ksck.cc
File src/kudu/tools/ksck.cc:

http://gerrit.cloudera.org:8080/#/c/13024/5/src/kudu/tools/ksck.cc@176
PS5, Line 176:     CHECK_OK(pool_->SubmitFunc([&]() {
this can be a RETURN_NOT_OK because the function returns a Status.


http://gerrit.cloudera.org:8080/#/c/13024/5/src/kudu/tools/ksck.cc@337
PS5, Line 337:   CHECK(pool_.get());
You can remove this; it's guaranteed by the constructor.


http://gerrit.cloudera.org:8080/#/c/13024/5/src/kudu/tools/ksck_remote.cc
File src/kudu/tools/ksck_remote.cc:

http://gerrit.cloudera.org:8080/#/c/13024/5/src/kudu/tools/ksck_remote.cc@566
PS5, Line 566:   CHECK(pool_.get());
Can be dropped; guaranteed by the constructor.



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2f3f0e3f5115a46dd3afc83dda75e7241618eea4
Gerrit-Change-Number: 13024
Gerrit-PatchSet: 5
Gerrit-Owner: Yingchun Lai <40...@qq.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Reviewer: Yingchun Lai <40...@qq.com>
Gerrit-Comment-Date: Thu, 18 Apr 2019 18:23:57 +0000
Gerrit-HasComments: Yes

[kudu-CR] [ksck] Make ksck tool more concurrent

Posted by "Yingchun Lai (Code Review)" <ge...@cloudera.org>.
Hello Will Berkeley, Kudu Jenkins, Adar Dembo, 

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

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

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

Change subject: [ksck] Make ksck tool more concurrent
......................................................................

[ksck] Make ksck tool more concurrent

Though ksck fetches tserver info concurrently now, it's still slow when
fetching info from clusters that have thousands of tables when the CLI
and the cluster are in different regions.
This patch make it more concurrent when fetching master info and table
info.

Change-Id: I2f3f0e3f5115a46dd3afc83dda75e7241618eea4
---
M src/kudu/tools/ksck-test.cc
M src/kudu/tools/ksck.cc
M src/kudu/tools/ksck.h
M src/kudu/tools/ksck_remote.cc
M src/kudu/tools/ksck_remote.h
M src/kudu/tools/tool_action_cluster.cc
6 files changed, 158 insertions(+), 76 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/24/13024/5
-- 
To view, visit http://gerrit.cloudera.org:8080/13024
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I2f3f0e3f5115a46dd3afc83dda75e7241618eea4
Gerrit-Change-Number: 13024
Gerrit-PatchSet: 5
Gerrit-Owner: Yingchun Lai <40...@qq.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Reviewer: Yingchun Lai <40...@qq.com>

[kudu-CR] [ksck] Make ksck tool more concurrent

Posted by "Yingchun Lai (Code Review)" <ge...@cloudera.org>.
Hello Will Berkeley, Kudu Jenkins, Adar Dembo, 

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

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

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

Change subject: [ksck] Make ksck tool more concurrent
......................................................................

[ksck] Make ksck tool more concurrent

Though ksck fetches tserver info concurrently now, it's still slow when
fetching info from clusters that have thousands of tables when the CLI
and the cluster are in different regions.
This patch make it more concurrent when fetching master info and table
info.

Change-Id: I2f3f0e3f5115a46dd3afc83dda75e7241618eea4
---
M src/kudu/tools/ksck-test.cc
M src/kudu/tools/ksck.cc
M src/kudu/tools/ksck.h
M src/kudu/tools/ksck_remote.cc
M src/kudu/tools/ksck_remote.h
M src/kudu/tools/tool_action_cluster.cc
6 files changed, 158 insertions(+), 76 deletions(-)


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I2f3f0e3f5115a46dd3afc83dda75e7241618eea4
Gerrit-Change-Number: 13024
Gerrit-PatchSet: 6
Gerrit-Owner: Yingchun Lai <40...@qq.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Reviewer: Yingchun Lai <40...@qq.com>

[kudu-CR] [ksck] Make ksck tool more concurrent

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

Change subject: [ksck] Make ksck tool more concurrent
......................................................................


Patch Set 2:

(21 comments)

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

http://gerrit.cloudera.org:8080/#/c/13024/1//COMMIT_MSG@7
PS1, Line 7: more concurrent
> more concurrent
Done


http://gerrit.cloudera.org:8080/#/c/13024/1//COMMIT_MSG@9
PS1, Line 9: fetch
> fetches
Done


http://gerrit.cloudera.org:8080/#/c/13024/1//COMMIT_MSG@9
PS1, Line 9: w when
           : fetch
> when fetching
Done


http://gerrit.cloudera.org:8080/#/c/13024/1//COMMIT_MSG@10
PS1, Line 10: rs th
> that
Done


http://gerrit.cloudera.org:8080/#/c/13024/1//COMMIT_MSG@11
PS1, Line 11: 
> What's this stand for? I____ Data Center?
Internet Data Center, I've replace it with 'region'


http://gerrit.cloudera.org:8080/#/c/13024/1//COMMIT_MSG@11
PS1, Line 11: fferent 
> the cluster
Done


http://gerrit.cloudera.org:8080/#/c/13024/1//COMMIT_MSG@11
PS1, Line 11: ster are 
> the CLI
Done


http://gerrit.cloudera.org:8080/#/c/13024/1//COMMIT_MSG@10
PS1, Line 10:  when the CLI
            : and th
> Remove
Done


http://gerrit.cloudera.org:8080/#/c/13024/1//COMMIT_MSG@12
PS1, Line 12: concurrent 
> concurrent
Done


http://gerrit.cloudera.org:8080/#/c/13024/1//COMMIT_MSG@12
PS1, Line 12: ing mas
> master
Done


http://gerrit.cloudera.org:8080/#/c/13024/1//COMMIT_MSG@12
PS1, Line 12: nd tab
> table
Done


http://gerrit.cloudera.org:8080/#/c/13024/1//COMMIT_MSG@12
PS1, Line 12: hen fetc
> when fetching
Done


http://gerrit.cloudera.org:8080/#/c/13024/1/src/kudu/tools/ksck.h
File src/kudu/tools/ksck.h:

http://gerrit.cloudera.org:8080/#/c/13024/1/src/kudu/tools/ksck.h@423
PS1, Line 423: in
> in
Done


http://gerrit.cloudera.org:8080/#/c/13024/1/src/kudu/tools/ksck.cc
File src/kudu/tools/ksck.cc:

http://gerrit.cloudera.org:8080/#/c/13024/1/src/kudu/tools/ksck.cc@60
PS1, Line 60: );
            : 
            : DEFINE_string(ksck_format, "plain_concise",
> I don't understand this part.
Done


http://gerrit.cloudera.org:8080/#/c/13024/1/src/kudu/tools/ksck.cc@164
PS1, Line 164: }
> I think returning a Status::NotFound is appropriate here, rather than a CHE
Done


http://gerrit.cloudera.org:8080/#/c/13024/1/src/kudu/tools/ksck.cc@337
PS1, Line 337: lliseconds(10
> At some point in the future this could be in the hundreds or thousands. I t
Done


http://gerrit.cloudera.org:8080/#/c/13024/1/src/kudu/tools/ksck_remote.cc
File src/kudu/tools/ksck_remote.cc:

http://gerrit.cloudera.org:8080/#/c/13024/1/src/kudu/tools/ksck_remote.cc@505
PS1, Line 505:   int num_tables = static_cast<int>(table_names.size());
             :   if (num_tables == 0) {
             :     return Status::OK();
             :   }
> Preserve the previous behavior of returning OK if there's no tables-- it's 
Done


http://gerrit.cloudera.org:8080/#/c/13024/1/src/kudu/tools/ksck_remote.cc@513
PS1, Line 513: lliseconds
> This could be in the thousands. I think we need a reasonable default, like 
Done


http://gerrit.cloudera.org:8080/#/c/13024/1/src/kudu/tools/ksck_remote.cc@542
PS1, Line 542: 
             :   if (bad_tables.Load() > 0) {
             :     return Status::NetworkError(
             :         Substitute("failed to gather info from all tables: $0 of $1 had errors",
             :    
> We need to provide at least one status from a failed OpenTable, too, so a u
Done


http://gerrit.cloudera.org:8080/#/c/13024/1/src/kudu/tools/ksck_remote.cc@552
PS1, Line 552: Status RemoteKsckCluster::RetrieveAllTablets() {
             :   int num_tables = static_cast<int>(tables().size());
             :   if (num_tables == 0) {
             :    
> Same. This is an expected and non-error condition, so return OK.
Done


http://gerrit.cloudera.org:8080/#/c/13024/1/src/kudu/tools/ksck_remote.cc@560
PS1, Line 560: oncurrency
> Again I think this will be too big for large clusters, creating possibly th
Done



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2f3f0e3f5115a46dd3afc83dda75e7241618eea4
Gerrit-Change-Number: 13024
Gerrit-PatchSet: 2
Gerrit-Owner: Yingchun Lai <40...@qq.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Reviewer: Yingchun Lai <40...@qq.com>
Gerrit-Comment-Date: Wed, 17 Apr 2019 05:55:21 +0000
Gerrit-HasComments: Yes

[kudu-CR] [ksck] Make ksck tool more concurrent

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

Change subject: [ksck] Make ksck tool more concurrent
......................................................................


Patch Set 3:

(4 comments)

http://gerrit.cloudera.org:8080/#/c/13024/3/src/kudu/tools/ksck.cc
File src/kudu/tools/ksck.cc:

http://gerrit.cloudera.org:8080/#/c/13024/3/src/kudu/tools/ksck.cc@334
PS3, Line 334:   gscoped_ptr<ThreadPool> pool;
             :   RETURN_NOT_OK(ThreadPoolBuilder("FetchInfoFromTabletServers")
             :                 .set_max_threads(FLAGS_fetch_info_concurrency)
             :                 .set_idle_timeout(MonoDelta::FromMilliseconds(10))
             :                 .Build(&pool));
Could we reuse the same thread pool as in CheckMasterHealth?


http://gerrit.cloudera.org:8080/#/c/13024/3/src/kudu/tools/ksck_remote.cc
File src/kudu/tools/ksck_remote.cc:

http://gerrit.cloudera.org:8080/#/c/13024/3/src/kudu/tools/ksck_remote.cc@559
PS3, Line 559:   RETURN_NOT_OK(ThreadPoolBuilder("RetrieveAllTablets")
             :                     .set_max_threads(FLAGS_fetch_info_concurrency)
             :                     .set_idle_timeout(MonoDelta::FromMilliseconds(10))
             :                     .Build(&pool));
Can we use the threadpool from RetrieveTablesList?


http://gerrit.cloudera.org:8080/#/c/13024/3/src/kudu/tools/ksck_remote.cc@564
PS3, Line 564:   for (const std::shared_ptr<KsckTable>& table : tables()) {
Nit: can drop std:: prefix


http://gerrit.cloudera.org:8080/#/c/13024/3/src/kudu/tools/ksck_remote.cc@566
PS3, Line 566:         boost::bind(&KsckCluster::RetrieveTabletsList, this, table)));
Can use std::bind here instead of boost::bind.



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2f3f0e3f5115a46dd3afc83dda75e7241618eea4
Gerrit-Change-Number: 13024
Gerrit-PatchSet: 3
Gerrit-Owner: Yingchun Lai <40...@qq.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Reviewer: Yingchun Lai <40...@qq.com>
Gerrit-Comment-Date: Wed, 17 Apr 2019 17:34:10 +0000
Gerrit-HasComments: Yes

[kudu-CR] [ksck] Make ksck tool more concurrent

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

Change subject: [ksck] Make ksck tool more concurrent
......................................................................


Patch Set 3:

(4 comments)

http://gerrit.cloudera.org:8080/#/c/13024/3/src/kudu/tools/ksck.cc
File src/kudu/tools/ksck.cc:

http://gerrit.cloudera.org:8080/#/c/13024/3/src/kudu/tools/ksck.cc@334
PS3, Line 334:   gscoped_ptr<ThreadPool> pool;
             :   RETURN_NOT_OK(ThreadPoolBuilder("FetchInfoFromTabletServers")
             :                 .set_max_threads(FLAGS_fetch_info_concurrency)
             :                 .set_idle_timeout(MonoDelta::FromMilliseconds(10))
             :                 .Build(&pool));
> Could we reuse the same thread pool as in CheckMasterHealth?
Done


http://gerrit.cloudera.org:8080/#/c/13024/3/src/kudu/tools/ksck_remote.cc
File src/kudu/tools/ksck_remote.cc:

http://gerrit.cloudera.org:8080/#/c/13024/3/src/kudu/tools/ksck_remote.cc@559
PS3, Line 559:   RETURN_NOT_OK(ThreadPoolBuilder("RetrieveAllTablets")
             :                     .set_max_threads(FLAGS_fetch_info_concurrency)
             :                     .set_idle_timeout(MonoDelta::FromMilliseconds(10))
             :                     .Build(&pool));
> Can we use the threadpool from RetrieveTablesList?
Done


http://gerrit.cloudera.org:8080/#/c/13024/3/src/kudu/tools/ksck_remote.cc@564
PS3, Line 564:   for (const std::shared_ptr<KsckTable>& table : tables()) {
> Nit: can drop std:: prefix
Done


http://gerrit.cloudera.org:8080/#/c/13024/3/src/kudu/tools/ksck_remote.cc@566
PS3, Line 566:         boost::bind(&KsckCluster::RetrieveTabletsList, this, table)));
> Can use std::bind here instead of boost::bind.
Done



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2f3f0e3f5115a46dd3afc83dda75e7241618eea4
Gerrit-Change-Number: 13024
Gerrit-PatchSet: 3
Gerrit-Owner: Yingchun Lai <40...@qq.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Reviewer: Yingchun Lai <40...@qq.com>
Gerrit-Comment-Date: Thu, 18 Apr 2019 02:41:54 +0000
Gerrit-HasComments: Yes

[kudu-CR] [ksck] Make ksck tool more concurrent

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

Change subject: [ksck] Make ksck tool more concurrent
......................................................................

[ksck] Make ksck tool more concurrent

Though ksck fetches tserver info concurrently now, it's still slow when
fetching info from clusters that have thousands of tables when the CLI
and the cluster are in different regions.
This patch make it more concurrent when fetching master info and table
info.

Change-Id: I2f3f0e3f5115a46dd3afc83dda75e7241618eea4
Reviewed-on: http://gerrit.cloudera.org:8080/13024
Tested-by: Kudu Jenkins
Reviewed-by: Adar Dembo <ad...@cloudera.com>
---
M src/kudu/tools/ksck-test.cc
M src/kudu/tools/ksck.cc
M src/kudu/tools/ksck.h
M src/kudu/tools/ksck_remote.cc
M src/kudu/tools/ksck_remote.h
M src/kudu/tools/tool_action_cluster.cc
6 files changed, 191 insertions(+), 109 deletions(-)

Approvals:
  Kudu Jenkins: Verified
  Adar Dembo: Looks good to me, approved

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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I2f3f0e3f5115a46dd3afc83dda75e7241618eea4
Gerrit-Change-Number: 13024
Gerrit-PatchSet: 8
Gerrit-Owner: Yingchun Lai <40...@qq.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Reviewer: Yingchun Lai <40...@qq.com>

[kudu-CR] [ksck] Make ksck tool more concurrent

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

Change subject: [ksck] Make ksck tool more concurrent
......................................................................


Patch Set 6:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/13024/5/src/kudu/tools/ksck.cc
File src/kudu/tools/ksck.cc:

http://gerrit.cloudera.org:8080/#/c/13024/5/src/kudu/tools/ksck.cc@176
PS5, Line 176:     RETURN_NOT_OK(pool_->SubmitFunc([&]() {
> this can be a RETURN_NOT_OK because the function returns a Status.
Done


http://gerrit.cloudera.org:8080/#/c/13024/5/src/kudu/tools/ksck.cc@337
PS5, Line 337: 
> You can remove this; it's guaranteed by the constructor.
Done


http://gerrit.cloudera.org:8080/#/c/13024/5/src/kudu/tools/ksck_remote.cc
File src/kudu/tools/ksck_remote.cc:

http://gerrit.cloudera.org:8080/#/c/13024/5/src/kudu/tools/ksck_remote.cc@566
PS5, Line 566: 
> Can be dropped; guaranteed by the constructor.
Done



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2f3f0e3f5115a46dd3afc83dda75e7241618eea4
Gerrit-Change-Number: 13024
Gerrit-PatchSet: 6
Gerrit-Owner: Yingchun Lai <40...@qq.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Reviewer: Yingchun Lai <40...@qq.com>
Gerrit-Comment-Date: Fri, 19 Apr 2019 01:06:00 +0000
Gerrit-HasComments: Yes

[kudu-CR] [ksck] Make ksck tool to be more concurrency

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

Change subject: [ksck] Make ksck tool to be more concurrency
......................................................................


Patch Set 1:

(21 comments)

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

http://gerrit.cloudera.org:8080/#/c/13024/1//COMMIT_MSG@7
PS1, Line 7: to be more concurrency
more concurrent


http://gerrit.cloudera.org:8080/#/c/13024/1//COMMIT_MSG@9
PS1, Line 9: fetch
fetches


http://gerrit.cloudera.org:8080/#/c/13024/1//COMMIT_MSG@9
PS1, Line 9: when to
           : fetch
when fetching


http://gerrit.cloudera.org:8080/#/c/13024/1//COMMIT_MSG@10
PS1, Line 10: which
that


http://gerrit.cloudera.org:8080/#/c/13024/1//COMMIT_MSG@10
PS1, Line 10: much more
            : slower
Remove


http://gerrit.cloudera.org:8080/#/c/13024/1//COMMIT_MSG@11
PS1, Line 11:  CLI tool
the CLI


http://gerrit.cloudera.org:8080/#/c/13024/1//COMMIT_MSG@11
PS1, Line 11: IDCs
What's this stand for? I____ Data Center?


http://gerrit.cloudera.org:8080/#/c/13024/1//COMMIT_MSG@11
PS1, Line 11: clusters
the cluster


http://gerrit.cloudera.org:8080/#/c/13024/1//COMMIT_MSG@12
PS1, Line 12: concurrency
concurrent


http://gerrit.cloudera.org:8080/#/c/13024/1//COMMIT_MSG@12
PS1, Line 12: masters
master


http://gerrit.cloudera.org:8080/#/c/13024/1//COMMIT_MSG@12
PS1, Line 12: tables
table


http://gerrit.cloudera.org:8080/#/c/13024/1//COMMIT_MSG@12
PS1, Line 12: to fetch
when fetching


http://gerrit.cloudera.org:8080/#/c/13024/1/src/kudu/tools/ksck.h
File src/kudu/tools/ksck.h:

http://gerrit.cloudera.org:8080/#/c/13024/1/src/kudu/tools/ksck.h@423
PS1, Line 423: of
in


http://gerrit.cloudera.org:8080/#/c/13024/1/src/kudu/tools/ksck.cc
File src/kudu/tools/ksck.cc:

http://gerrit.cloudera.org:8080/#/c/13024/1/src/kudu/tools/ksck.cc@60
PS1, Line 60: the same count with the "
            :              "destination instances (masters, tservers or tables) will be created when "
            :              "it's less than or equal to 0.
I don't understand this part.


http://gerrit.cloudera.org:8080/#/c/13024/1/src/kudu/tools/ksck.cc@164
PS1, Line 164: CHECK_GT(num_masters, 0);
I think returning a Status::NotFound is appropriate here, rather than a CHECK failure, unless you explain why num_masters > 0 is an invariant here.


http://gerrit.cloudera.org:8080/#/c/13024/1/src/kudu/tools/ksck.cc@337
PS1, Line 337: servers_count
At some point in the future this could be in the hundreds or thousands. I think we ought to set some reasonable default upper limit. The current number of 20 seems reasonable but if you wanted to bump it up to 30 or 40 I think that'd be fine.


http://gerrit.cloudera.org:8080/#/c/13024/1/src/kudu/tools/ksck_remote.cc
File src/kudu/tools/ksck_remote.cc:

http://gerrit.cloudera.org:8080/#/c/13024/1/src/kudu/tools/ksck_remote.cc@505
PS1, Line 505:   int num_tables = static_cast<int>(table_names.size());
             :   if (num_tables == 0) {
             :     return Status::NotFound("No tables found");
             :   }
Preserve the previous behavior of returning OK if there's no tables-- it's intended.


http://gerrit.cloudera.org:8080/#/c/13024/1/src/kudu/tools/ksck_remote.cc@513
PS1, Line 513: num_tables
This could be in the thousands. I think we need a reasonable default, like the 20 we had before for fetching from tablet servers.


http://gerrit.cloudera.org:8080/#/c/13024/1/src/kudu/tools/ksck_remote.cc@542
PS1, Line 542: if (bad_tables.Load() > 0) {
             :     return Status::NetworkError(
             :         Substitute("failed to gather info from all tables: $0 of $1 had errors",
             :                    bad_tables.Load(), num_tables));
             :   }
We need to provide at least one status from a failed OpenTable, too, so a user has some clue as to what went wrong opening tables. I think it'd be sufficient to log the status at error level.


http://gerrit.cloudera.org:8080/#/c/13024/1/src/kudu/tools/ksck_remote.cc@552
PS1, Line 552:   int num_tables = static_cast<int>(tables().size());
             :   if (num_tables == 0) {
             :     return Status::NotFound("No tables found");
             :   }
Same. This is an expected and non-error condition, so return OK.


http://gerrit.cloudera.org:8080/#/c/13024/1/src/kudu/tools/ksck_remote.cc@560
PS1, Line 560: num_tables
Again I think this will be too big for large clusters, creating possibly thousands of threads.



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2f3f0e3f5115a46dd3afc83dda75e7241618eea4
Gerrit-Change-Number: 13024
Gerrit-PatchSet: 1
Gerrit-Owner: Yingchun Lai <40...@qq.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Comment-Date: Tue, 16 Apr 2019 19:14:02 +0000
Gerrit-HasComments: Yes

[kudu-CR] [ksck] Make ksck tool more concurrent

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

Change subject: [ksck] Make ksck tool more concurrent
......................................................................


Patch Set 7: Code-Review+2


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2f3f0e3f5115a46dd3afc83dda75e7241618eea4
Gerrit-Change-Number: 13024
Gerrit-PatchSet: 7
Gerrit-Owner: Yingchun Lai <40...@qq.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Reviewer: Yingchun Lai <40...@qq.com>
Gerrit-Comment-Date: Fri, 19 Apr 2019 16:42:38 +0000
Gerrit-HasComments: No

[kudu-CR] [ksck] Make ksck tool more concurrent

Posted by "Yingchun Lai (Code Review)" <ge...@cloudera.org>.
Hello Will Berkeley, Kudu Jenkins, Adar Dembo, 

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

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

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

Change subject: [ksck] Make ksck tool more concurrent
......................................................................

[ksck] Make ksck tool more concurrent

Though ksck fetches tserver info concurrently now, it's still slow when
fetching info from clusters that have thousands of tables when the CLI
and the cluster are in different regions.
This patch make it more concurrent when fetching master info and table
info.

Change-Id: I2f3f0e3f5115a46dd3afc83dda75e7241618eea4
---
M src/kudu/tools/ksck-test.cc
M src/kudu/tools/ksck.cc
M src/kudu/tools/ksck.h
M src/kudu/tools/ksck_remote.cc
M src/kudu/tools/ksck_remote.h
M src/kudu/tools/tool_action_cluster.cc
6 files changed, 191 insertions(+), 109 deletions(-)


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I2f3f0e3f5115a46dd3afc83dda75e7241618eea4
Gerrit-Change-Number: 13024
Gerrit-PatchSet: 7
Gerrit-Owner: Yingchun Lai <40...@qq.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Reviewer: Yingchun Lai <40...@qq.com>

[kudu-CR] [ksck] Make ksck tool more concurrent

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

Change subject: [ksck] Make ksck tool more concurrent
......................................................................


Patch Set 4:

(2 comments)

The test failures look legitimate.

http://gerrit.cloudera.org:8080/#/c/13024/4/src/kudu/tools/ksck.cc
File src/kudu/tools/ksck.cc:

http://gerrit.cloudera.org:8080/#/c/13024/4/src/kudu/tools/ksck.cc@166
PS4, Line 166:   RETURN_NOT_OK(ThreadPoolBuilder("ksck-fetch")
             :                 .set_max_threads(FLAGS_fetch_info_concurrency > 0 ?
             :                     FLAGS_fetch_info_concurrency : num_masters)
             :                 .set_idle_timeout(MonoDelta::FromMilliseconds(10))
             :                 .Build(&pool_));
Why do this here and not in the constructor?


http://gerrit.cloudera.org:8080/#/c/13024/4/src/kudu/tools/ksck_remote.cc
File src/kudu/tools/ksck_remote.cc:

http://gerrit.cloudera.org:8080/#/c/13024/4/src/kudu/tools/ksck_remote.cc@512
PS4, Line 512:   RETURN_NOT_OK(ThreadPoolBuilder("RetrieveTablesList")
             :                     .set_max_threads(FLAGS_fetch_info_concurrency)
             :                     .set_idle_timeout(MonoDelta::FromMilliseconds(10))
             :                     .Build(&pool_));
Likewise, this seems better placed in the RemoteKsckCluster constructor.



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2f3f0e3f5115a46dd3afc83dda75e7241618eea4
Gerrit-Change-Number: 13024
Gerrit-PatchSet: 4
Gerrit-Owner: Yingchun Lai <40...@qq.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Reviewer: Yingchun Lai <40...@qq.com>
Gerrit-Comment-Date: Thu, 18 Apr 2019 04:20:10 +0000
Gerrit-HasComments: Yes

[kudu-CR] [ksck] Make ksck tool more concurrent

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

Change subject: [ksck] Make ksck tool more concurrent
......................................................................


Patch Set 6:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/13024/6/src/kudu/tools/ksck.cc
File src/kudu/tools/ksck.cc:

http://gerrit.cloudera.org:8080/#/c/13024/6/src/kudu/tools/ksck.cc@340
PS6, Line 340:     CHECK_OK(pool_->SubmitFunc([&]() {
Can be RETURN_NOT_OK.


http://gerrit.cloudera.org:8080/#/c/13024/6/src/kudu/tools/ksck.cc@373
PS6, Line 373:             results_.warning_messages.push_back(s.CloneAndPrepend(Substitute(
This needs to acquire tablet_server_summaries_lock as well, so that multiple threads don't corrupt results_.warning_messages.


http://gerrit.cloudera.org:8080/#/c/13024/6/src/kudu/tools/ksck_remote.cc
File src/kudu/tools/ksck_remote.cc:

http://gerrit.cloudera.org:8080/#/c/13024/6/src/kudu/tools/ksck_remote.cc@534
PS6, Line 534:         std::lock_guard<simple_spinlock> l(tables_lock);
Why do you need to acquire this? I don't think table_name access needs to be synchronized; there's no concurrent writer.



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2f3f0e3f5115a46dd3afc83dda75e7241618eea4
Gerrit-Change-Number: 13024
Gerrit-PatchSet: 6
Gerrit-Owner: Yingchun Lai <40...@qq.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Will Berkeley <wd...@gmail.com>
Gerrit-Reviewer: Yingchun Lai <40...@qq.com>
Gerrit-Comment-Date: Fri, 19 Apr 2019 04:27:31 +0000
Gerrit-HasComments: Yes