Skip to content

Conversation

@ddanielr
Copy link
Contributor

Correctly checks the lock format so that exclude options for the prune command work correctly.

Closes #6076

Correctly checks the lock format so that exclude options for the prune
command work correctly.
@ddanielr ddanielr added this to the 2.1.5 milestone Jan 26, 2026
@ddanielr ddanielr requested a review from dlmarion January 26, 2026 15:02
@ddanielr ddanielr linked an issue Jan 26, 2026 that may be closed by this pull request
if (parts.length == 2 && hostPortPredicate.test(HostAndPort.fromString(parts[1]))) {
messageOutput.accept("Deleting " + path + " from zookeeper");
if (!dryRun) {
zoo.recursiveDelete(path, NodeMissingPolicy.SKIP);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original SingletonLock code uses zapDirectory(zoo, path, ops) which just performs a recursive delete on the path after printing a log message.

throws KeeperException, InterruptedException {
var lockData = ServiceLock.getLockData(zoo.getZooKeeper(), ServiceLock.path(path));
if (lockData != null) {
String lockContent = new String(lockData, UTF_8);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could the ServerServices code be used here to extract the address? Like this code

address = new ServerServices(new String(zk.getData(path + "/" + locks.get(0)), UTF_8))
.getAddress(Service.GC_CLIENT);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that would probably work. I'll look at making that change so we aren't going down multiple lock removal paths again

@ddanielr
Copy link
Contributor Author

Pushing this change up for now. Going to see if ServerServices can be used to consolidate more of the lock code.

@dlmarion
Copy link
Contributor

The code in main is sufficiently different. I don't think the changes here or in #6073 should be merged to main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prune always removes GC lock

3 participants