Skip to content

Commit

Permalink
Include a check so that an unstarted node cannot participate in other…
Browse files Browse the repository at this point in the history
… nodes' startups
  • Loading branch information
maniksurtani committed Apr 26, 2011
1 parent 6b8d838 commit 1f4d1af
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ public TransactionLogger getTransactionLogger() {
}

public Set<Address> requestPermissionToJoin(Address a) {
// This only happens on the coordinator.
try {
if (!startLatch.await(5, TimeUnit.MINUTES)) {
log.warn("DistributionManager not started after waiting up to 5 minutes! Not rehashing!");
Expand All @@ -485,7 +486,13 @@ public Set<Address> requestPermissionToJoin(Address a) {
}

public NodeTopologyInfo informRehashOnJoin(Address a, boolean starting, NodeTopologyInfo nodeTopologyInfo) {
if (!joinComplete) {
log.info("DistributionManager not yet joined the cluster. Cannot do anything about other concurrent joiners.");
return null;
}

if (trace) log.trace("Informed of a JOIN by %s. Starting? %s", a, starting);

if (!starting) {
if (consistentHash instanceof UnionConsistentHash) {
UnionConsistentHash uch = (UnionConsistentHash) consistentHash;
Expand All @@ -510,6 +517,11 @@ public NodeTopologyInfo informRehashOnJoin(Address a, boolean starting, NodeTopo

@Override
public void informRehashOnLeave(Address sender) {
if (!joinComplete) {
log.info("DistributionManager not yet joined the cluster. Cannot do anything about other concurrent leavers.");
return;
}

leaveAcksLock.lock();
try {
leaveRehashAcks.add(sender);
Expand Down

0 comments on commit 1f4d1af

Please sign in to comment.