Skip to content

Commit 6ccc9d1

Browse files
committed
Merge branch 'cassandra-6.0' into trunk
2 parents 5816595 + 57ecd4c commit 6ccc9d1

2 files changed

Lines changed: 26 additions & 6 deletions

File tree

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Merged from 5.0:
3434
* Use estimated compressed size for tables to check if there is enough free space for a compaction (CASSANDRA-21245)
3535
* Fix failing select on system_views.settings for non-string keys (CASSANDRA-21348)
3636
Merged from 4.0:
37+
* Remove inFlightEcho entry on ECHO_REQ failure (CASSANDRA-21428)
3738
* Validate snapshot names (CASSANDRA-21389)
3839

3940

src/java/org/apache/cassandra/gms/Gossiper.java

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
import org.apache.cassandra.db.SystemKeyspace;
7070
import org.apache.cassandra.dht.IPartitioner;
7171
import org.apache.cassandra.dht.Token;
72+
import org.apache.cassandra.exceptions.RequestFailure;
7273
import org.apache.cassandra.locator.InetAddressAndPort;
7374
import org.apache.cassandra.net.Message;
7475
import org.apache.cassandra.net.MessagingService;
@@ -659,6 +660,7 @@ static int getMaxEndpointStateVersion(EndpointState epState)
659660
public void evictFromMembership(InetAddressAndPort endpoint)
660661
{
661662
checkProperThreadForStateMutation();
663+
inflightEcho.remove(endpoint);
662664
unreachableEndpoints.remove(endpoint);
663665
endpointStateMap.remove(endpoint);
664666
expireTimeEndpointMap.remove(endpoint);
@@ -1201,13 +1203,30 @@ private void markAlive(final InetAddressAndPort addr, final EndpointState localS
12011203
{
12021204
Message<NoPayload> echoMessage = Message.out(ECHO_REQ, noPayload);
12031205
logger.trace("Sending ECHO_REQ to {}", addr);
1204-
RequestCallback echoHandler = msg ->
1206+
RequestCallback echoHandler = new RequestCallback()
12051207
{
1206-
runInGossipStageBlocking(() -> {
1207-
EndpointState epState = inflightEcho.remove(addr);
1208-
if (epState != null)
1209-
realMarkAlive(addr, epState);
1210-
});
1208+
@Override
1209+
public void onResponse(Message msg)
1210+
{
1211+
runInGossipStageBlocking(() -> {
1212+
EndpointState epState = inflightEcho.remove(addr);
1213+
if (epState != null)
1214+
realMarkAlive(addr, epState);
1215+
});
1216+
}
1217+
1218+
@Override
1219+
public boolean invokeOnFailure()
1220+
{
1221+
return true;
1222+
}
1223+
1224+
@Override
1225+
public void onFailure(InetAddressAndPort from, RequestFailure requestFailure)
1226+
{
1227+
logger.trace("ECHO_REQ to {} failed ({})", addr, requestFailure);
1228+
inflightEcho.remove(addr);
1229+
}
12111230
};
12121231
MessagingService.instance().sendWithCallback(echoMessage, addr, echoHandler);
12131232
}

0 commit comments

Comments
 (0)