You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Todd Lipcon (JIRA)" <ji...@apache.org> on 2010/07/29 19:26:21 UTC
[jira] Created: (ZOOKEEPER-829) Add /zookeeper/sessions/* to allow
inspection/manipulation of client sessions
Add /zookeeper/sessions/* to allow inspection/manipulation of client sessions
-----------------------------------------------------------------------------
Key: ZOOKEEPER-829
URL: https://issues.apache.org/jira/browse/ZOOKEEPER-829
Project: Zookeeper
Issue Type: New Feature
Components: server
Reporter: Todd Lipcon
For some use cases in HBase (HBASE-1316 in particular) we'd like the ability to forcible expire someone else's ZK session. Patrick and I discussed on IRC and came up with an idea of creating nodes in /zookeeper/sessions/<session id> that can be read in order to get basic stats about a session, and written in order to manipulate one. The manipulation we need in HBase is the ability to write a command like "kill", but others might be useful as well.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (ZOOKEEPER-829) Add /zookeeper/sessions/* to
allow inspection/manipulation of client sessions
Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-829?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12893736#action_12893736 ]
Patrick Hunt commented on ZOOKEEPER-829:
----------------------------------------
btw, a getData on one of these znodes should return useful information about the session - similar to "cons" 4letter word I would think. (but not limited to)
> Add /zookeeper/sessions/* to allow inspection/manipulation of client sessions
> -----------------------------------------------------------------------------
>
> Key: ZOOKEEPER-829
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-829
> Project: Zookeeper
> Issue Type: New Feature
> Components: server
> Reporter: Todd Lipcon
>
> For some use cases in HBase (HBASE-1316 in particular) we'd like the ability to forcible expire someone else's ZK session. Patrick and I discussed on IRC and came up with an idea of creating nodes in /zookeeper/sessions/<session id> that can be read in order to get basic stats about a session, and written in order to manipulate one. The manipulation we need in HBase is the ability to write a command like "kill", but others might be useful as well.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (ZOOKEEPER-829) Add /zookeeper/sessions/* to allow
inspection/manipulation of client sessions
Posted by "Michael Xu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-829?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Xu updated ZOOKEEPER-829:
---------------------------------
Attachment: 829.diff
typo correction to patch above
> Add /zookeeper/sessions/* to allow inspection/manipulation of client sessions
> -----------------------------------------------------------------------------
>
> Key: ZOOKEEPER-829
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-829
> Project: Zookeeper
> Issue Type: New Feature
> Components: server
> Reporter: Todd Lipcon
> Attachments: 829.diff, zookeeper-829.diff
>
>
> For some use cases in HBase (HBASE-1316 in particular) we'd like the ability to forcible expire someone else's ZK session. Patrick and I discussed on IRC and came up with an idea of creating nodes in /zookeeper/sessions/<session id> that can be read in order to get basic stats about a session, and written in order to manipulate one. The manipulation we need in HBase is the ability to write a command like "kill", but others might be useful as well.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (ZOOKEEPER-829) Add /zookeeper/sessions/* to
allow inspection/manipulation of client sessions
Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-829?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12909791#action_12909791 ]
Patrick Hunt commented on ZOOKEEPER-829:
----------------------------------------
Oh yea, the "close" feature should be disabled unless explicitly turned on the by the ensemble admin - we want ppl to only use this particular aspect for testing.
> Add /zookeeper/sessions/* to allow inspection/manipulation of client sessions
> -----------------------------------------------------------------------------
>
> Key: ZOOKEEPER-829
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-829
> Project: Zookeeper
> Issue Type: New Feature
> Components: server
> Reporter: Todd Lipcon
> Attachments: 829.diff
>
>
> For some use cases in HBase (HBASE-1316 in particular) we'd like the ability to forcible expire someone else's ZK session. Patrick and I discussed on IRC and came up with an idea of creating nodes in /zookeeper/sessions/<session id> that can be read in order to get basic stats about a session, and written in order to manipulate one. The manipulation we need in HBase is the ability to write a command like "kill", but others might be useful as well.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (ZOOKEEPER-829) Add /zookeeper/sessions/* to
allow inspection/manipulation of client sessions
Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-829?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12909784#action_12909784 ]
Patrick Hunt commented on ZOOKEEPER-829:
----------------------------------------
Looks pretty good to me, some nits but in general ok. Ben/Mahadev?
1) use spaces not tabs
2) methods start with lower
3) use Long.toHexString to convert sessionid to hex (see other examples in the code, esp logging a sessionid)
4) you probably want to support both disconnect and close/expire to enable testing
5) add some tests, both to verify this code, but also to provide a "blueprint" for other users
5.1) as part of 5 provide some reuseable code to testForceClose(sessionid) and such.
> Add /zookeeper/sessions/* to allow inspection/manipulation of client sessions
> -----------------------------------------------------------------------------
>
> Key: ZOOKEEPER-829
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-829
> Project: Zookeeper
> Issue Type: New Feature
> Components: server
> Reporter: Todd Lipcon
> Attachments: 829.diff
>
>
> For some use cases in HBase (HBASE-1316 in particular) we'd like the ability to forcible expire someone else's ZK session. Patrick and I discussed on IRC and came up with an idea of creating nodes in /zookeeper/sessions/<session id> that can be read in order to get basic stats about a session, and written in order to manipulate one. The manipulation we need in HBase is the ability to write a command like "kill", but others might be useful as well.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (ZOOKEEPER-829) Add /zookeeper/sessions/* to
allow inspection/manipulation of client sessions
Posted by "Todd Lipcon (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-829?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12893919#action_12893919 ]
Todd Lipcon commented on ZOOKEEPER-829:
---------------------------------------
The feature we need in HBase is the ability to kill it immediately (and hence fence it from making any further actions in ZK)
> Add /zookeeper/sessions/* to allow inspection/manipulation of client sessions
> -----------------------------------------------------------------------------
>
> Key: ZOOKEEPER-829
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-829
> Project: Zookeeper
> Issue Type: New Feature
> Components: server
> Reporter: Todd Lipcon
>
> For some use cases in HBase (HBASE-1316 in particular) we'd like the ability to forcible expire someone else's ZK session. Patrick and I discussed on IRC and came up with an idea of creating nodes in /zookeeper/sessions/<session id> that can be read in order to get basic stats about a session, and written in order to manipulate one. The manipulation we need in HBase is the ability to write a command like "kill", but others might be useful as well.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (ZOOKEEPER-829) Add /zookeeper/sessions/* to
allow inspection/manipulation of client sessions
Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-829?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12893935#action_12893935 ]
Patrick Hunt commented on ZOOKEEPER-829:
----------------------------------------
Perhaps we should think of it as close or disconnect rather than expire/disconnect. We already have this feature in JMX btw (just not as easily accessible) and you can also do it by connecting a new session with the same id/pass and then closing that...
> Add /zookeeper/sessions/* to allow inspection/manipulation of client sessions
> -----------------------------------------------------------------------------
>
> Key: ZOOKEEPER-829
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-829
> Project: Zookeeper
> Issue Type: New Feature
> Components: server
> Reporter: Todd Lipcon
>
> For some use cases in HBase (HBASE-1316 in particular) we'd like the ability to forcible expire someone else's ZK session. Patrick and I discussed on IRC and came up with an idea of creating nodes in /zookeeper/sessions/<session id> that can be read in order to get basic stats about a session, and written in order to manipulate one. The manipulation we need in HBase is the ability to write a command like "kill", but others might be useful as well.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (ZOOKEEPER-829) Add /zookeeper/sessions/* to allow
inspection/manipulation of client sessions
Posted by "Michael Xu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-829?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Xu updated ZOOKEEPER-829:
---------------------------------
Attachment: (was: zookeeper-829.diff)
> Add /zookeeper/sessions/* to allow inspection/manipulation of client sessions
> -----------------------------------------------------------------------------
>
> Key: ZOOKEEPER-829
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-829
> Project: Zookeeper
> Issue Type: New Feature
> Components: server
> Reporter: Todd Lipcon
> Attachments: 829.diff
>
>
> For some use cases in HBase (HBASE-1316 in particular) we'd like the ability to forcible expire someone else's ZK session. Patrick and I discussed on IRC and came up with an idea of creating nodes in /zookeeper/sessions/<session id> that can be read in order to get basic stats about a session, and written in order to manipulate one. The manipulation we need in HBase is the ability to write a command like "kill", but others might be useful as well.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (ZOOKEEPER-829) Add /zookeeper/sessions/* to allow
inspection/manipulation of client sessions
Posted by "Michael Xu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-829?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Xu updated ZOOKEEPER-829:
---------------------------------
Attachment: zookeeper-829.diff
hi everyone,
here is a patch for this issue.
the server creates zknodes at /zookeeper/sessions with the sessionID as the name (NOT hex-encoded, uses base-10 representation of the sessionID ).
Any client writing anything to a session node causes the session to be expired.
I will write unit tests when I get a chance, but I'd like feedback on design-wise what may need to be changed in order to include it officially.
Likely, the next step will be making a test mode specifically for zookeeperserver so clients can use this functionality of managing sessions themselves.
michael
> Add /zookeeper/sessions/* to allow inspection/manipulation of client sessions
> -----------------------------------------------------------------------------
>
> Key: ZOOKEEPER-829
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-829
> Project: Zookeeper
> Issue Type: New Feature
> Components: server
> Reporter: Todd Lipcon
> Attachments: zookeeper-829.diff
>
>
> For some use cases in HBase (HBASE-1316 in particular) we'd like the ability to forcible expire someone else's ZK session. Patrick and I discussed on IRC and came up with an idea of creating nodes in /zookeeper/sessions/<session id> that can be read in order to get basic stats about a session, and written in order to manipulate one. The manipulation we need in HBase is the ability to write a command like "kill", but others might be useful as well.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (ZOOKEEPER-829) Add /zookeeper/sessions/* to
allow inspection/manipulation of client sessions
Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-829?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12893729#action_12893729 ]
Patrick Hunt commented on ZOOKEEPER-829:
----------------------------------------
Implementing as part of /zookeeper (a znode) allows us to easily add this feature (vs changing the wire protocol). Integration with existing zk clients/libs/bindings/etc... will be simplified. Also we get ACLs in the bargain.
Note that this also solves a lot of problems wrt client side testing - session expiration and disconnection will both be easy features to provide.
I suggest we use commands like "expire" and "disconnect" rather than "kill"
Another idea comes to mind - we might have /zookeeper/sessions/<id> and also /zookeeper/<serverid>/sessions/<id>, this second option would allow for a "supervisory" process to monitor load on the servers and forcibly disconnect clients, thereby redistributing the load. This has been a bane for us (equitable load distribution on the servers) and a feature like this seems like a great solution.
> Add /zookeeper/sessions/* to allow inspection/manipulation of client sessions
> -----------------------------------------------------------------------------
>
> Key: ZOOKEEPER-829
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-829
> Project: Zookeeper
> Issue Type: New Feature
> Components: server
> Reporter: Todd Lipcon
>
> For some use cases in HBase (HBASE-1316 in particular) we'd like the ability to forcible expire someone else's ZK session. Patrick and I discussed on IRC and came up with an idea of creating nodes in /zookeeper/sessions/<session id> that can be read in order to get basic stats about a session, and written in order to manipulate one. The manipulation we need in HBase is the ability to write a command like "kill", but others might be useful as well.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (ZOOKEEPER-829) Add /zookeeper/sessions/* to
allow inspection/manipulation of client sessions
Posted by "Michael Xu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-829?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12907255#action_12907255 ]
Michael Xu commented on ZOOKEEPER-829:
--------------------------------------
hi everyone,
i plan on taking this on my plate.
patrick and i spoke over irc, there are issues with the current method of logging in and closing client id's for the purposes of explicitly expiring sessions.
being able to have explicit control over sessions is a very desirable feature for those doing testing with zookeeper.
i'll put some code in SessionTracker.java, that adds to DataTree.java on session creation on the cluster leader to create a /zookeeper/sessions/<id> and set a watch on it. clients may write a "close" to a zknode, which the server will acknowledge by removing the session.
> Add /zookeeper/sessions/* to allow inspection/manipulation of client sessions
> -----------------------------------------------------------------------------
>
> Key: ZOOKEEPER-829
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-829
> Project: Zookeeper
> Issue Type: New Feature
> Components: server
> Reporter: Todd Lipcon
>
> For some use cases in HBase (HBASE-1316 in particular) we'd like the ability to forcible expire someone else's ZK session. Patrick and I discussed on IRC and came up with an idea of creating nodes in /zookeeper/sessions/<session id> that can be read in order to get basic stats about a session, and written in order to manipulate one. The manipulation we need in HBase is the ability to write a command like "kill", but others might be useful as well.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (ZOOKEEPER-829) Add /zookeeper/sessions/* to
allow inspection/manipulation of client sessions
Posted by "Benjamin Reed (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-829?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12893910#action_12893910 ]
Benjamin Reed commented on ZOOKEEPER-829:
-----------------------------------------
should we kill the session immediately or wait until the sessionTimeout. killing it immediate seems like it is violating a contract.
> Add /zookeeper/sessions/* to allow inspection/manipulation of client sessions
> -----------------------------------------------------------------------------
>
> Key: ZOOKEEPER-829
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-829
> Project: Zookeeper
> Issue Type: New Feature
> Components: server
> Reporter: Todd Lipcon
>
> For some use cases in HBase (HBASE-1316 in particular) we'd like the ability to forcible expire someone else's ZK session. Patrick and I discussed on IRC and came up with an idea of creating nodes in /zookeeper/sessions/<session id> that can be read in order to get basic stats about a session, and written in order to manipulate one. The manipulation we need in HBase is the ability to write a command like "kill", but others might be useful as well.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.