@@ -68,9 +68,6 @@ private static Admin.CheckCommand.CheckStatus checkZKLocks(ServerContext context
68
68
final ServerProcess [] serverProcesses = ServerProcess .values ();
69
69
final String zkRoot = context .getZooKeeperRoot ();
70
70
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 ();
74
71
75
72
log .trace ("Checking ZooKeeper locks for Accumulo server processes..." );
76
73
@@ -102,43 +99,21 @@ private static Admin.CheckCommand.CheckStatus checkZKLocks(ServerContext context
102
99
break ;
103
100
case COMPACTOR :
104
101
// nonessential process(es)
102
+ final var compactors = context .instanceOperations ().getCompactors ();
105
103
if (compactors .isEmpty ()) {
106
104
log .debug ("No compactors appear to be running... This may or may not be expected" );
107
105
}
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
- }
128
106
break ;
129
107
case MONITOR :
130
108
// nonessential process
131
109
status = checkLock (zkRoot + Constants .ZMONITOR_LOCK , proc , false , zs , status );
132
110
break ;
133
111
case SCAN_SERVER :
134
112
// nonessential process(es)
113
+ final var sservers = context .instanceOperations ().getScanServers ();
135
114
if (sservers .isEmpty ()) {
136
115
log .debug ("No scan servers appear to be running... This may or may not be expected" );
137
116
}
138
- for (String sserver : sservers ) {
139
- status =
140
- checkLock (zkRoot + Constants .ZSSERVERS + "/" + sserver , proc , true , zs , status );
141
- }
142
117
break ;
143
118
default :
144
119
throw new IllegalStateException ("Unhandled case: " + proc );
0 commit comments