Skip to content

Commit fe97ad6

Browse files
committed
simplified checks for compactors ZK locks and scan servers ZK locks
1 parent c71cf4a commit fe97ad6

File tree

1 file changed

+2
-27
lines changed

1 file changed

+2
-27
lines changed

server/base/src/main/java/org/apache/accumulo/server/util/checkCommand/SystemConfigCheckRunner.java

+2-27
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,6 @@ private static Admin.CheckCommand.CheckStatus checkZKLocks(ServerContext context
6868
final ServerProcess[] serverProcesses = ServerProcess.values();
6969
final String zkRoot = context.getZooKeeperRoot();
7070
final var zs = context.getZooSession();
71-
final var zrw = zs.asReaderWriter();
72-
final var compactors = context.instanceOperations().getCompactors();
73-
final var sservers = context.instanceOperations().getScanServers();
7471

7572
log.trace("Checking ZooKeeper locks for Accumulo server processes...");
7673

@@ -102,43 +99,21 @@ private static Admin.CheckCommand.CheckStatus checkZKLocks(ServerContext context
10299
break;
103100
case COMPACTOR:
104101
// nonessential process(es)
102+
final var compactors = context.instanceOperations().getCompactors();
105103
if (compactors.isEmpty()) {
106104
log.debug("No compactors appear to be running... This may or may not be expected");
107105
}
108-
for (String compactor : compactors) {
109-
// for each running compactor, ensure a zk lock exists for it
110-
boolean checkedLock = false;
111-
String compactorQueuesPath = zkRoot + Constants.ZCOMPACTORS;
112-
var compactorQueues = zrw.getChildren(compactorQueuesPath);
113-
// find the queue the compactor is in
114-
for (var queue : compactorQueues) {
115-
String compactorQueuePath = compactorQueuesPath + "/" + queue;
116-
String lockPath = compactorQueuePath + "/" + compactor;
117-
if (zrw.exists(lockPath)) {
118-
status = checkLock(lockPath, proc, true, zs, status);
119-
checkedLock = true;
120-
break;
121-
}
122-
}
123-
if (!checkedLock) {
124-
log.warn("Did not find a ZooKeeper lock for the compactor {}!", compactor);
125-
status = Admin.CheckCommand.CheckStatus.FAILED;
126-
}
127-
}
128106
break;
129107
case MONITOR:
130108
// nonessential process
131109
status = checkLock(zkRoot + Constants.ZMONITOR_LOCK, proc, false, zs, status);
132110
break;
133111
case SCAN_SERVER:
134112
// nonessential process(es)
113+
final var sservers = context.instanceOperations().getScanServers();
135114
if (sservers.isEmpty()) {
136115
log.debug("No scan servers appear to be running... This may or may not be expected");
137116
}
138-
for (String sserver : sservers) {
139-
status =
140-
checkLock(zkRoot + Constants.ZSSERVERS + "/" + sserver, proc, true, zs, status);
141-
}
142117
break;
143118
default:
144119
throw new IllegalStateException("Unhandled case: " + proc);

0 commit comments

Comments
 (0)