Skip to content

Conversation

@siddhantsangwan
Copy link
Contributor

What changes were proposed in this pull request?

From the jira:

Similar to HDDS-7463, we are seeing that commands sent from SCM to the datanodes are being expired when they should not be. This is because we are getting the command deadline from MonotonicClock and then comparing that with the current time, also gotten from MonotonicClock on the datanodes.
As we discovered in HDDS-7463, the "Time" monotonic clock uses is not system time, but some arbitrary reference point in the JVM. We cannot use the time from monotonic clock to compare times across JVM restarts, or in different JVMs.
For that reason, I believe it would be safer to replace any usages of Monotonic clock with java.util.SystemClock.

This PR replaces usages of MonotonicClock with SystemClock from Clock in the java.time package.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-7692

Copy link
Contributor

@sodonnel sodonnel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I believe we need to remove the usage of the MonotonicClock as its caused a few problems, and the only alternative I can think of is to use the System clock instead.

@sodonnel sodonnel merged commit b167d99 into apache:master Dec 22, 2022
jojochuang pushed a commit to jojochuang/ozone that referenced this pull request Feb 6, 2023
…k instead (apache#4121)

(cherry picked from commit b167d99)
Change-Id: Iee4d785156cca52b45bac13ffc22c173e820ac5e
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.

2 participants