mirror of https://github.com/apache/cassandra
Fail repair if insufficient responses received
Patch by Simon Zhou; Reviewed by Paulo Motta for CASSANDRA-13397
This commit is contained in:
parent
175e4f8ce8
commit
f5b36f12df
|
|
@ -1,4 +1,5 @@
|
|||
3.0.14
|
||||
* Fail repair if insufficient responses received (CASSANDRA-13397)
|
||||
* Fix SSTableLoader fail when the loaded table contains dropped columns (CASSANDRA-13276)
|
||||
* Avoid name clashes in CassandraIndexTest (CASSANDRA-13427)
|
||||
* Handling partially written hint files (CASSANDRA-12728)
|
||||
|
|
|
|||
|
|
@ -321,30 +321,36 @@ public class ActiveRepairService implements IEndpointStateChangeSubscriber, IFai
|
|||
}
|
||||
else
|
||||
{
|
||||
status.set(false);
|
||||
failedNodes.add(neighbour.getHostAddress());
|
||||
prepareLatch.countDown();
|
||||
// bailout early to avoid potentially waiting for a long time.
|
||||
failRepair(parentRepairSession, "Endpoint not alive: " + neighbour);
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
prepareLatch.await(1, TimeUnit.HOURS);
|
||||
// Failed repair is expensive so we wait for longer time.
|
||||
if (!prepareLatch.await(1, TimeUnit.HOURS)) {
|
||||
failRepair(parentRepairSession, "Did not get replies from all endpoints.");
|
||||
}
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
removeParentRepairSession(parentRepairSession);
|
||||
throw new RuntimeException("Did not get replies from all endpoints. List of failed endpoint(s): " + failedNodes.toString(), e);
|
||||
failRepair(parentRepairSession, "Interrupted while waiting for prepare repair response.");
|
||||
}
|
||||
|
||||
if (!status.get())
|
||||
{
|
||||
removeParentRepairSession(parentRepairSession);
|
||||
throw new RuntimeException("Did not get positive replies from all endpoints. List of failed endpoint(s): " + failedNodes.toString());
|
||||
failRepair(parentRepairSession, "Got negative replies from endpoints " + failedNodes);
|
||||
}
|
||||
|
||||
return parentRepairSession;
|
||||
}
|
||||
|
||||
private void failRepair(UUID parentRepairSession, String errorMsg) {
|
||||
removeParentRepairSession(parentRepairSession);
|
||||
throw new RuntimeException(errorMsg);
|
||||
}
|
||||
|
||||
public void registerParentRepairSession(UUID parentRepairSession, InetAddress coordinator, List<ColumnFamilyStore> columnFamilyStores, Collection<Range<Token>> ranges, boolean isIncremental, long timestamp, boolean isGlobal)
|
||||
{
|
||||
if (!registeredForEndpointChanges)
|
||||
|
|
|
|||
Loading…
Reference in New Issue