You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Abhishek Chennaka (Code Review)" <ge...@cloudera.org> on 2021/03/01 03:59:33 UTC

[kudu-CR] KUDU-3226 Validate List of Masters for kudu ksck

Abhishek Chennaka has uploaded this change for review. ( http://gerrit.cloudera.org:8080/17141


Change subject: KUDU-3226 Validate List of Masters for kudu ksck
......................................................................

KUDU-3226 Validate List of Masters for kudu ksck

This patch checks for duplicate kudu masters reported in kudu cluster
ksck/rebalance commands. It only does a string comparision check to
detect and report all the duplicate master(/s). If a user provides the
IP address and hostname of the same master, it won't be able to catch
the duplicates. That seems more of a deliberate attempt rather than a
common mistake a user could make and hence not considering that case.

Also wrote a simple test case to test this functionality. Decided not
to spin up a test cluster for this as this is more of client side check
and a master is not actually contacted.

Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
---
M src/kudu/tools/kudu-tool-test.cc
M src/kudu/tools/tool_action_common.cc
2 files changed, 28 insertions(+), 1 deletion(-)



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
Gerrit-Change-Number: 17141
Gerrit-PatchSet: 1
Gerrit-Owner: Abhishek Chennaka <ac...@cloudera.com>

[kudu-CR] [tool] KUDU-3226 Validate List of Masters kudu ksck

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

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

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

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

Change subject: [tool] KUDU-3226 Validate List of Masters kudu ksck
......................................................................

[tool] KUDU-3226 Validate List of Masters kudu ksck

This patch checks for duplicate kudu masters provided in all of the
kudu command line tools which call ParseMasterAddresses(). Currently
ksck and rebalance (as rebalance calls ksck internally) are the only
commands which throw the reported stack trace as ksck constructs a
map internally for the kudu masters and bombs once it sees duplicate
UUIDs. Other commands do not report any issue currently with duplicate
masters.

The patch only does a string comparison check to detect and report all
the duplicate master(/s). If a user provides the IP address and hostname
of the same master, it won't be able to catch the duplicates. That
seems more of a deliberate attempt rather than a common mistake a user
could make and hence not considering that case.

Also wrote a simple test case to test this functionality. Decided not
to spin up a test cluster for this as this is more of client side check
and a master is not actually contacted.

This change got conflicted with another test i.e.
AdminCliTest.TestAuthzResetCacheIncorrectMasterAddressList. Updated this
test as well to by creating a new external mini cluster with three
masters and running the command in the test with just one master

Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
---
M src/kudu/tools/kudu-admin-test.cc
M src/kudu/tools/kudu-tool-test.cc
M src/kudu/tools/tool_action_common.cc
3 files changed, 43 insertions(+), 10 deletions(-)


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
Gerrit-Change-Number: 17141
Gerrit-PatchSet: 7
Gerrit-Owner: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [tool] KUDU-3226 Validate List of Masters kudu ksck

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

Change subject: [tool] KUDU-3226 Validate List of Masters kudu ksck
......................................................................


Patch Set 8: Verified+1 Code-Review+2


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
Gerrit-Change-Number: 17141
Gerrit-PatchSet: 8
Gerrit-Owner: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Thu, 11 Mar 2021 18:33:25 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-3226 Validate List of Masters for the tool kudu cluster ksck

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

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

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

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

Change subject: KUDU-3226 Validate List of Masters for the tool kudu cluster ksck
......................................................................

KUDU-3226 Validate List of Masters for the tool kudu cluster ksck

This patch checks for duplicate kudu masters provided in kudu cluster
ksck/rebalance commands. It only does a string comparison check to
detect and report all the duplicate master(/s). If a user provides the
IP address and hostname of the same master, it won't be able to catch
the duplicates. That seems more of a deliberate attempt rather than a
common mistake a user could make and hence not considering that case.

Also wrote a simple test case to test this functionality. Decided not
to spin up a test cluster for this as this is more of client side check
and a master is not actually contacted.

This change got conflicted with another test i.e.
AdminCliTest.TestAuthzResetCacheIncorrectMasterAddressList. Updated this
test as well to by creating a new external mini cluster with three
masters and running the command in the test with just one master

Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
---
M src/kudu/tools/kudu-admin-test.cc
M src/kudu/tools/kudu-tool-test.cc
M src/kudu/tools/tool_action_common.cc
3 files changed, 41 insertions(+), 10 deletions(-)


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
Gerrit-Change-Number: 17141
Gerrit-PatchSet: 4
Gerrit-Owner: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [tool] KUDU-3226 Validate List of Masters kudu ksck

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

Change subject: [tool] KUDU-3226 Validate List of Masters kudu ksck
......................................................................


Patch Set 8: Code-Review+1

Agree with Bankim's nits, otherwise, it looks good.


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
Gerrit-Change-Number: 17141
Gerrit-PatchSet: 8
Gerrit-Owner: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Thu, 11 Mar 2021 20:46:06 +0000
Gerrit-HasComments: No

[kudu-CR] [tool] KUDU-3226 Validate List of Masters kudu ksck

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

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

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

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

Change subject: [tool] KUDU-3226 Validate List of Masters kudu ksck
......................................................................

[tool] KUDU-3226 Validate List of Masters kudu ksck

This patch checks for duplicate kudu masters provided in all of the
kudu command line tools which call ParseMasterAddresses(). Currently
ksck and rebalance (as rebalance calls ksck internally) are the only
commands which throw the reported stack trace as ksck constructs a
map internally for the kudu masters and bombs once it sees duplicate
UUIDs. Other commands do not report any issue currently with duplicate
masters.

The patch only does a string comparison check to detect and report all
the duplicate master(/s). If a user provides the IP address and hostname
of the same master, it won't be able to catch the duplicates. That
seems more of a deliberate attempt rather than a common mistake a user
could make and hence not considering that case.

Also wrote a simple test case to test this functionality. Decided not
to spin up a test cluster for this as this is more of client side check
and a master is not actually contacted.

This change got conflicted with another test i.e.
AdminCliTest.TestAuthzResetCacheIncorrectMasterAddressList. Updated this
test as well to by creating a new external mini cluster with three
masters and running the command in the test with just one master

Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
---
M src/kudu/tools/kudu-admin-test.cc
M src/kudu/tools/kudu-tool-test.cc
M src/kudu/tools/tool_action_common.cc
3 files changed, 43 insertions(+), 10 deletions(-)


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
Gerrit-Change-Number: 17141
Gerrit-PatchSet: 8
Gerrit-Owner: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [tool] KUDU-3226 Validate List of Masters kudu ksck

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

Change subject: [tool] KUDU-3226 Validate List of Masters kudu ksck
......................................................................


Patch Set 8:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/17141/7/src/kudu/tools/tool_action_common.cc
File src/kudu/tools/tool_action_common.cc:

http://gerrit.cloudera.org:8080/#/c/17141/7/src/kudu/tools/tool_action_common.cc@665
PS7, Line 665: 
> Nit: delimiting by a comma will be preferred.
+1


http://gerrit.cloudera.org:8080/#/c/17141/7/src/kudu/tools/tool_action_common.cc@665
PS7, Line 665:     string dup_masters_str = JoinStrings(duplicate_masters, " ");
             :     return Status::InvalidArgument("Duplicate master addresses specified: " + dup_masters_str);
> Nit: Get rid of the local variable and directly use in InvalidArgument() ca
+1



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
Gerrit-Change-Number: 17141
Gerrit-PatchSet: 8
Gerrit-Owner: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Thu, 11 Mar 2021 18:34:22 +0000
Gerrit-HasComments: Yes

[kudu-CR] [tool] KUDU-3226 Validate List of Masters kudu ksck

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

Change subject: [tool] KUDU-3226 Validate List of Masters kudu ksck
......................................................................


Patch Set 9: Code-Review+2


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
Gerrit-Change-Number: 17141
Gerrit-PatchSet: 9
Gerrit-Owner: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Fri, 12 Mar 2021 05:03:16 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-3226 Validate List of Masters for the tool kudu cluster ksck

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

Change subject: KUDU-3226 Validate List of Masters for the tool kudu cluster ksck
......................................................................


Patch Set 2:

(8 comments)

http://gerrit.cloudera.org:8080/#/c/17141/2//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/17141/2//COMMIT_MSG@9
PS2, Line 9: reported
specified

?


http://gerrit.cloudera.org:8080/#/c/17141/2//COMMIT_MSG@10
PS2, Line 10: comparision
comparison


http://gerrit.cloudera.org:8080/#/c/17141/2//COMMIT_MSG@9
PS2, Line 9: kudu cluster
           : ksck/rebalance
I guess that's true not only for these, but other commands where the list of master addresses is parsed using ParseMasterAddresses() ?


http://gerrit.cloudera.org:8080/#/c/17141/2//COMMIT_MSG@21
PS2, Line 21: Updated this
            : test as well
It seems that change isn't included into PS2:

/home/jenkins-slave/workspace/kudu-master/1/src/kudu/tools/kudu-admin-test.cc:2260
Value of: err
Expected: has substring "Invalid argument: list of master addresses provided (127.0.185.190:44921,127.0.185.190:44921) does not match the actual cluster configuration (127.0.185.190:44921)"


http://gerrit.cloudera.org:8080/#/c/17141/2/src/kudu/tools/tool_action_common.cc
File src/kudu/tools/tool_action_common.cc:

http://gerrit.cloudera.org:8080/#/c/17141/2/src/kudu/tools/tool_action_common.cc@654
PS2, Line 654:   //Loop through the master addresses to find the duplicate. If there is no master specified
style nit: add a space after //


http://gerrit.cloudera.org:8080/#/c/17141/2/src/kudu/tools/tool_action_common.cc@656
PS2, Line 656: for (int i = 0; i<master_addresses->size(); i++)
You could use

  for (const auto& address : *master_addresses) {
  }

instead of accessing the element by index.


http://gerrit.cloudera.org:8080/#/c/17141/2/src/kudu/tools/tool_action_common.cc@657
PS2, Line 657: (master_addresses->at(i)).empty()
Is an empty master address allowed at all?


http://gerrit.cloudera.org:8080/#/c/17141/2/src/kudu/tools/tool_action_common.cc@667
PS2, Line 667:  else
nit: don't use 'else' after a return; see https://llvm.org/docs/CodingStandards.html#don-t-use-else-after-a-return



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
Gerrit-Change-Number: 17141
Gerrit-PatchSet: 2
Gerrit-Owner: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Sun, 07 Mar 2021 18:30:45 +0000
Gerrit-HasComments: Yes

[kudu-CR] [tool] KUDU-3226 Validate List of Masters kudu ksck

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

Change subject: [tool] KUDU-3226 Validate List of Masters kudu ksck
......................................................................

[tool] KUDU-3226 Validate List of Masters kudu ksck

This patch checks for duplicate kudu masters provided in all of the
kudu command line tools which call ParseMasterAddresses(). Currently
ksck and rebalance (as rebalance calls ksck internally) are the only
commands which throw the reported stack trace as ksck constructs a
map internally for the kudu masters and bombs once it sees duplicate
UUIDs. Other commands do not report any issue currently with duplicate
masters.

The patch only does a string comparison check to detect and report all
the duplicate master(/s). If a user provides the IP address and hostname
of the same master, it won't be able to catch the duplicates. That
seems more of a deliberate attempt rather than a common mistake a user
could make and hence not considering that case.

Also wrote a simple test case to test this functionality. Decided not
to spin up a test cluster for this as this is more of client side check
and a master is not actually contacted.

This change got conflicted with another test i.e.
AdminCliTest.TestAuthzResetCacheIncorrectMasterAddressList. Updated this
test as well to by creating a new external mini cluster with three
masters and running the command in the test with just one master

Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
Reviewed-on: http://gerrit.cloudera.org:8080/17141
Reviewed-by: Alexey Serbin <as...@cloudera.com>
Tested-by: Kudu Jenkins
Reviewed-by: Andrew Wong <aw...@cloudera.com>
---
M src/kudu/tools/kudu-admin-test.cc
M src/kudu/tools/kudu-tool-test.cc
M src/kudu/tools/tool_action_common.cc
3 files changed, 43 insertions(+), 10 deletions(-)

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

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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
Gerrit-Change-Number: 17141
Gerrit-PatchSet: 10
Gerrit-Owner: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] KUDU-3226 Validate List of Masters for the tool kudu cluster ksck

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

Change subject: KUDU-3226 Validate List of Masters for the tool kudu cluster ksck
......................................................................


Patch Set 3:

(8 comments)

http://gerrit.cloudera.org:8080/#/c/17141/2//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/17141/2//COMMIT_MSG@9
PS2, Line 9: provided
> specified
Done


http://gerrit.cloudera.org:8080/#/c/17141/2//COMMIT_MSG@10
PS2, Line 10: comparison 
> comparison
Done


http://gerrit.cloudera.org:8080/#/c/17141/2//COMMIT_MSG@9
PS2, Line 9: kudu cluster
           : ksck/rebalance
> I guess that's true not only for these, but other commands where the list o
That is correct. But I manually tried all the commands which have masters to be specified and appears it is just the ksck/rebalance are the ones calling PaserMasterAddresses().


http://gerrit.cloudera.org:8080/#/c/17141/2//COMMIT_MSG@21
PS2, Line 21: Updated this
            : test as well
> It seems that change isn't included into PS2:
Patch set 2 did not have any changes, my bad. Patch set 3 is the one which is supposed to have all the changes done. Just pushed it


http://gerrit.cloudera.org:8080/#/c/17141/2/src/kudu/tools/tool_action_common.cc
File src/kudu/tools/tool_action_common.cc:

http://gerrit.cloudera.org:8080/#/c/17141/2/src/kudu/tools/tool_action_common.cc@654
PS2, Line 654:   //Loop through the master addresses to find the duplicate. If there is no master specified
> style nit: add a space after //
Done


http://gerrit.cloudera.org:8080/#/c/17141/2/src/kudu/tools/tool_action_common.cc@656
PS2, Line 656: for (const auto& master : master_addresses_local
> You could use
Done


http://gerrit.cloudera.org:8080/#/c/17141/2/src/kudu/tools/tool_action_common.cc@657
PS2, Line 657: master.empty())
> Is an empty master address allowed at all?
No it isn't, that is caught in the later in the code flow. Just did not want to report/detect empty masters as duplicate here


http://gerrit.cloudera.org:8080/#/c/17141/2/src/kudu/tools/tool_action_common.cc@667
PS2, Line 667:  retu
> nit: don't use 'else' after a return; see https://llvm.org/docs/CodingStand
Done



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
Gerrit-Change-Number: 17141
Gerrit-PatchSet: 3
Gerrit-Owner: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Mon, 08 Mar 2021 22:41:21 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-3226 Validate List of Masters for kudu ksck

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

Change subject: KUDU-3226 Validate List of Masters for kudu ksck
......................................................................


Patch Set 1:

(3 comments)

Thanks for the patch Abhishek!

Looks like you'll also need to update AdminCliTest.TestAuthzResetCacheIncorrectMasterAddressList in kudu-admin-test.cc to account for the new error message.

Also, if you scroll down to the bottom of http://jenkins.kudu.apache.org/job/kudu-gerrit/23429/BUILD_TYPE=LINT/console, there are a few updates the Kudu linter would like you to make

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

http://gerrit.cloudera.org:8080/#/c/17141/1/src/kudu/tools/tool_action_common.cc@652
PS1, Line 652: std::
nit: because of the 'using' declarations around L200, this can just be unordered_set<string> and string below


http://gerrit.cloudera.org:8080/#/c/17141/1/src/kudu/tools/tool_action_common.cc@659
PS1, Line 659: unique_masters.find(master_addresses->at(i)) != unique_masters.end()
nit: you can use the ContainsKey() function from gutil/map-util.h


http://gerrit.cloudera.org:8080/#/c/17141/1/src/kudu/tools/tool_action_common.cc@656
PS1, Line 656:   for (int i = 0; i<master_addresses->size(); i++){
             :     if ((master_addresses->at(i)).empty())
             :       continue;
             :     if (unique_masters.find(master_addresses->at(i)) != unique_masters.end()){
             :       duplicate_masters = duplicate_masters.append(master_addresses->at(i))+" ";
             :     }
             :     else
             :       unique_masters.insert(master_addresses->at(i));
             :   }
> It's best to not modify out parameter master_addresses unless we are certai
+1

nit: as well, we generally follow the Google Style Guide, which suggests consistent usage of curly braces for if/else statements: 

https://google.github.io/styleguide/cppguide.html#Conditionals

Same elsewhere.



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
Gerrit-Change-Number: 17141
Gerrit-PatchSet: 1
Gerrit-Owner: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Tue, 02 Mar 2021 02:15:18 +0000
Gerrit-HasComments: Yes

[kudu-CR] [tool] KUDU-3226 Validate List of Masters kudu ksck

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

Change subject: [tool] KUDU-3226 Validate List of Masters kudu ksck
......................................................................


Patch Set 6:

(9 comments)

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

http://gerrit.cloudera.org:8080/#/c/17141/5/src/kudu/tools/kudu-tool-test.cc@6103
PS5, Line 6103: //
> nit: here and elsewhere with comments, add a space after the //, as is used
Done


http://gerrit.cloudera.org:8080/#/c/17141/5/src/kudu/tools/kudu-tool-test.cc@6107
PS5, Line 6107: ())
> nit: it's probably a good habit to build to start using curly braces for th
Done


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

http://gerrit.cloudera.org:8080/#/c/17141/1/src/kudu/tools/tool_action_common.cc@652
PS1, Line 652: std::
> I don't see this update in PS5?
Looks like an error on my side. Fixed it now


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

http://gerrit.cloudera.org:8080/#/c/17141/5/src/kudu/tools/tool_action_common.cc@653
PS5, Line 653: std::
> nit: don't need the std:: here either.
Done


http://gerrit.cloudera.org:8080/#/c/17141/5/src/kudu/tools/tool_action_common.cc@654
PS5, Line 654: / Loop through the master addresses to find the duplicate. If there is no master specified
             :   // 
> nit: same here with regards to adding a space after //.
Done


http://gerrit.cloudera.org:8080/#/c/17141/5/src/kudu/tools/tool_action_common.cc@657
PS5, Line 657:   if (master.empty()) continue;
             :     if (Contain
> Nit: I'm not sure whether it's part of style guide but for "if" if there is
Done


http://gerrit.cloudera.org:8080/#/c/17141/5/src/kudu/tools/tool_action_common.cc@660
PS5, Line 660: 
> > That said, maybe instead keep an unordered_set of duplicated masters and 
Done


http://gerrit.cloudera.org:8080/#/c/17141/5/src/kudu/tools/tool_action_common.cc@660
PS5, Line 660: 
> nit: I don't think it's strictly requested by the GSG, but for the most par
Done


http://gerrit.cloudera.org:8080/#/c/17141/5/src/kudu/tools/tool_action_common.cc@665
PS5, Line 665:     return Status::InvalidArgument("Duplicate master addresses specified: " + JoinStrings(duplicate_masters, " "));
             :   }
             :   *master_addresses = std::move(master_addresses_local);
> Same as above about either using braces {} for "if" if the stmt is on next 
Done



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
Gerrit-Change-Number: 17141
Gerrit-PatchSet: 6
Gerrit-Owner: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Thu, 11 Mar 2021 08:15:48 +0000
Gerrit-HasComments: Yes

[kudu-CR] [tool] KUDU-3226 Validate List of Masters kudu ksck

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

Change subject: [tool] KUDU-3226 Validate List of Masters kudu ksck
......................................................................


Patch Set 9: Code-Review+2


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
Gerrit-Change-Number: 17141
Gerrit-PatchSet: 9
Gerrit-Owner: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Fri, 12 Mar 2021 05:28:47 +0000
Gerrit-HasComments: No

[kudu-CR] [tool] KUDU-3226 Validate List of Masters kudu ksck

Posted by "Andrew Wong (Code Review)" <ge...@cloudera.org>.
Andrew Wong has removed a vote on this change.

Change subject: [tool] KUDU-3226 Validate List of Masters kudu ksck
......................................................................


Removed Verified-1 by Kudu Jenkins (120)
-- 
To view, visit http://gerrit.cloudera.org:8080/17141
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: deleteVote
Gerrit-Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
Gerrit-Change-Number: 17141
Gerrit-PatchSet: 8
Gerrit-Owner: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] KUDU-3226 Validate List of Masters for the tool kudu cluster ksck

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

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

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

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

Change subject: KUDU-3226 Validate List of Masters for the tool kudu cluster ksck
......................................................................

KUDU-3226 Validate List of Masters for the tool kudu cluster ksck

This patch checks for duplicate kudu masters provided in kudu cluster
ksck/rebalance commands. It only does a string comparison check to
detect and report all the duplicate master(/s). If a user provides the
IP address and hostname of the same master, it won't be able to catch
the duplicates. That seems more of a deliberate attempt rather than a
common mistake a user could make and hence not considering that case.

Also wrote a simple test case to test this functionality. Decided not
to spin up a test cluster for this as this is more of client side check
and a master is not actually contacted.

This change got conflicted with another test i.e.
AdminCliTest.TestAuthzResetCacheIncorrectMasterAddressList. Updated this
test as well to by creating a new external mini cluster with three
masters and running the command in the test with just one master

Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
---
M src/kudu/tools/kudu-admin-test.cc
M src/kudu/tools/kudu-tool-test.cc
M src/kudu/tools/tool_action_common.cc
3 files changed, 40 insertions(+), 9 deletions(-)


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
Gerrit-Change-Number: 17141
Gerrit-PatchSet: 3
Gerrit-Owner: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] KUDU-3226 Validate List of Masters for kudu ksck

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

Change subject: KUDU-3226 Validate List of Masters for kudu ksck
......................................................................


Patch Set 1:

(7 comments)

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

http://gerrit.cloudera.org:8080/#/c/17141/1//COMMIT_MSG@7
PS1, Line 7: KUDU-3226 Validate List of Masters for kudu ksck
To provide context, we also include the component. In this case [tool]


http://gerrit.cloudera.org:8080/#/c/17141/1//COMMIT_MSG@9
PS1, Line 9: This patch checks for duplicate kudu masters reported in kudu cluster
           : ksck/rebalance commands.
So this change is basically validating the input to ksck/rebalance command in the tool itself before invoking the RPC to the master/tserver, right?
What happens currently without this change?


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

http://gerrit.cloudera.org:8080/#/c/17141/1/src/kudu/tools/kudu-tool-test.cc@6103
PS1, Line 6103: //Execute a ksck giving the hostname of the local machine twice
              : //and it should report the duplicates found.
Nit: space after //


http://gerrit.cloudera.org:8080/#/c/17141/1/src/kudu/tools/kudu-tool-test.cc@6107
PS1, Line 6107:   if (!GetHostname(&master_addr).ok())
              :     master_addr = "<unknown_host>";
It'd be better to use ASSERT_OK() and fail the test here in that case. Because you can't really proceed with "<unknown_host>".


http://gerrit.cloudera.org:8080/#/c/17141/1/src/kudu/tools/kudu-tool-test.cc@6110
PS1, Line 6110: Substitute("cluster ksck $0,$0", master_addr)
Nit: For sake of readability it'd be good to put this in a separate line.
Also it'd be good to capture the status explicitly so that we can print the error in case the assertion is negative.
string cmd = Substitute("cluster ksck $0,$0", master_addr);
Status s = RunActionStderrString(cmd, &out);
ASSERT_TRUE(s.IsRuntimeError()) << s.ToString();


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

http://gerrit.cloudera.org:8080/#/c/17141/1/src/kudu/tools/tool_action_common.cc@656
PS1, Line 656:   for (int i = 0; i<master_addresses->size(); i++){
             :     if ((master_addresses->at(i)).empty())
             :       continue;
             :     if (unique_masters.find(master_addresses->at(i)) != unique_masters.end()){
             :       duplicate_masters = duplicate_masters.append(master_addresses->at(i))+" ";
             :     }
             :     else
             :       unique_masters.insert(master_addresses->at(i));
             :   }
It's best to not modify out parameter master_addresses unless we are certain about success and then move the local master addresses to out parameter.

It's better to use the for range loop.
for (const auto& master : master_addresses)

No need to populate the duplicate_masters string unless duplicates are detected which can be concatenated using strings:Join function.


http://gerrit.cloudera.org:8080/#/c/17141/1/src/kudu/tools/tool_action_common.cc@667
PS1, Line 667: else
No else clause if there is a return above.



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
Gerrit-Change-Number: 17141
Gerrit-PatchSet: 1
Gerrit-Owner: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Mon, 01 Mar 2021 17:46:42 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-3226 Validate List of Masters for the tool kudu cluster ksck

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

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

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

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

Change subject: KUDU-3226 Validate List of Masters for the tool kudu cluster ksck
......................................................................

KUDU-3226 Validate List of Masters for the tool kudu cluster ksck

This patch checks for duplicate kudu masters provided in kudu cluster
ksck/rebalance commands. It only does a string comparison check to
detect and report all the duplicate master(/s). If a user provides the
IP address and hostname of the same master, it won't be able to catch
the duplicates. That seems more of a deliberate attempt rather than a
common mistake a user could make and hence not considering that case.

Also wrote a simple test case to test this functionality. Decided not
to spin up a test cluster for this as this is more of client side check
and a master is not actually contacted.

This change got conflicted with another test i.e.
AdminCliTest.TestAuthzResetCacheIncorrectMasterAddressList. Updated this
test as well to by creating a new external mini cluster with three
masters and running the command in the test with just one master

Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
---
M src/kudu/tools/kudu-admin-test.cc
M src/kudu/tools/kudu-tool-test.cc
M src/kudu/tools/tool_action_common.cc
3 files changed, 41 insertions(+), 9 deletions(-)


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
Gerrit-Change-Number: 17141
Gerrit-PatchSet: 5
Gerrit-Owner: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [tool] KUDU-3226 Validate List of Masters kudu ksck

Posted by "Andrew Wong (Code Review)" <ge...@cloudera.org>.
Andrew Wong has removed a vote on this change.

Change subject: [tool] KUDU-3226 Validate List of Masters kudu ksck
......................................................................


Removed Code-Review+2 by Andrew Wong <aw...@cloudera.com>
-- 
To view, visit http://gerrit.cloudera.org:8080/17141
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: deleteVote
Gerrit-Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
Gerrit-Change-Number: 17141
Gerrit-PatchSet: 8
Gerrit-Owner: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] KUDU-3226 Validate List of Masters for the tool kudu cluster ksck

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

Change subject: KUDU-3226 Validate List of Masters for the tool kudu cluster ksck
......................................................................


Patch Set 5:

(7 comments)

Overall looks good, just more style nits.

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

http://gerrit.cloudera.org:8080/#/c/17141/1//COMMIT_MSG@7
PS1, Line 7: KUDU-3226 Validate List of Masters for the tool 
> This was the Jira number and the Subject of the Jira. I will include more c
nit: actually this meant something like

[tool] KUDU-3226: Validate list of masters for ksck

Look through https://github.com/apache/kudu/commits/master for more examples


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

http://gerrit.cloudera.org:8080/#/c/17141/5/src/kudu/tools/kudu-tool-test.cc@6103
PS5, Line 6103: //
nit: here and elsewhere with comments, add a space after the //, as is used throughout the codebase


http://gerrit.cloudera.org:8080/#/c/17141/5/src/kudu/tools/kudu-tool-test.cc@6107
PS5, Line 6107: ())
nit: it's probably a good habit to build to start using curly braces for these code blocks, even though they're not strictly necessary for one-liners.

The GSG allows this for historical reasons, but with some caveats https://google.github.io/styleguide/cppguide.html#Conditionals


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

http://gerrit.cloudera.org:8080/#/c/17141/1/src/kudu/tools/tool_action_common.cc@652
PS1, Line 652: std::
> Done
I don't see this update in PS5?


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

http://gerrit.cloudera.org:8080/#/c/17141/5/src/kudu/tools/tool_action_common.cc@653
PS5, Line 653: std::
nit: don't need the std:: here either.


http://gerrit.cloudera.org:8080/#/c/17141/5/src/kudu/tools/tool_action_common.cc@654
PS5, Line 654: /Loop through the master addresses to find the duplicate. If there is no master specified
             :   //d
nit: same here with regards to adding a space after //.


http://gerrit.cloudera.org:8080/#/c/17141/5/src/kudu/tools/tool_action_common.cc@660
PS5, Line 660: er)+" 
nit: I don't think it's strictly requested by the GSG, but for the most part, we typically add spaces between operators. I.e.

duplicate_masters.append(master) + " ";

That said, maybe instead keep an unordered_set of duplicated masters and output that via JoinStrings()? (see gutil/strings/join.h)



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
Gerrit-Change-Number: 17141
Gerrit-PatchSet: 5
Gerrit-Owner: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 10 Mar 2021 01:08:21 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-3226 Validate List of Masters for the tool kudu cluster ksck

Posted by "Abhishek Chennaka (Code Review)" <ge...@cloudera.org>.
Hello Attila Bukor, Kudu Jenkins, Andrew Wong, Grant Henke, Bankim Bhavsar, 

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

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

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

Change subject: KUDU-3226 Validate List of Masters for the tool kudu cluster ksck
......................................................................

KUDU-3226 Validate List of Masters for the tool kudu cluster ksck

This patch checks for duplicate kudu masters reported in kudu cluster
ksck/rebalance commands. It only does a string comparision check to
detect and report all the duplicate master(/s). If a user provides the
IP address and hostname of the same master, it won't be able to catch
the duplicates. That seems more of a deliberate attempt rather than a
common mistake a user could make and hence not considering that case.

Also wrote a simple test case to test this functionality. Decided not
to spin up a test cluster for this as this is more of client side check
and a master is not actually contacted.

This change got conflicted with another test i.e.
AdminCliTest.TestAuthzResetCacheIncorrectMasterAddressList. Updated this
test as well to by creating a new external mini cluster with three
masters and running the command in the test with just one master

Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
---
M src/kudu/tools/kudu-tool-test.cc
M src/kudu/tools/tool_action_common.cc
2 files changed, 28 insertions(+), 1 deletion(-)


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
Gerrit-Change-Number: 17141
Gerrit-PatchSet: 2
Gerrit-Owner: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [tool] KUDU-3226 Validate List of Masters kudu ksck

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

Change subject: [tool] KUDU-3226 Validate List of Masters kudu ksck
......................................................................


Patch Set 8: Code-Review+2

LGTM.  Please address the nits pointed by Bankim.


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
Gerrit-Change-Number: 17141
Gerrit-PatchSet: 8
Gerrit-Owner: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Fri, 12 Mar 2021 00:30:09 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-3226 Validate List of Masters for the tool kudu cluster ksck

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

Change subject: KUDU-3226 Validate List of Masters for the tool kudu cluster ksck
......................................................................


Patch Set 5:

(3 comments)

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

http://gerrit.cloudera.org:8080/#/c/17141/5/src/kudu/tools/tool_action_common.cc@657
PS5, Line 657:   if (master.empty())
             :       continue;
Nit: I'm not sure whether it's part of style guide but for "if" if there is a single stmt and without any braces then the stmt should be on the same single line.
if (master.empty()) continue;


http://gerrit.cloudera.org:8080/#/c/17141/5/src/kudu/tools/tool_action_common.cc@660
PS5, Line 660: er)+" 
> That said, maybe instead keep an unordered_set of duplicated masters and output that via JoinStrings()? (see gutil/strings/join.h)

+1 to above.


http://gerrit.cloudera.org:8080/#/c/17141/5/src/kudu/tools/tool_action_common.cc@665
PS5, Line 665:   if (!duplicate_masters.empty())
             :     return Status::InvalidArgument("Duplicate master addresses specified: " + duplicate_masters);
             :   *master_addresses = std::move(master_addresses_local);
Same as above about either using braces {} for "if" if the stmt is on next line.
Else it can cause confusion whether the L667 is part of the if stmt or no.



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
Gerrit-Change-Number: 17141
Gerrit-PatchSet: 5
Gerrit-Owner: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 10 Mar 2021 21:54:54 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-3226 Validate List of Masters for the tool kudu cluster ksck

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

Change subject: KUDU-3226 Validate List of Masters for the tool kudu cluster ksck
......................................................................


Patch Set 5:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/17141/2//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/17141/2//COMMIT_MSG@9
PS2, Line 9: kudu cluster
           : ksck/rebalance
> That is correct. But I manually tried all the commands which have masters t
I stand corrected. I tested with the new binary and here are all the modes which are affected (detect duplicate master addresses and report) by this change :
kudu cluster
kudu perf
kudu table
kudu master
kudu tablet
kudu server

The existing binary only kudu cluster mode reports an issue with duplicate master addresses which is because the rebalancer calls ksck internally[1] and ksck constructs a map of kudu masters' UUIDs and finds duplicates [2] and dies. Rest of the modes do not construct a map of the master UUIDs and hence do not die.
[1] https://github.com/apache/kudu/blob/master/src/kudu/tools/rebalancer_tool.cc#L626-L635
[2] https://github.com/apache/kudu/blob/master/src/kudu/tools/ksck.cc#L339-L344



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
Gerrit-Change-Number: 17141
Gerrit-PatchSet: 5
Gerrit-Owner: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Tue, 09 Mar 2021 04:13:24 +0000
Gerrit-HasComments: Yes

[kudu-CR] [tool] KUDU-3226 Validate List of Masters kudu ksck

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

Change subject: [tool] KUDU-3226 Validate List of Masters kudu ksck
......................................................................


Patch Set 10:

Thanks for the patch Abhishek!


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
Gerrit-Change-Number: 17141
Gerrit-PatchSet: 10
Gerrit-Owner: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Fri, 12 Mar 2021 05:29:14 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-3226 Validate List of Masters for kudu ksck

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

Change subject: KUDU-3226 Validate List of Masters for kudu ksck
......................................................................


Patch Set 1:

(10 comments)

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

http://gerrit.cloudera.org:8080/#/c/17141/1//COMMIT_MSG@7
PS1, Line 7: KUDU-3226 Validate List of Masters for kudu ksck
> To provide context, we also include the component. In this case [tool]
This was the Jira number and the Subject of the Jira. I will include more context in it


http://gerrit.cloudera.org:8080/#/c/17141/1//COMMIT_MSG@9
PS1, Line 9: This patch checks for duplicate kudu masters reported in kudu cluster
           : ksck/rebalance commands.
> So this change is basically validating the input to ksck/rebalance command 
It throws the not so meaningful error message with stack trace: EG:
F0111 03:11:14.265851 101976 map-util.h:410] Check failed: InsertIfNotPresent(collection, key, data) duplicate key: 98eea16246634b11bea207c6f397daa4

Check failure stack trace: ***
@ 0x10d392d google::LogMessage::Fail()
@ 0x10d5883 google::LogMessage::SendToLog()
@ 0x10d3489 google::LogMessage::Flush()
@ 0x10d620f google::LogMessageFatal::~LogMessageFatal()
@ 0xc94216 InsertOrDie<>()
@ 0xc8d59b kudu::tools::Ksck::CheckMasterConsensus()
@ 0xc90583 kudu::tools::Ksck::Run()
@ 0xc9100a kudu::tools::Ksck::RunAndPrintResults()
@ 0xb44981 kudu::tools::(anonymous namespace)::RunKsck()
@ 0xb46cb4 std::_Function_handler<>::_M_invoke()
@ 0x1129ac2 kudu::tools::Action::Run()
@ 0xbcc027 kudu::tools::DispatchCommand()
@ 0xbcc9eb kudu::tools::RunTool()
@ 0xae595d main
@ 0x7fd165440505 __libc_start_main
@ 0xb40ea1 (unknown)


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

http://gerrit.cloudera.org:8080/#/c/17141/1/src/kudu/tools/kudu-tool-test.cc@6103
PS1, Line 6103: //Execute a ksck giving the hostname of the local machine twice
              : //and it should report the duplicates found.
> Nit: space after //
Done


http://gerrit.cloudera.org:8080/#/c/17141/1/src/kudu/tools/kudu-tool-test.cc@6107
PS1, Line 6107:   if (!GetHostname(&master_addr).ok())
              :     master_addr = "<unknown_host>";
> It'd be better to use ASSERT_OK() and fail the test here in that case. Beca
In the test case ksck is just going to read the string and evaluate. So even the string "<unknown_host>" would be acceptable to run the test case in case the hostname is not returned.


http://gerrit.cloudera.org:8080/#/c/17141/1/src/kudu/tools/kudu-tool-test.cc@6110
PS1, Line 6110: Substitute("cluster ksck $0,$0", master_addr)
> Nit: For sake of readability it'd be good to put this in a separate line.
Done


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

http://gerrit.cloudera.org:8080/#/c/17141/1/src/kudu/tools/tool_action_common.cc@652
PS1, Line 652: std::
> nit: because of the 'using' declarations around L200, this can just be unor
Done


http://gerrit.cloudera.org:8080/#/c/17141/1/src/kudu/tools/tool_action_common.cc@659
PS1, Line 659: unique_masters.find(master_addresses->at(i)) != unique_masters.end()
> nit: you can use the ContainsKey() function from gutil/map-util.h
Suggested by Bankim as well on slack. Done


http://gerrit.cloudera.org:8080/#/c/17141/1/src/kudu/tools/tool_action_common.cc@656
PS1, Line 656:   for (int i = 0; i<master_addresses->size(); i++){
             :     if ((master_addresses->at(i)).empty())
             :       continue;
             :     if (unique_masters.find(master_addresses->at(i)) != unique_masters.end()){
             :       duplicate_masters = duplicate_masters.append(master_addresses->at(i))+" ";
             :     }
             :     else
             :       unique_masters.insert(master_addresses->at(i));
             :   }
> It's best to not modify out parameter master_addresses unless we are certai
Done


http://gerrit.cloudera.org:8080/#/c/17141/1/src/kudu/tools/tool_action_common.cc@656
PS1, Line 656:   for (int i = 0; i<master_addresses->size(); i++){
             :     if ((master_addresses->at(i)).empty())
             :       continue;
             :     if (unique_masters.find(master_addresses->at(i)) != unique_masters.end()){
             :       duplicate_masters = duplicate_masters.append(master_addresses->at(i))+" ";
             :     }
             :     else
             :       unique_masters.insert(master_addresses->at(i));
             :   }
> +1
Done


http://gerrit.cloudera.org:8080/#/c/17141/1/src/kudu/tools/tool_action_common.cc@667
PS1, Line 667: else
> No else clause if there is a return above.
Done



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
Gerrit-Change-Number: 17141
Gerrit-PatchSet: 1
Gerrit-Owner: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 03 Mar 2021 21:34:41 +0000
Gerrit-HasComments: Yes

[kudu-CR] [tool] KUDU-3226 Validate List of Masters kudu ksck

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

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

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

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

Change subject: [tool] KUDU-3226 Validate List of Masters kudu ksck
......................................................................

[tool] KUDU-3226 Validate List of Masters kudu ksck

This patch checks for duplicate kudu masters provided in all of the
kudu command line tools which call ParseMasterAddresses(). Currently
ksck and rebalance (as rebalance calls ksck internally) are the only
commands which throw the reported stack trace as ksck constructs a
map internally for the kudu masters and bombs once it sees duplicate
UUIDs. Other commands do not report any issue currently with duplicate
masters.

The patch only does a string comparison check to detect and report all
the duplicate master(/s). If a user provides the IP address and hostname
of the same master, it won't be able to catch the duplicates. That
seems more of a deliberate attempt rather than a common mistake a user
could make and hence not considering that case.

Also wrote a simple test case to test this functionality. Decided not
to spin up a test cluster for this as this is more of client side check
and a master is not actually contacted.

This change got conflicted with another test i.e.
AdminCliTest.TestAuthzResetCacheIncorrectMasterAddressList. Updated this
test as well to by creating a new external mini cluster with three
masters and running the command in the test with just one master

Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
---
M src/kudu/tools/kudu-admin-test.cc
M src/kudu/tools/kudu-tool-test.cc
M src/kudu/tools/tool_action_common.cc
3 files changed, 42 insertions(+), 9 deletions(-)


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
Gerrit-Change-Number: 17141
Gerrit-PatchSet: 6
Gerrit-Owner: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [tool] KUDU-3226 Validate List of Masters kudu ksck

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

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

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

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

Change subject: [tool] KUDU-3226 Validate List of Masters kudu ksck
......................................................................

[tool] KUDU-3226 Validate List of Masters kudu ksck

This patch checks for duplicate kudu masters provided in all of the
kudu command line tools which call ParseMasterAddresses(). Currently
ksck and rebalance (as rebalance calls ksck internally) are the only
commands which throw the reported stack trace as ksck constructs a
map internally for the kudu masters and bombs once it sees duplicate
UUIDs. Other commands do not report any issue currently with duplicate
masters.

The patch only does a string comparison check to detect and report all
the duplicate master(/s). If a user provides the IP address and hostname
of the same master, it won't be able to catch the duplicates. That
seems more of a deliberate attempt rather than a common mistake a user
could make and hence not considering that case.

Also wrote a simple test case to test this functionality. Decided not
to spin up a test cluster for this as this is more of client side check
and a master is not actually contacted.

This change got conflicted with another test i.e.
AdminCliTest.TestAuthzResetCacheIncorrectMasterAddressList. Updated this
test as well to by creating a new external mini cluster with three
masters and running the command in the test with just one master

Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
---
M src/kudu/tools/kudu-admin-test.cc
M src/kudu/tools/kudu-tool-test.cc
M src/kudu/tools/tool_action_common.cc
3 files changed, 43 insertions(+), 10 deletions(-)


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
Gerrit-Change-Number: 17141
Gerrit-PatchSet: 9
Gerrit-Owner: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [tool] KUDU-3226 Validate List of Masters kudu ksck

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

Change subject: [tool] KUDU-3226 Validate List of Masters kudu ksck
......................................................................


Patch Set 7: Code-Review+2

(2 comments)

Please wait for more comments from Andrew, Alexey.

http://gerrit.cloudera.org:8080/#/c/17141/7/src/kudu/tools/tool_action_common.cc
File src/kudu/tools/tool_action_common.cc:

http://gerrit.cloudera.org:8080/#/c/17141/7/src/kudu/tools/tool_action_common.cc@665
PS7, Line 665: " "
Nit: delimiting by a comma will be preferred.


http://gerrit.cloudera.org:8080/#/c/17141/7/src/kudu/tools/tool_action_common.cc@665
PS7, Line 665:     string duplicate_masters_str = JoinStrings(duplicate_masters, " ");
             :     return Status::InvalidArgument("Duplicate master addresses specified: " + duplicate_masters_str);
Nit: Get rid of the local variable and directly use in InvalidArgument() call.



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2f3b2b7dcf2ac78cb95cf43242651e3ce8fddf6f
Gerrit-Change-Number: 17141
Gerrit-PatchSet: 7
Gerrit-Owner: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Thu, 11 Mar 2021 16:46:56 +0000
Gerrit-HasComments: Yes