Skip to content

Conversation

@adoroszlai
Copy link
Contributor

What changes were proposed in this pull request?

Fix time unit mismatch in container metadata scanner. Elapsed time is measured in nanoseconds, needs to be converted to milliseconds.

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

How was this patch tested?

Tested on ozone docker-compose cluster.

datanode_1  | 2019-10-09 06:18:00 INFO  ContainerMetadataScanner:60 - Background ContainerMetadataScanner starting up
datanode_1  | 2019-10-09 06:18:00 INFO  ContainerMetadataScanner:88 - Completed an iteration of container metadata scrubber in 0 minutes. Number of  iterations (since the data-node restart) : 1, Number of containers scanned in this iteration : 0, Number of unhealthy containers found in this iteration : 0
datanode_1  | 2019-10-09 06:19:00 INFO  ContainerMetadataScanner:88 - Completed an iteration of container metadata scrubber in 0 minutes. Number of  iterations (since the data-node restart) : 2, Number of containers scanned in this iteration : 2, Number of unhealthy containers found in this iteration : 0
...
datanode_1  | STARTUP_MSG: Starting HddsDatanodeService
datanode_1  | 2019-10-09 06:23:52 INFO  ContainerMetadataScanner:60 - Background ContainerMetadataScanner starting up
datanode_1  | 2019-10-09 06:23:52 INFO  ContainerMetadataScanner:88 - Completed an iteration of container metadata scrubber in 0 minutes. Number of  iterations (since the data-node restart) : 1, Number of containers scanned in this iteration : 2, Number of unhealthy containers found in this iteration : 0
datanode_1  | 2019-10-09 06:24:52 INFO  ContainerMetadataScanner:88 - Completed an iteration of container metadata scrubber in 0 minutes. Number of  iterations (since the data-node restart) : 2, Number of containers scanned in this iteration : 2, Number of unhealthy containers found in this iteration : 0

@xiaoyuyao
Copy link
Contributor

Thanks @adoroszlai for fixing this. The change LGTM.

@elek
Copy link
Member

elek commented Oct 16, 2019

My previous comments are not addressed but it was an optional suggestion. I commit it right now as it's better than the current code.

From the old PR:

Thanks to fix it @adoroszlai. Nice catch.

As the millisecond resolution is enough I think it can be more safer to use type-safe java API:

Sg like:

Instant start = Instant.now();

...

nextCheck = start.plus(metadataScanInterval, ChronoUnit.SECONDS)
remainingMs = Instant.now().until(nextCheck, ChronoUnit.MILLIS)
Time.sleep(remainingMs)

But I am also fine with the current patch as it's definitely better than the earlier code ;-)

@elek elek closed this in fecdba7 Oct 16, 2019
@adoroszlai adoroszlai deleted the HDDS-2267 branch October 16, 2019 11:08
@adoroszlai
Copy link
Contributor Author

Thanks @xiaoyuyao for the review. Thanks @elek for reviewing and committing it. I like your idea about using type-safe time objects and applied it to #7. But here I wanted to minimize the change.

@elek
Copy link
Member

elek commented Oct 17, 2019

But here I wanted to minimize the change.

Fair enough, and it seems to be a good newbie jira, I will create one...

GlenGeng-awx referenced this pull request in GlenGeng-awx/hadoop-ozone Sep 18, 2020
kuenishi referenced this pull request in pfnet/ozone Feb 22, 2022
* Bump version
tanvipenumudy added a commit to tanvipenumudy/ozone that referenced this pull request May 12, 2022
# This is the 1st commit message:

Initial Commit

# This is the commit message apache#2:

more slight changes

# This is the commit message apache#3:

changes++

# This is the commit message apache#4:

getExecutorService Changes

# This is the commit message apache#5:

applyTransaction() Changes

# This is the commit message apache#6:

changes++

# This is the commit message apache#7:

TestOzoneManagerLock changes

# This is the commit message apache#8:

add changes

# This is the commit message apache#9:

add more minor changes

# This is the commit message apache#10:

add config to ozone-default.xml

# This is the commit message apache#11:

minor changes

# This is the commit message apache#12:

change modulo logic

# This is the commit message apache#13:

changes

# This is the commit message apache#14:

changes++

# This is the commit message apache#15:

add changes++

# This is the commit message apache#16:

minor changes

# This is the commit message apache#17:

Changes (to be reverted)

# This is the commit message apache#18:

Changes 09/05
vtutrinov pushed a commit to vtutrinov/ozone that referenced this pull request Apr 7, 2025
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.

3 participants