-
Notifications
You must be signed in to change notification settings - Fork 478
Added ZooZap and ServiceLock methods to delete ScanServer locks #6073
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
The ScanServer locks in 2.1.x have a different format than the other locks and require different methods. The lock structure has been normalized in the planned version 4.0. Closes apache#6067 Co-authored-by: Dom G. <domgarguilo@apache.org>
dlmarion
left a comment
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.
added notes about why jq changes are needed.
core/src/main/java/org/apache/accumulo/core/fate/zookeeper/ServiceLock.java
Outdated
Show resolved
Hide resolved
server/base/src/main/java/org/apache/accumulo/server/util/ZooZap.java
Outdated
Show resolved
Hide resolved
ddanielr
left a comment
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.
Changes look good. Minor comments.
server/base/src/main/java/org/apache/accumulo/server/util/ZooZap.java
Outdated
Show resolved
Hide resolved
| String sserversPath = Constants.ZROOT + "/" + iid + Constants.ZSSERVERS; | ||
| try { | ||
| removeGroupedLocks(zoo, sserversPath, groupPredicate, hostPortPredicate, opts); | ||
| removeScanServerGroupLocks(zoo, sserversPath, hostPortPredicate, groupPredicate, opts); |
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.
(feel free to ignore): removeScanServerGroupLocks and removeGroupedLocks take the same args but in different orders.
server/tserver/src/main/java/org/apache/accumulo/tserver/ScanServer.java
Show resolved
Hide resolved
…ap.java Co-authored-by: Dom G. <domgarguilo@apache.org>
|
Tested this locally and scan servers now prune correctly with the group keyword working correctly. While testing I also noticed that the GC lock was always being marked for pruning. Looks like the GC lock format is different than the manager or monitor lock so the hostPortPredicate test never passes. Assuming we don't want to change the lock format, the fix is just adding another specific lock type deletion method that does the following check: I'll create an issue ticket for that work. I think this PR is good to merge. |
|
|
||
| List<String> servers = zk.getChildren(zPath); | ||
| if (servers.isEmpty()) { | ||
| throw new IllegalStateException("No server locks are held at " + zPath); |
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.
Will this cause a failure if there are no scan servers? If so attempting to delete some scan servers when there are no scan servers seems like it should not fail.
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.
This follows the same pattern as deleteLocks.
| } | ||
| } | ||
|
|
||
| @Deprecated(since = "2.1.5") |
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.
Why mark this deprecated? This package is not in the public API, so does not seem needed.
The ScanServer locks in 2.1.x have a different format than the other locks and require different methods. The lock structure has been normalized in the planned version 4.0.
Closes #6067