You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Rakesh R (Created) (JIRA)" <ji...@apache.org> on 2011/10/13 12:37:11 UTC
[jira] [Created] (ZOOKEEPER-1225) Successive invocation of
LeaderElectionSupport.start() will bring the ELECTED node to READY and
cause no one in ELECTED state.
Successive invocation of LeaderElectionSupport.start() will bring the ELECTED node to READY and cause no one in ELECTED state.
------------------------------------------------------------------------------------------------------------------------------
Key: ZOOKEEPER-1225
URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1225
Project: ZooKeeper
Issue Type: Bug
Components: recipes
Affects Versions: 3.3.3
Reporter: Rakesh R
Assignee: Rakesh R
Fix For: 3.5.0
Presently there is no state validation for the start() api, so one can invoke multiple times consecutively. The second or further invocation will makes the client node to become 'READY' state transition. Because there is an offer already got created during the first invocation of the start() api, the second invocation again makeOffer() and after determination will be chosen as READY state transitions.
This makes the situation with no 'ELECTED' nodes present and the client (or the user of the election recipe) will be indefinitely waiting for the 'ELECTED' node.
Similarly, stop() api can be invoked and there is no state validation and this can dispatch unnecessary FAILED transition events.
IMO, LES recipe can have validation logic to avoid the successive start() and stop() invocations.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (ZOOKEEPER-1225) Successive invocation of
LeaderElectionSupport.start() will bring the ELECTED node to READY and
cause no one in ELECTED state.
Posted by "Rakesh R (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-1225?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13235474#comment-13235474 ]
Rakesh R commented on ZOOKEEPER-1225:
-------------------------------------
Hi Flavio, Thanks for the interest. Yeah, here the determineElectionStatus() is judging with the recently created ephemeral node and updating its status accordingly.
As you suggested, LEStrategy would either consider the first one or not to allow multiple znode creation on start(). Anyway in the first case, its ignoring all the subsequent znodes and is having no extra logic with these znodes. IMO, better option would be restricts the multiple invocations & creation of znodes on start(). Also the recipe would be able to avoid the multiple/duplicate dispatchEvents.
> Successive invocation of LeaderElectionSupport.start() will bring the ELECTED node to READY and cause no one in ELECTED state.
> ------------------------------------------------------------------------------------------------------------------------------
>
> Key: ZOOKEEPER-1225
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1225
> Project: ZooKeeper
> Issue Type: Bug
> Components: recipes
> Affects Versions: 3.3.3
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 3.5.0
>
> Attachments: ZOOKEEPER-1225.patch
>
>
> Presently there is no state validation for the start() api, so one can invoke multiple times consecutively. The second or further invocation will makes the client node to become 'READY' state transition. Because there is an offer already got created during the first invocation of the start() api, the second invocation again makeOffer() and after determination will be chosen as READY state transitions.
> This makes the situation with no 'ELECTED' nodes present and the client (or the user of the election recipe) will be indefinitely waiting for the 'ELECTED' node.
> Similarly, stop() api can be invoked and there is no state validation and this can dispatch unnecessary FAILED transition events.
> IMO, LES recipe can have validation logic to avoid the successive start() and stop() invocations.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (ZOOKEEPER-1225) Successive invocation of
LeaderElectionSupport.start() will bring the ELECTED node to READY and
cause no one in ELECTED state.
Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-1225?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Patrick Hunt reassigned ZOOKEEPER-1225:
---------------------------------------
Assignee: Rakesh R
> Successive invocation of LeaderElectionSupport.start() will bring the ELECTED node to READY and cause no one in ELECTED state.
> ------------------------------------------------------------------------------------------------------------------------------
>
> Key: ZOOKEEPER-1225
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1225
> Project: ZooKeeper
> Issue Type: Bug
> Components: recipes
> Affects Versions: 3.3.3
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 3.5.0
>
> Attachments: ZOOKEEPER-1225.patch
>
>
> Presently there is no state validation for the start() api, so one can invoke multiple times consecutively. The second or further invocation will makes the client node to become 'READY' state transition. Because there is an offer already got created during the first invocation of the start() api, the second invocation again makeOffer() and after determination will be chosen as READY state transitions.
> This makes the situation with no 'ELECTED' nodes present and the client (or the user of the election recipe) will be indefinitely waiting for the 'ELECTED' node.
> Similarly, stop() api can be invoked and there is no state validation and this can dispatch unnecessary FAILED transition events.
> IMO, LES recipe can have validation logic to avoid the successive start() and stop() invocations.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (ZOOKEEPER-1225) Successive invocation of
LeaderElectionSupport.start() will bring the ELECTED node to READY and
cause no one in ELECTED state.
Posted by "Flavio Junqueira (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-1225?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13235116#comment-13235116 ]
Flavio Junqueira commented on ZOOKEEPER-1225:
---------------------------------------------
Hi Rakesh, One question here. In makeOffer, we create an ephemeral, sequential node. Consequently, multiple invocations of start() with the trunk code would create multiple znodes for the same client. Isn't it sufficient that we just consider the first one when we try to determine if a given client is the leader in determineElectionStatus()?
> Successive invocation of LeaderElectionSupport.start() will bring the ELECTED node to READY and cause no one in ELECTED state.
> ------------------------------------------------------------------------------------------------------------------------------
>
> Key: ZOOKEEPER-1225
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1225
> Project: ZooKeeper
> Issue Type: Bug
> Components: recipes
> Affects Versions: 3.3.3
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 3.5.0
>
> Attachments: ZOOKEEPER-1225.patch
>
>
> Presently there is no state validation for the start() api, so one can invoke multiple times consecutively. The second or further invocation will makes the client node to become 'READY' state transition. Because there is an offer already got created during the first invocation of the start() api, the second invocation again makeOffer() and after determination will be chosen as READY state transitions.
> This makes the situation with no 'ELECTED' nodes present and the client (or the user of the election recipe) will be indefinitely waiting for the 'ELECTED' node.
> Similarly, stop() api can be invoked and there is no state validation and this can dispatch unnecessary FAILED transition events.
> IMO, LES recipe can have validation logic to avoid the successive start() and stop() invocations.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (ZOOKEEPER-1225) Successive invocation of
LeaderElectionSupport.start() will bring the ELECTED node to READY and
cause no one in ELECTED state.
Posted by "Rakesh R (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-1225?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13126522#comment-13126522 ]
Rakesh R commented on ZOOKEEPER-1225:
-------------------------------------
Following are some of the proposals. Any thoughts or better suggestion would be appreciated.
*Proposal-1*
The main reason for the READY state transition is due to the multiple offer (ephemeral node) creation, so the successive starts can have validation logic by checking the existence of the ephemeral node which would be created during the previous startup. If exists, return by giving warning msg.
The same logic can be applied to the stop() api also. Here if the ephemeral node exists, it can allow the stop execution logic. Otherwise return by giving warn msg.
*Proposal-2*
During startup, after the successful creation of offer it can set the ‘running’ flag to true and all the further startup will be validated.
During stop after the successful deletion of the offer it will reset the ‘running’ flag to false. If running==true, it can allow the stop otherwise just give warn message.
*Note:* In the case if the LES is in FAILED state, then user has to explicitly stop() the LES and starts again. So the previous offer(ephemeral will be deleted).
I feel the +first approach+ is better, because let’s say if the zookeeper session got expired, here the client node can create new zookeeper session and simply starts.
But in the +second approach+ user has to explicitly stop() and then start(). Also when stopping it will fail since the session got expired and goes to FAILED state transitions.
Thanks,
Rakesh
> Successive invocation of LeaderElectionSupport.start() will bring the ELECTED node to READY and cause no one in ELECTED state.
> ------------------------------------------------------------------------------------------------------------------------------
>
> Key: ZOOKEEPER-1225
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1225
> Project: ZooKeeper
> Issue Type: Bug
> Components: recipes
> Affects Versions: 3.3.3
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 3.5.0
>
>
> Presently there is no state validation for the start() api, so one can invoke multiple times consecutively. The second or further invocation will makes the client node to become 'READY' state transition. Because there is an offer already got created during the first invocation of the start() api, the second invocation again makeOffer() and after determination will be chosen as READY state transitions.
> This makes the situation with no 'ELECTED' nodes present and the client (or the user of the election recipe) will be indefinitely waiting for the 'ELECTED' node.
> Similarly, stop() api can be invoked and there is no state validation and this can dispatch unnecessary FAILED transition events.
> IMO, LES recipe can have validation logic to avoid the successive start() and stop() invocations.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (ZOOKEEPER-1225) Successive invocation of
LeaderElectionSupport.start() will bring the ELECTED node to READY and
cause no one in ELECTED state.
Posted by "Rakesh R (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-1225?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rakesh R updated ZOOKEEPER-1225:
--------------------------------
Assignee: (was: Rakesh R)
> Successive invocation of LeaderElectionSupport.start() will bring the ELECTED node to READY and cause no one in ELECTED state.
> ------------------------------------------------------------------------------------------------------------------------------
>
> Key: ZOOKEEPER-1225
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1225
> Project: ZooKeeper
> Issue Type: Bug
> Components: recipes
> Affects Versions: 3.3.3
> Reporter: Rakesh R
> Fix For: 3.5.0
>
> Attachments: ZOOKEEPER-1225.patch
>
>
> Presently there is no state validation for the start() api, so one can invoke multiple times consecutively. The second or further invocation will makes the client node to become 'READY' state transition. Because there is an offer already got created during the first invocation of the start() api, the second invocation again makeOffer() and after determination will be chosen as READY state transitions.
> This makes the situation with no 'ELECTED' nodes present and the client (or the user of the election recipe) will be indefinitely waiting for the 'ELECTED' node.
> Similarly, stop() api can be invoked and there is no state validation and this can dispatch unnecessary FAILED transition events.
> IMO, LES recipe can have validation logic to avoid the successive start() and stop() invocations.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (ZOOKEEPER-1225) Successive invocation of
LeaderElectionSupport.start() will bring the ELECTED node to READY and
cause no one in ELECTED state.
Posted by "Rakesh R (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-1225?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13126580#comment-13126580 ]
Rakesh R commented on ZOOKEEPER-1225:
-------------------------------------
Attached the patch based on the *proposal-1* : provided start & stop validation logics by checking whether the offer (ephemeral node) exists or not. Please review the test cases and the fix.
Thanks,
Rakesh
> Successive invocation of LeaderElectionSupport.start() will bring the ELECTED node to READY and cause no one in ELECTED state.
> ------------------------------------------------------------------------------------------------------------------------------
>
> Key: ZOOKEEPER-1225
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1225
> Project: ZooKeeper
> Issue Type: Bug
> Components: recipes
> Affects Versions: 3.3.3
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 3.5.0
>
> Attachments: ZOOKEEPER-1225.patch
>
>
> Presently there is no state validation for the start() api, so one can invoke multiple times consecutively. The second or further invocation will makes the client node to become 'READY' state transition. Because there is an offer already got created during the first invocation of the start() api, the second invocation again makeOffer() and after determination will be chosen as READY state transitions.
> This makes the situation with no 'ELECTED' nodes present and the client (or the user of the election recipe) will be indefinitely waiting for the 'ELECTED' node.
> Similarly, stop() api can be invoked and there is no state validation and this can dispatch unnecessary FAILED transition events.
> IMO, LES recipe can have validation logic to avoid the successive start() and stop() invocations.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (ZOOKEEPER-1225) Successive invocation of
LeaderElectionSupport.start() will bring the ELECTED node to READY and
cause no one in ELECTED state.
Posted by "Hadoop QA (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-1225?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13126609#comment-13126609 ]
Hadoop QA commented on ZOOKEEPER-1225:
--------------------------------------
+1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12498880/ZOOKEEPER-1225.patch
against trunk revision 1180217.
+1 @author. The patch does not contain any @author tags.
+1 tests included. The patch appears to include 3 new or modified tests.
+1 javadoc. The javadoc tool did not generate any warning messages.
+1 javac. The applied patch does not increase the total number of javac compiler warnings.
+1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings.
+1 release audit. The applied patch does not increase the total number of release audit warnings.
+1 core tests. The patch passed core unit tests.
+1 contrib tests. The patch passed contrib unit tests.
Test results: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/619//testReport/
Findbugs warnings: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/619//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/619//console
This message is automatically generated.
> Successive invocation of LeaderElectionSupport.start() will bring the ELECTED node to READY and cause no one in ELECTED state.
> ------------------------------------------------------------------------------------------------------------------------------
>
> Key: ZOOKEEPER-1225
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1225
> Project: ZooKeeper
> Issue Type: Bug
> Components: recipes
> Affects Versions: 3.3.3
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 3.5.0
>
> Attachments: ZOOKEEPER-1225.patch
>
>
> Presently there is no state validation for the start() api, so one can invoke multiple times consecutively. The second or further invocation will makes the client node to become 'READY' state transition. Because there is an offer already got created during the first invocation of the start() api, the second invocation again makeOffer() and after determination will be chosen as READY state transitions.
> This makes the situation with no 'ELECTED' nodes present and the client (or the user of the election recipe) will be indefinitely waiting for the 'ELECTED' node.
> Similarly, stop() api can be invoked and there is no state validation and this can dispatch unnecessary FAILED transition events.
> IMO, LES recipe can have validation logic to avoid the successive start() and stop() invocations.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (ZOOKEEPER-1225) Successive invocation of
LeaderElectionSupport.start() will bring the ELECTED node to READY and
cause no one in ELECTED state.
Posted by "Rakesh R (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-1225?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rakesh R updated ZOOKEEPER-1225:
--------------------------------
Attachment: ZOOKEEPER-1225.patch
> Successive invocation of LeaderElectionSupport.start() will bring the ELECTED node to READY and cause no one in ELECTED state.
> ------------------------------------------------------------------------------------------------------------------------------
>
> Key: ZOOKEEPER-1225
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1225
> Project: ZooKeeper
> Issue Type: Bug
> Components: recipes
> Affects Versions: 3.3.3
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 3.5.0
>
> Attachments: ZOOKEEPER-1225.patch
>
>
> Presently there is no state validation for the start() api, so one can invoke multiple times consecutively. The second or further invocation will makes the client node to become 'READY' state transition. Because there is an offer already got created during the first invocation of the start() api, the second invocation again makeOffer() and after determination will be chosen as READY state transitions.
> This makes the situation with no 'ELECTED' nodes present and the client (or the user of the election recipe) will be indefinitely waiting for the 'ELECTED' node.
> Similarly, stop() api can be invoked and there is no state validation and this can dispatch unnecessary FAILED transition events.
> IMO, LES recipe can have validation logic to avoid the successive start() and stop() invocations.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira