mirror of https://github.com/apache/cassandra
Merge branch 'cassandra-5.0' into cassandra-6.0
This commit is contained in:
commit
57ecd4c101
|
|
@ -46,6 +46,7 @@ Merged from 4.1:
|
|||
* Add Paxos v2 option and informatin in cassandra.yaml (CASSANDRA-21316)
|
||||
* Harden data resurrection startup check with atomic heartbeat file write with fallback (CASSANDRA-21290)
|
||||
Merged from 4.0:
|
||||
* Remove inFlightEcho entry on ECHO_REQ failure (CASSANDRA-21428)
|
||||
* Validate snapshot names (CASSANDRA-21389)
|
||||
* BTree.FastBuilder.reset() fails to clear savedBuffer and savedNextKey, causing ClassCastException and SSTable header corruption during schema disagreement (CASSANDRA-21216, CASSANDRA-21260)
|
||||
* Backport CASSANDRA-17810 fix and improve RTBoundValidator error messages (CASSANDRA-18282)
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ import org.apache.cassandra.config.DatabaseDescriptor;
|
|||
import org.apache.cassandra.db.SystemKeyspace;
|
||||
import org.apache.cassandra.dht.IPartitioner;
|
||||
import org.apache.cassandra.dht.Token;
|
||||
import org.apache.cassandra.exceptions.RequestFailure;
|
||||
import org.apache.cassandra.locator.InetAddressAndPort;
|
||||
import org.apache.cassandra.net.Message;
|
||||
import org.apache.cassandra.net.MessagingService;
|
||||
|
|
@ -659,6 +660,7 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean,
|
|||
public void evictFromMembership(InetAddressAndPort endpoint)
|
||||
{
|
||||
checkProperThreadForStateMutation();
|
||||
inflightEcho.remove(endpoint);
|
||||
unreachableEndpoints.remove(endpoint);
|
||||
endpointStateMap.remove(endpoint);
|
||||
expireTimeEndpointMap.remove(endpoint);
|
||||
|
|
@ -1201,13 +1203,30 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean,
|
|||
{
|
||||
Message<NoPayload> echoMessage = Message.out(ECHO_REQ, noPayload);
|
||||
logger.trace("Sending ECHO_REQ to {}", addr);
|
||||
RequestCallback echoHandler = msg ->
|
||||
RequestCallback echoHandler = new RequestCallback()
|
||||
{
|
||||
runInGossipStageBlocking(() -> {
|
||||
EndpointState epState = inflightEcho.remove(addr);
|
||||
if (epState != null)
|
||||
realMarkAlive(addr, epState);
|
||||
});
|
||||
@Override
|
||||
public void onResponse(Message msg)
|
||||
{
|
||||
runInGossipStageBlocking(() -> {
|
||||
EndpointState epState = inflightEcho.remove(addr);
|
||||
if (epState != null)
|
||||
realMarkAlive(addr, epState);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean invokeOnFailure()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(InetAddressAndPort from, RequestFailure failure)
|
||||
{
|
||||
logger.trace("ECHO_REQ to {} failed ({})", addr, failure);
|
||||
inflightEcho.remove(addr);
|
||||
}
|
||||
};
|
||||
MessagingService.instance().sendWithCallback(echoMessage, addr, echoHandler);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue