You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Bankim Bhavsar (Code Review)" <ge...@cloudera.org> on 2021/02/23 07:05:49 UTC

[kudu-CR] [master] Fix validation for NON VOTER on adding a master

Bankim Bhavsar has uploaded this change for review. ( http://gerrit.cloudera.org:8080/17108


Change subject: [master] Fix validation for NON_VOTER on adding a master
......................................................................

[master] Fix validation for NON_VOTER on adding a master

When a master is added, validation check is made whether
the supplied master is already part of the Raft configuration.
However this check doesn't include NON_VOTER masters and hence
an InvalidArgument error is thrown later by the ChangeConfig
implementation in Raft. "master add" CLI is designed to specifically
catch Status::AlreadyPresent error to allow retries.

This change basically checks for all masters in the committed
Raft config irrespective of the member type on adding a master.

Change-Id: I10e6b3617b032c74ebed4359b10c36b7b365d9b7
---
M src/kudu/master/dynamic_multi_master-test.cc
M src/kudu/master/master.cc
M src/kudu/master/master.h
3 files changed, 27 insertions(+), 7 deletions(-)



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I10e6b3617b032c74ebed4359b10c36b7b365d9b7
Gerrit-Change-Number: 17108
Gerrit-PatchSet: 1
Gerrit-Owner: Bankim Bhavsar <ba...@cloudera.com>

[kudu-CR] [master] Fix validation for NON VOTER on adding a master

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

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

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

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

Change subject: [master] Fix validation for NON_VOTER on adding a master
......................................................................

[master] Fix validation for NON_VOTER on adding a master

When a master is added, validation check is made whether
the supplied master is already part of the Raft configuration.
However this check doesn't include NON_VOTER masters and hence
an InvalidArgument error is thrown later by the ChangeConfig
implementation in Raft. "master add" CLI is designed to specifically
catch Status::AlreadyPresent error to allow retries.

This change basically checks for all masters in the committed
Raft config irrespective of the member type on adding a master.

Change-Id: I10e6b3617b032c74ebed4359b10c36b7b365d9b7
---
M src/kudu/master/dynamic_multi_master-test.cc
M src/kudu/master/master.cc
M src/kudu/master/master.h
3 files changed, 34 insertions(+), 6 deletions(-)


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I10e6b3617b032c74ebed4359b10c36b7b365d9b7
Gerrit-Change-Number: 17108
Gerrit-PatchSet: 2
Gerrit-Owner: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [master] Fix validation for NON VOTER on adding a master

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

Change subject: [master] Fix validation for NON_VOTER on adding a master
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/17108/1/src/kudu/master/master.h
File src/kudu/master/master.h:

http://gerrit.cloudera.org:8080/#/c/17108/1/src/kudu/master/master.h@124
PS1, Line 124:       bool include_all = false,
             :       consensus::RaftPeerPB::MemberType member_type = consensus::RaftPeerPB::VOTER
I don't see it ever used in combination of 'false', 'NON_VOTER'.  Does it make sense to replace these two parameters with one of custom enum type, so the values are:

enum MasterType {
  ALL,
  VOTER_ONLY,
};

where the default stays as 'MasterType::VOTER_ONLY'?



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I10e6b3617b032c74ebed4359b10c36b7b365d9b7
Gerrit-Change-Number: 17108
Gerrit-PatchSet: 1
Gerrit-Owner: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Tue, 23 Feb 2021 07:22:35 +0000
Gerrit-HasComments: Yes

[kudu-CR] [master] Fix validation for NON VOTER on adding a master

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

Change subject: [master] Fix validation for NON_VOTER on adding a master
......................................................................


Patch Set 2: Code-Review+2

(1 comment)

http://gerrit.cloudera.org:8080/#/c/17108/1/src/kudu/master/master.h
File src/kudu/master/master.h:

http://gerrit.cloudera.org:8080/#/c/17108/1/src/kudu/master/master.h@124
PS1, Line 124:   Status GetMasterHostPorts(std::vector<HostPort>* hostports, MasterType type = VOTER_ONLY) const;
             : 
> Okay. I wish though the enums were numbered in powers of 2 to allow OR'ing 
Thanks!

Well, it's possible to assign particular values to the fields of an enumeration, I guess :)



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I10e6b3617b032c74ebed4359b10c36b7b365d9b7
Gerrit-Change-Number: 17108
Gerrit-PatchSet: 2
Gerrit-Owner: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 24 Feb 2021 04:10:14 +0000
Gerrit-HasComments: Yes

[kudu-CR] [master] Fix validation for NON VOTER on adding a master

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

Change subject: [master] Fix validation for NON_VOTER on adding a master
......................................................................

[master] Fix validation for NON_VOTER on adding a master

When a master is added, validation check is made whether
the supplied master is already part of the Raft configuration.
However this check doesn't include NON_VOTER masters and hence
an InvalidArgument error is thrown later by the ChangeConfig
implementation in Raft. "master add" CLI is designed to specifically
catch Status::AlreadyPresent error to allow retries.

This change basically checks for all masters in the committed
Raft config irrespective of the member type on adding a master.

Change-Id: I10e6b3617b032c74ebed4359b10c36b7b365d9b7
Reviewed-on: http://gerrit.cloudera.org:8080/17108
Tested-by: Bankim Bhavsar <ba...@cloudera.com>
Reviewed-by: Alexey Serbin <as...@cloudera.com>
---
M src/kudu/master/dynamic_multi_master-test.cc
M src/kudu/master/master.cc
M src/kudu/master/master.h
3 files changed, 34 insertions(+), 6 deletions(-)

Approvals:
  Bankim Bhavsar: Verified
  Alexey Serbin: Looks good to me, approved

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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I10e6b3617b032c74ebed4359b10c36b7b365d9b7
Gerrit-Change-Number: 17108
Gerrit-PatchSet: 3
Gerrit-Owner: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [master] Fix validation for NON VOTER on adding a master

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

Change subject: [master] Fix validation for NON_VOTER on adding a master
......................................................................


Patch Set 2: Verified+1

Unrelated test failure ConcurrentRebalancersTest.TwoConcurrentRebalancers/1


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I10e6b3617b032c74ebed4359b10c36b7b365d9b7
Gerrit-Change-Number: 17108
Gerrit-PatchSet: 2
Gerrit-Owner: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Tue, 23 Feb 2021 19:18:11 +0000
Gerrit-HasComments: No

[kudu-CR] [master] Fix validation for NON VOTER on adding a master

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

Change subject: [master] Fix validation for NON_VOTER on adding a master
......................................................................


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: deleteVote
Gerrit-Change-Id: I10e6b3617b032c74ebed4359b10c36b7b365d9b7
Gerrit-Change-Number: 17108
Gerrit-PatchSet: 2
Gerrit-Owner: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [master] Fix validation for NON VOTER on adding a master

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

Change subject: [master] Fix validation for NON_VOTER on adding a master
......................................................................


Patch Set 2:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/17108/1/src/kudu/master/master.h
File src/kudu/master/master.h:

http://gerrit.cloudera.org:8080/#/c/17108/1/src/kudu/master/master.h@124
PS1, Line 124:   Status GetMasterHostPorts(std::vector<HostPort>* hostports, MasterType type = VOTER_ONLY) const;
             : 
> I don't see it ever used in combination of 'false', 'NON_VOTER'.  Does it m
Okay. I wish though the enums were numbered in powers of 2 to allow OR'ing them and checking for all.



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I10e6b3617b032c74ebed4359b10c36b7b365d9b7
Gerrit-Change-Number: 17108
Gerrit-PatchSet: 2
Gerrit-Owner: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Tue, 23 Feb 2021 18:21:17 +0000
Gerrit-HasComments: Yes