Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOLR-16843: Replace timeNs by epochTimeNs in most of autoscaling #2679

Open
wants to merge 1 commit into
base: branch_8_11
Choose a base branch
from

Conversation

psalagnac
Copy link

SOLR-16843

Description

Autoscaling framework use timestamps returned by the JVM call System.nanoTime(), but according to the Javadoc, this is NOT an absolute timestamp. This is just a number relative to a random origin, and this origin will change each time the JVM is restarted.

This timestamp cannot be re-used across JVM instances (either in another Solr node or same node after JVM restart).

Solution

For all timestamps that are either persisted at some point or used for event timestamps, use getEpochTimeNs() instead of getTimeNs(). Values returned by getEpochTimeNs() are absolute and can be safely compared.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant