| | |
| | | lastAliveCSNs.getCSN(mc.getFirst(), mcCSN.getServerId()); |
| | | return mcCSN.isOlderThan(lastTimeSameReplicaSeenAlive); |
| | | } |
| | | // ensure that all initial replicas alive information have been updated |
| | | // with CSNs that are acceptable for moving the medium consistency forward |
| | | return allInitialReplicasArePastOldestPossibleCSN(); |
| | | } |
| | | |
| | | private boolean allInitialReplicasArePastOldestPossibleCSN() |
| | | { |
| | | for (DN baseDN : lastAliveCSNs) |
| | | { |
| | | for (CSN csn : lastAliveCSNs.getServerState(baseDN)) |
| | | { |
| | | if (csn.getTime() == 0) |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | |
| | | |
| | | for (Integer serverId : entry.getValue()) |
| | | { |
| | | final CSN csn = mediumConsistencyRUV.getCSN(baseDN, serverId); |
| | | /* |
| | | * initialize with the oldest possible CSN in order for medium |
| | | * consistency to wait for all replicas to be alive before moving |
| | | * forward |
| | | */ |
| | | lastAliveCSNs.update(baseDN, oldestPossibleCSN(serverId)); |
| | | // start after the actual CSN when initializing from the previous cookie |
| | | final CSN csn = mediumConsistencyRUV.getCSN(baseDN, serverId); |
| | | ensureCursorExists(baseDN, serverId, csn); |
| | | } |
| | | |
| | |
| | | this.changelogState = null; |
| | | } |
| | | |
| | | private CSN oldestPossibleCSN(int serverId) |
| | | { |
| | | return new CSN(0, 0, serverId); |
| | | } |
| | | |
| | | private void resetNextChangeForInsertDBCursor() throws ChangelogException |
| | | { |
| | | final Map<DBCursor<UpdateMsg>, DN> cursors = |