Will Berkeley has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/10536 )

Change subject: [tools] add 'kudu tablet set_attributes' sub-command
......................................................................


Patch Set 2:

(5 comments)

Needs to be covered in the tool test, and could also use a functional test.

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

http://gerrit.cloudera.org:8080/#/c/10536/2/src/kudu/tools/tool_action_tablet.cc@63
PS2, Line 63: DEFINE_bool(attribute_promote, false,
            :             "The value for the tablet replicas's 'promote' 
attribute.");
            : DEFINE_bool(attribute_replace, false,
            :             "The value for the tablet replicas's 'replace' 
attribute.");
We spoke offline about how it doesn't really make sense to set both of these. 
Instead of separate bool flags, maybe one string flag 'peer_attribute' is 
better so that a user can't set multiple attributes on the same replica.


http://gerrit.cloudera.org:8080/#/c/10536/2/src/kudu/tools/tool_action_tablet.cc@587
PS2, Line 587: if (promote && replace) {
             :     // Setting both promote and replace doesn't make sense.
             :     return Status::InvalidArgument("cannot set both PROMOTE and 
REPLACE");
             :   }
With a joint flag this invalid state will be unrepresentable.


http://gerrit.cloudera.org:8080/#/c/10536/2/src/kudu/tools/tool_action_tablet.cc@598
PS2, Line 598: RETURN_NOT_OK(GetTabletLeader(client, tablet_id, &leader_uuid, 
&leader_hp));
             :   unique_ptr<ConsensusServiceProxy> proxy;
             :   RETURN_NOT_OK(BuildProxy(leader_hp.host(), leader_hp.port(), 
&proxy));
How often do we do this sequence in tools code? Should be a helper to get a 
consensus proxy to the leader?

In another world, the client would support sending consensus service requests 
and everything that needed to find a tablet leader would use the same code.


http://gerrit.cloudera.org:8080/#/c/10536/2/src/kudu/tools/tool_action_tablet.cc@614
PS2, Line 614: RETURN_NOT_OK(proxy->BulkChangeConfig(req, &resp, &rpc));
             :   if (resp.has_error()) {
             :     // The status of the request might be InvalidArgument() if 
the
             :     // replica already has the attributes set as specified in 
the incoming
             :     // request.
             :     return StatusFromPB(resp.error().status());
             :   }
This pattern is also very common and could use a macro, I think. 
RETURN_RPC_NOT_OK? And if the function should return OK if everything was ok, 
maybe RETURN_RPC_STATUS?


http://gerrit.cloudera.org:8080/#/c/10536/2/src/kudu/tools/tool_action_tablet.cc@688
PS2, Line 688: "UUID of the tablet server hosting the replica"
Does this argument not have a generic description, or does it not fit here?



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ib304715100ba9062558863f140aa309fd604ace3
Gerrit-Change-Number: 10536
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Will Berkeley <[email protected]>
Gerrit-Comment-Date: Fri, 08 Jun 2018 18:22:18 +0000
Gerrit-HasComments: Yes

Reply via email to