Added ZooZap and ServiceLock methods to delete ScanServer locks#6073
Added ZooZap and ServiceLock methods to delete ScanServer locks#6073dlmarion merged 7 commits intoapache:2.1from
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.
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.
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.
(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.
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.
This follows the same pattern as deleteLocks.
| } | ||
| } | ||
|
|
||
| @Deprecated(since = "2.1.5") |
There was a problem hiding this comment.
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