{"record":{"id":"026b5f0b90800945","repo":"apache/druid","slug":"someone-deleted-path-s-while-we-were-trying-to-s","errorCode":null,"errorMessage":"Someone deleted path[%s] while we were trying to set it. Leaving it deleted.","messagePattern":"Someone deleted path\\[(.+?)\\] while we were trying to set it\\. Leaving it deleted\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"server/src/main/java/org/apache/druid/curator/CuratorUtils.java","lineNumber":115,"sourceCode":"        curatorFramework.create()\n                        .creatingParentsIfNeeded()\n                        .withMode(mode)\n                        .forPath(path, rawBytes);\n\n        created = true;\n      }\n      catch (KeeperException.NodeExistsException e) {\n        log.debug(\"Path [%s] created while we were running, will setData instead.\", path);\n      }\n    }\n\n    if (!created) {\n      try {\n        curatorFramework.setData()\n                        .forPath(path, rawBytes);\n      }\n      catch (KeeperException.NoNodeException e) {\n        log.warn(\"Someone deleted path[%s] while we were trying to set it. Leaving it deleted.\", path);\n      }\n    }\n  }\n\n  private static void verifySize(String path, byte[] rawBytes, int maxZnodeBytes)\n  {\n    if (rawBytes.length > maxZnodeBytes) {\n      throw new IAE(\n          \"Length of raw bytes for znode[%s] too large[%,d > %,d]\",\n          path,\n          rawBytes.length,\n          maxZnodeBytes\n      );\n    }\n  }\n\n  public static boolean isChildAdded(PathChildrenCacheEvent event)\n  {","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/server/src/main/java/org/apache/druid/curator/CuratorUtils.java#L97-L133","documentation":"CuratorUtils.createOrSet creates a znode or sets its data in ZooKeeper. If the node was created by this call's guards but deleted by another actor between existence check and setData(), ZooKeeper throws KeeperException.NoNodeException. The utility treats this as an acceptable race, logs it, and leaves the node deleted rather than recreating it, avoiding resurrection of intentionally deleted nodes.","triggerScenarios":"createOrSet(path, bytes) is called; creation path check finds the node exists so it calls setData().forPath, but another client (e.g. a concurrent segment delete or server shutdown) deletes the node first, surfacing NoNodeException.","commonSituations":"Concurrent segment drop while coordinator/overlord updates segment metadata znodes; server ephemeral nodes disappearing as a historical disconnects; multiple coordinators in leader conflict racing on the same znode; clients manually deleting znodes under /druid while services run.","solutions":["No action needed if rare — this is a benign concurrent-deletion race and the node is intentionally left deleted.","If frequent, check for duplicate/conflicting actors writing the same znode (multiple leaders, overlapping tasks).","Verify no external scripts or humans are deleting Druid znodes in ZooKeeper.","Ensure the writer retries with createOrSet at a higher level if the value must persist."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if (curatorFramework.checkExists().forPath(path) == null) { createOrSet(path, bytes); } else { createOrSet(path, bytes); }","typeGuard":null,"tryCatchPattern":"try { curator.setData().forPath(path, bytes); } catch (KeeperException.NoNodeException e) { log.warn(\"Path deleted concurrently; leaving deleted\"); }","preventionTips":["Expect and tolerate concurrent znode deletions","Avoid multiple writers for the same znode","Restrict manual ZooKeeper access in production"],"tags":["druid","zookeeper","curator","concurrency"],"backgroundTag":"invalid-state-transition","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}