mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Replication updates with local identifier shouldn't use the same timestamp, because this allows two different updates which replace each other on different nodes, and don't converge. Extend default TimeProvider precision to nanoseconds, to exclude possibility of 'microsecond overflow' on frequent changes to the same entry
This commit is contained in:
+1
-6
@@ -128,12 +128,7 @@ public abstract class ReplicatedMapEntryStages<K, V> extends MapEntryStages<K, V
|
||||
public void updatedReplicationStateOnPresentEntry() {
|
||||
if (!ru.replicationUpdateInit()) {
|
||||
s.innerWriteLock.lock();
|
||||
long timestamp;
|
||||
if (identifier() != mh.m().identifier()) {
|
||||
timestamp = Math.max(timestamp() + 1, mh.m().timeProvider.currentTime());
|
||||
} else {
|
||||
timestamp = mh.m().timeProvider.currentTime();
|
||||
}
|
||||
long timestamp = Math.max(timestamp() + 1, mh.m().timeProvider.currentTime());
|
||||
updateReplicationState(mh.m().identifier(), timestamp);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user