public Iterable<InetAddress> replicasMissingMostRecentCommit(CFMetaData metadata, int nowInSec) { // In general, we need every replicas that have answered to the prepare (a quorum) to agree on the MRC (see // coment in StorageProxy.beginAndRepairPaxos(), but basically we need to make sure at least a quorum of nodes // have learn a commit before commit a new one otherwise that previous commit is not guaranteed to have reach a // quorum and further commit may proceed on incomplete information). // However, if that commit is too hold, it may have been expired from some of the replicas paxos table (we don't // keep the paxos state forever or that could grow unchecked), and we could end up in some infinite loop as // explained on CASSANDRA-12043. To avoid that, we ignore a MRC that is too old, i.e. older than the TTL we set // on paxos tables. For such old commit, we rely on hints and repair to ensure the commit has indeed be // propagated to all nodes. long paxosTtlSec = SystemKeyspace.paxosTtlSec(metadata); if (UUIDGen.unixTimestampInSec(mostRecentCommit.ballot) + paxosTtlSec < nowInSec) return Collections.emptySet(); return Iterables.filter(commitsByReplica.keySet(), new Predicate<InetAddress>() { public boolean apply(InetAddress inetAddress) { return (!commitsByReplica.get(inetAddress).ballot.equals(mostRecentCommit.ballot)); } }); } }
public Iterable<InetAddress> replicasMissingMostRecentCommit(CFMetaData metadata, int nowInSec) { // In general, we need every replicas that have answered to the prepare (a quorum) to agree on the MRC (see // coment in StorageProxy.beginAndRepairPaxos(), but basically we need to make sure at least a quorum of nodes // have learn a commit before commit a new one otherwise that previous commit is not guaranteed to have reach a // quorum and further commit may proceed on incomplete information). // However, if that commit is too hold, it may have been expired from some of the replicas paxos table (we don't // keep the paxos state forever or that could grow unchecked), and we could end up in some infinite loop as // explained on CASSANDRA-12043. To avoid that, we ignore a MRC that is too old, i.e. older than the TTL we set // on paxos tables. For such old commit, we rely on hints and repair to ensure the commit has indeed be // propagated to all nodes. long paxosTtlSec = SystemKeyspace.paxosTtlSec(metadata); if (UUIDGen.unixTimestampInSec(mostRecentCommit.ballot) + paxosTtlSec < nowInSec) return Collections.emptySet(); return Iterables.filter(commitsByReplica.keySet(), new Predicate<InetAddress>() { public boolean apply(InetAddress inetAddress) { return (!commitsByReplica.get(inetAddress).ballot.equals(mostRecentCommit.ballot)); } }); } }
public Iterable<InetAddress> replicasMissingMostRecentCommit(CFMetaData metadata, int nowInSec) { // In general, we need every replicas that have answered to the prepare (a quorum) to agree on the MRC (see // coment in StorageProxy.beginAndRepairPaxos(), but basically we need to make sure at least a quorum of nodes // have learn a commit before commit a new one otherwise that previous commit is not guaranteed to have reach a // quorum and further commit may proceed on incomplete information). // However, if that commit is too hold, it may have been expired from some of the replicas paxos table (we don't // keep the paxos state forever or that could grow unchecked), and we could end up in some infinite loop as // explained on CASSANDRA-12043. To avoid that, we ignore a MRC that is too old, i.e. older than the TTL we set // on paxos tables. For such old commit, we rely on hints and repair to ensure the commit has indeed be // propagated to all nodes. long paxosTtlSec = SystemKeyspace.paxosTtlSec(metadata); if (UUIDGen.unixTimestampInSec(mostRecentCommit.ballot) + paxosTtlSec < nowInSec) return Collections.emptySet(); return Iterables.filter(commitsByReplica.keySet(), new Predicate<InetAddress>() { public boolean apply(InetAddress inetAddress) { return (!commitsByReplica.get(inetAddress).ballot.equals(mostRecentCommit.ballot)); } }); } }
try int nowInSec = UUIDGen.unixTimestampInSec(proposal.ballot); PaxosState state = SystemKeyspace.loadPaxosState(proposal.update.partitionKey(), proposal.update.metadata(), nowInSec); if (proposal.hasBallot(state.promised.ballot) || proposal.isAfter(state.promised))
try int nowInSec = UUIDGen.unixTimestampInSec(proposal.ballot); PaxosState state = SystemKeyspace.loadPaxosState(proposal.update.partitionKey(), proposal.update.metadata(), nowInSec); if (proposal.hasBallot(state.promised.ballot) || proposal.isAfter(state.promised))
try int nowInSec = UUIDGen.unixTimestampInSec(proposal.ballot); PaxosState state = SystemKeyspace.loadPaxosState(proposal.update.partitionKey(), proposal.update.metadata(), nowInSec); if (proposal.hasBallot(state.promised.ballot) || proposal.isAfter(state.promised))
int nowInSec = UUIDGen.unixTimestampInSec(toPrepare.ballot); PaxosState state = SystemKeyspace.loadPaxosState(toPrepare.update.partitionKey(), toPrepare.update.metadata(), nowInSec); if (toPrepare.isAfter(state.promised))
int nowInSec = UUIDGen.unixTimestampInSec(toPrepare.ballot); PaxosState state = SystemKeyspace.loadPaxosState(toPrepare.update.partitionKey(), toPrepare.update.metadata(), nowInSec); if (toPrepare.isAfter(state.promised))
int nowInSec = UUIDGen.unixTimestampInSec(toPrepare.ballot); PaxosState state = SystemKeyspace.loadPaxosState(toPrepare.update.partitionKey(), toPrepare.update.metadata(), nowInSec); if (toPrepare.isAfter(state.promised))