You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by dl...@apache.org on 2026/02/04 16:05:38 UTC
(accumulo) 01/01: Merge branch '2.1'
This is an automated email from the ASF dual-hosted git repository.
dlmarion pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git
commit 76604d6b45785d0e4ff4ad8d4f0afbb4f4aaff84
Merge: 480c88a2d2 7277daedd3
Author: Dave Marion <dl...@apache.org>
AuthorDate: Wed Feb 4 16:05:23 2026 +0000
Merge branch '2.1'
assemble/bin/accumulo-cluster | 4 ++--
.../tserver/src/main/java/org/apache/accumulo/tserver/ScanServer.java | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --cc server/tserver/src/main/java/org/apache/accumulo/tserver/ScanServer.java
index 60e303566f,83f57347b1..3cbe546193
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/ScanServer.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/ScanServer.java
@@@ -309,20 -328,35 +309,20 @@@ public class ScanServer extends Abstrac
}
/**
- * Set up nodes and locks in ZooKeeper for this Compactor
+ * Set up nodes and locks in ZooKeeper for this ScanServer
*/
private ServiceLock announceExistence() {
- ZooReaderWriter zoo = getContext().getZooReaderWriter();
+ final ZooReaderWriter zoo = getContext().getZooSession().asReaderWriter();
try {
- var zLockPath = ServiceLock.path(
- getContext().getZooKeeperRoot() + Constants.ZSSERVERS + "/" + getClientAddressString());
-
- try {
- // Old zk nodes can be cleaned up by ZooZap
- zoo.putPersistentData(zLockPath.toString(), new byte[] {}, NodeExistsPolicy.SKIP);
- } catch (KeeperException e) {
- if (e.code() == KeeperException.Code.NOAUTH) {
- LOG.error("Failed to write to ZooKeeper. Ensure that"
- + " accumulo.properties, specifically instance.secret, is consistent.");
- }
- throw e;
- }
-
+ final ServiceLockPath zLockPath =
+ context.getServerPaths().createScanServerPath(getResourceGroup(), getAdvertiseAddress());
+ ServiceLockSupport.createNonHaServiceLockPath(Type.SCAN_SERVER, zoo, zLockPath);
serverLockUUID = UUID.randomUUID();
- scanServerLock = new ServiceLock(zoo.getZooKeeper(), zLockPath, serverLockUUID);
- LockWatcher lw = new ServiceLockWatcher("scan server", () -> getShutdownComplete().get(),
- (name) -> gcLogger.logGCInfo(getConfiguration()));
-
- // Don't use the normal ServerServices lock content, instead put the server UUID here.
- byte[] lockContent = (serverLockUUID.toString() + "," + groupName).getBytes(UTF_8);
+ scanServerLock = new ServiceLock(getContext().getZooSession(), zLockPath, serverLockUUID);
+ LockWatcher lw = new ServiceLockWatcher(Type.SCAN_SERVER, () -> getShutdownComplete().get(),
+ (type) -> context.getLowMemoryDetector().logGCInfo(getConfiguration()));
- // wait for 120 seconds with 5 second delay
for (int i = 0; i < 120 / 5; i++) {
zoo.putPersistentData(zLockPath.toString(), new byte[0], NodeExistsPolicy.SKIP);