private boolean shouldFallBackOnCollision(int approxWorkerCount) {
    // Ideally, we'd want 1 worker to try for every slot; e.g. if there are 4 workers we want 3
    // to re-read, i.e. probability of falling back = 0.75, or 1/4 < random([0,1)). However, we
    // make it slightly more probable (2.0x) to avoid too much re-reading. This is hand-wavy.
    if (approxWorkerCount == 0) return false;
    return (2.0f / approxWorkerCount) <= rdm.nextDouble();
  }
We would have used the curator ephemeral node with some extra logic but it doesn't handle
the EXISTS condition, which is crucial here; so we c/p parts of Curator and add our logic.
llap-client/src/java/org/apache/hadoop/hive/llap/registry/impl/SlotZnode.java