-
Notifications
You must be signed in to change notification settings - Fork 477
Fixes lock check for prune exclude actions #6077
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
base: 2.1
Are you sure you want to change the base?
Conversation
Correctly checks the lock format so that exclude options for the prune command work correctly.
| if (parts.length == 2 && hostPortPredicate.test(HostAndPort.fromString(parts[1]))) { | ||
| messageOutput.accept("Deleting " + path + " from zookeeper"); | ||
| if (!dryRun) { | ||
| zoo.recursiveDelete(path, NodeMissingPolicy.SKIP); |
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.
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); |
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.
Could the ServerServices code be used here to extract the address? Like this code
accumulo/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java
Lines 443 to 444 in 6474192
| address = new ServerServices(new String(zk.getData(path + "/" + locks.get(0)), UTF_8)) | |
| .getAddress(Service.GC_CLIENT); |
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.
Yes that would probably work. I'll look at making that change so we aren't going down multiple lock removal paths again
|
Pushing this change up for now. Going to see if ServerServices can be used to consolidate more of the lock code. |
|
The code in main is sufficiently different. I don't think the changes here or in #6073 should be merged to main. |
Correctly checks the lock format so that exclude options for the prune command work correctly.
Closes #6076