Merge branch 'cassandra-4.1' into trunk

This commit is contained in:
Stefan Miklosovic 2023-05-30 22:22:40 +02:00
commit cccc46cb23
No known key found for this signature in database
GPG Key ID: 32F35CB2F546D93E
2 changed files with 21 additions and 14 deletions

View File

@ -144,6 +144,13 @@ Merged from 4.0:
* Partial compaction can resurrect deleted data (CASSANDRA-18507)
4.1.3
Merged from 4.0:
* Remove unnecessary shuffling of GossipDigests in Gossiper#makeRandomGossipDigest (CASSANDRA-18546)
Merged from 3.11:
Merged from 3.0:
4.1.2
* NPE when deserializing malformed collections from client (CASSANDRA-18505)
* Allow keystore and trustrore passwords to be nullable (CASSANDRA-18124)

View File

@ -317,7 +317,7 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean
logger.trace("My heartbeat is now {}", endpointStateMap.get(FBUtilities.getBroadcastAddressAndPort()).getHeartBeatState().getHeartBeatVersion());
final List<GossipDigest> gDigests = new ArrayList<>();
Gossiper.instance.makeRandomGossipDigest(gDigests);
Gossiper.instance.makeGossipDigest(gDigests);
if (gDigests.size() > 0)
{
@ -741,29 +741,29 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean
}
/**
* The gossip digest is built based on randomization
* rather than just looping through the collection of live endpoints.
*
* @param gDigests list of Gossip Digests.
* @param gDigests list of Gossip Digests to be filled
*/
private void makeRandomGossipDigest(List<GossipDigest> gDigests)
private void makeGossipDigest(List<GossipDigest> gDigests)
{
EndpointState epState;
int generation = 0;
int maxVersion = 0;
int generation;
int maxVersion;
// local epstate will be part of endpointStateMap
List<InetAddressAndPort> endpoints = new ArrayList<>(endpointStateMap.keySet());
Collections.shuffle(endpoints, random);
for (InetAddressAndPort endpoint : endpoints)
for (Entry<InetAddressAndPort, EndpointState> entry : endpointStateMap.entrySet())
{
epState = endpointStateMap.get(endpoint);
epState = entry.getValue();
if (epState != null)
{
generation = epState.getHeartBeatState().getGeneration();
maxVersion = getMaxEndpointStateVersion(epState);
}
gDigests.add(new GossipDigest(endpoint, generation, maxVersion));
else
{
generation = 0;
maxVersion = 0;
}
gDigests.add(new GossipDigest(entry.getKey(), generation, maxVersion));
}
if (logger.isTraceEnabled())
@ -2621,7 +2621,7 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean
}
final List<GossipDigest> gDigests = new ArrayList<GossipDigest>();
Gossiper.instance.makeRandomGossipDigest(gDigests);
Gossiper.instance.makeGossipDigest(gDigests);
GossipDigestSyn digestSynMessage = new GossipDigestSyn(getClusterName(),
getPartitionerName(),