Merge branch 'cassandra-4.1' into cassandra-5.0

This commit is contained in:
Stefan Miklosovic 2026-03-15 18:37:51 +01:00
commit c439be9390
No known key found for this signature in database
GPG Key ID: 32F35CB2F546D93E
2 changed files with 24 additions and 7 deletions

View File

@ -14,6 +14,7 @@ Merged from 4.1:
* Disk usage guardrail cannot be disabled when failure threshold is reached (CASSANDRA-21057)
* ReadCommandController should close fast to avoid deadlock when building secondary index (CASSANDRA-19564)
Merged from 4.0:
* Node does not send multiple inflight echos (CASSANDRA-18866)
* Obsolete expired SSTables before compaction starts (CASSANDRA-19776)
* Switch lz4-java to at.yawk.lz4 version due to CVE (CASSANDRA-21052)
* Restrict BytesType compatibility to scalar types only (CASSANDRA-20982)

View File

@ -165,6 +165,9 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean,
@VisibleForTesting
final Set<InetAddressAndPort> liveEndpoints = new ConcurrentSkipListSet<>();
/* Inflight echo requests. */
private final Map<InetAddressAndPort, EndpointState> inflightEcho = new ConcurrentHashMap<>();
/* unreachable member set */
private final Map<InetAddressAndPort, Long> unreachableEndpoints = new ConcurrentHashMap<>();
@ -206,6 +209,7 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean,
{
unreachableEndpoints.clear();
liveEndpoints.clear();
inflightEcho.clear();
justRemovedEndpoints.clear();
expireTimeEndpointMap.clear();
endpointStateMap.clear();
@ -725,6 +729,7 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean,
logger.warn("Seeds list is now empty!");
}
inflightEcho.remove(endpoint);
if (disableEndpointRemoval)
return;
@ -1431,14 +1436,24 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean,
{
localState.markDead();
Message<NoPayload> echoMessage = Message.out(ECHO_REQ, noPayload);
logger.trace("Sending ECHO_REQ to {}", addr);
RequestCallback echoHandler = msg ->
EndpointState prevState = inflightEcho.put(addr, localState);
boolean sendEcho = !localState.equals(prevState);
if (sendEcho)
{
runInGossipStageBlocking(() -> realMarkAlive(addr, localState));
};
MessagingService.instance().sendWithCallback(echoMessage, addr, echoHandler);
Message<NoPayload> echoMessage = Message.out(ECHO_REQ, noPayload);
logger.trace("Sending ECHO_REQ to {}", addr);
RequestCallback echoHandler = msg ->
{
runInGossipStageBlocking(() -> {
EndpointState epState = inflightEcho.remove(addr);
if (epState != null)
realMarkAlive(addr, epState);
});
};
MessagingService.instance().sendWithCallback(echoMessage, addr, echoHandler);
}
else
logger.trace("Skipping ECHO_REQ to {} since it is already inflight", addr);
GossiperDiagnostics.markedAlive(this, addr, localState);
}
@ -1488,6 +1503,7 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean,
private void silentlyMarkDead(InetAddressAndPort addr, EndpointState localState)
{
localState.markDead();
inflightEcho.remove(addr);
if (!disableEndpointRemoval)
{
liveEndpoints.remove(addr);