dlmarion commented on code in PR #4562:
URL: https://github.com/apache/accumulo/pull/4562#discussion_r1602253758
##########
server/manager/src/main/java/org/apache/accumulo/manager/Manager.java:
##########
@@ -740,6 +741,48 @@ private void cleanupOfflineMigrations() {
}
}
+ private class ScanServerZKCleaner implements Runnable {
+
+ @Override
+ public void run() {
+
+ final ZooReaderWriter zrw = getContext().getZooReaderWriter();
+ final String sserverZNodePath = getContext().getZooKeeperRoot() +
Constants.ZSSERVERS;
+
+ while (stillManager()) {
+ try {
+ for (String sserverClientAddress :
zrw.getChildren(sserverZNodePath)) {
+
+ final String sServerZPath = sserverZNodePath + "/" +
sserverClientAddress;
+ final var zLockPath = ServiceLock.path(sServerZPath);
+ ZcStat stat = new ZcStat();
+ byte[] lockData =
ServiceLock.getLockData(getContext().getZooCache(), zLockPath, stat);
+
+ if (lockData == null) {
+ try {
+ log.debug("Deleting empty ScanServer ZK node {}",
sServerZPath);
+ zrw.delete(sServerZPath);
+ } catch (KeeperException.NotEmptyException e) {
+ log.debug(
+ "Failed to delete ScanServer ZK node {} its not empty,
likely an expected race condition.",
+ sServerZPath);
+ }
+ }
+ }
+ } catch (KeeperException e) {
+ log.error("Exception trying to delete empty scan server ZNodes, will
retry", e);
+ } catch (InterruptedException e) {
+ Thread.interrupted();
+ log.error("Interrupted trying to delete empty scan server ZNodes,
will retry", e);
+ } finally {
+ // sleep for 5 mins
+ sleepUninterruptibly(TIME_BETWEEN_MIGRATION_CLEANUPS, MILLISECONDS);
Review Comment:
> Basically I needed to lookup the constant and decode what * ONE_SECOND was
to see that the MILLISECONDS are the correct units. Just saying that the wait
was 5 minutes more directly could improve clarity? Probably more of a personal
preference and can be ignored
:rofl: . Yeah, it should be changed. I can do that, I have the power.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]