-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix PersistentTtlNode not deleted if touch node is never created #1260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chevaris Thank you for your contribution!
I left some inline comments.
...-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentTtlNode.java
Outdated
Show resolved
Hide resolved
...-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentTtlNode.java
Outdated
Show resolved
Hide resolved
...-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentTtlNode.java
Outdated
Show resolved
Hide resolved
...-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentTtlNode.java
Outdated
Show resolved
Hide resolved
curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentTtlNode.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution!
Looks good in general. I left a comment about the way to inject code for testing purpose.
curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentTtlNode.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you want to take another look ? @tisonkun @eolivelli @Randgalt
It has been raised before in CURATOR-545, but end up in a fix in zookeeper side ZOOKEEPER-3546.
Given the fact that PERSISTENT_WITH_TTL
is capable as CONTAINER
node(see also
apache/zookeeper#1138 (comment)). I think we could create the container node with using PERSISTENT_WITH_TTL
so we can fix this without reconfig server cluster.
Ideally, there sould be a "touch" command to modify "mtime" of PERSISTENT_WITH_TTL
. Sadly, we don't have, so the child touch node still sound good to me as it does not setData
on container node after creation.
curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentTtlNode.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Kezhu Wang <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for your contribution @chevaris!
This closes #1258 .
Thanks to Kezhu Wang for the suggestion in the solution