LocalReplicator uses System.currentTimeMillis() for session expiry, which is not guaranteed monotonic.
Thanks Ishan Chattopadhyaya!
Commit 1707684 from Michael McCandless in branch 'dev/branches/branch_5x'
[ https://svn.apache.org/r1707684 ]
LUCENE-6823: use System.nanoTime for expiration in LocalReplicator
Commit 1707683 from Michael McCandless in branch 'dev/trunk'
[ https://svn.apache.org/r1707683 ]
Thanks Ishan Chattopadhyaya, patch looks good, I'll commit shortly.
Thanks for the pointer, Steve Rowe. I copied it from ControlledRealTimeReopenThread's line 179:
long startMS = System.nanoTime()/1000000;
I'll add another patch.
Ishan Chattopadhyaya, it's better to convert between time units using TimeUnit.TARGETUNIT.convert(sourceDuration, TimeUnit.SOURCEUNIT), rather than using hard-coded conversion constants, which could be accidentally wrong. E.g. to convert from nanos to millis: TimeUnit.MILLISECONDS.convert(nanoseconds, TimeUnit.NANOSECONDS).
Patch to replace it with System.nanoTime()/1000000.