keith-turner commented on code in PR #6168:
URL: https://github.com/apache/accumulo/pull/6168#discussion_r2885169816
##########
server/manager/src/main/java/org/apache/accumulo/manager/Manager.java:
##########
@@ -1391,15 +1451,60 @@ private long remaining(long deadline) {
return Math.max(1, deadline - System.currentTimeMillis());
}
+ private void getManagerLock() throws KeeperException, InterruptedException {
+ log.info("trying to get assistant manager lock");
+
+ final ZooReaderWriter zoo = getContext().getZooSession().asReaderWriter();
+ try {
+
+ var advertiseAddress = getAdvertiseAddress();
+
+ final ServiceLockPaths.ServiceLockPath zLockPath =
getContext().getServerPaths()
+ .createManagerWorkerPath(getResourceGroup(), advertiseAddress);
+ ServiceLockSupport.createNonHaServiceLockPath(Type.MANAGER, zoo,
zLockPath);
+
+ var serverLockUUID = UUID.randomUUID();
+ managerLock = new ServiceLock(getContext().getZooSession(), zLockPath,
serverLockUUID);
+ ServiceLock.LockWatcher lw = new
ServiceLockSupport.ServiceLockWatcher(Type.MANAGER,
+ () -> getShutdownComplete().get(),
+ (type) ->
getContext().getLowMemoryDetector().logGCInfo(getContext().getConfiguration()));
+
+ for (int i = 0; i < 120 / 5; i++) {
+ zoo.putPersistentData(zLockPath.toString(), new byte[0],
ZooUtil.NodeExistsPolicy.SKIP);
+
+ ServiceLockData.ServiceDescriptors descriptors = new
ServiceLockData.ServiceDescriptors();
+ for (ServiceLockData.ThriftService svc : new
ServiceLockData.ThriftService[] {
+ ThriftService.MANAGER}) {
Review Comment:
Seems like it may be best to remove the FATE enum and add a FATE_CLIENT and
FATE_WORKER enum as there are two thrift services now.
--
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]