mirror of https://github.com/apache/cassandra
Avoid trying to get replication factor for system_cluster_metadata before we have a CMS
Patch by marcuse; reviewed by Sam Tunnicliffe for CASSANDRA-19269
This commit is contained in:
parent
7f354571f3
commit
43eb2a4bde
|
|
@ -60,7 +60,9 @@ public class MetaStrategy extends SystemStrategy
|
|||
@Override
|
||||
public ReplicationFactor getReplicationFactor()
|
||||
{
|
||||
ClusterMetadata metadata = ClusterMetadata.current();
|
||||
ClusterMetadata metadata = ClusterMetadata.currentNullable();
|
||||
if (metadata == null || metadata.epoch.isEqualOrBefore(Epoch.FIRST))
|
||||
return ReplicationFactor.fullOnly(1);
|
||||
int rf = metadata.placements.get(ReplicationParams.meta(metadata)).writes.forRange(entireRange).get().byEndpoint.size();
|
||||
return ReplicationFactor.fullOnly(rf);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue