mirror of https://github.com/apache/cassandra
Merge branch 'cassandra-4.1' into trunk
* cassandra-4.1: EndpointState is mutable, so we must copy it before trying to serialize
This commit is contained in:
commit
45e00ea92f
|
|
@ -97,6 +97,7 @@
|
|||
* Add guardrail for ALTER TABLE ADD / DROP / REMOVE column operations (CASSANDRA-17495)
|
||||
* Rename DisableFlag class to EnableFlag on guardrails (CASSANDRA-17544)
|
||||
Merged from 4.1:
|
||||
* Fix PAXOS2_COMMIT_AND_PREPARE_RSP serialisation AssertionError (CASSANDRA-18164)
|
||||
* Streaming progress virtual table lock contention can trigger TCP_USER_TIMEOUT and fail streaming (CASSANDRA-18110)
|
||||
* Fix perpetual load of denylist on read in cases where denylist can never be loaded (CASSANDRA-18116)
|
||||
Merged from 4.0:
|
||||
|
|
|
|||
|
|
@ -1143,6 +1143,14 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean
|
|||
return endpointStateMap.get(ep);
|
||||
}
|
||||
|
||||
public EndpointState copyEndpointStateForEndpoint(InetAddressAndPort ep)
|
||||
{
|
||||
EndpointState epState = endpointStateMap.get(ep);
|
||||
if (epState == null)
|
||||
return null;
|
||||
return new EndpointState(epState);
|
||||
}
|
||||
|
||||
public ImmutableSet<InetAddressAndPort> getEndpoints()
|
||||
{
|
||||
return ImmutableSet.copyOf(endpointStateMap.keySet());
|
||||
|
|
|
|||
|
|
@ -1156,8 +1156,8 @@ public class Paxos
|
|||
return emptyMap();
|
||||
|
||||
Map<InetAddressAndPort, EndpointState> endpoints = Maps.newHashMapWithExpectedSize(remoteElectorate.size() + localElectorate.size());
|
||||
remoteElectorate.forEach(host -> endpoints.put(host, Gossiper.instance.getEndpointStateForEndpoint(host)));
|
||||
localElectorate.forEach(host -> endpoints.putIfAbsent(host, Gossiper.instance.getEndpointStateForEndpoint(host)));
|
||||
remoteElectorate.forEach(host -> endpoints.put(host, Gossiper.instance.copyEndpointStateForEndpoint(host)));
|
||||
localElectorate.forEach(host -> endpoints.putIfAbsent(host, Gossiper.instance.copyEndpointStateForEndpoint(host)));
|
||||
|
||||
return endpoints;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue