Skip to content

Conversation

@runzhiwang
Copy link
Contributor

@runzhiwang runzhiwang commented Jul 14, 2020

What changes were proposed in this pull request?

What's the problem ?
When write DB_PENDING_DELETE_BLOCK_COUNT_KEY to rocksdb, most code convert value to byte array by Longs.toByteArray. But when read, parseKVContainerData use Ints.fromByteArray. The result is always wrong, unless the value is zero.
image

image

For example, Longs.toByteArray(1) return byte array in which only byte[7] is 1, but Ints.fromByteArray only parse the first 4 bytes of byte array. So write 1, but read out 0.
image
image

What is the link to the Apache JIRA

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

How was this patch tested?

add assert in current ut.

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Thanks @runzhiwang for fixing this.

@hanishakoneru
Copy link
Contributor

Thanks @runzhiwang for fixing this and @adoroszlai for reviewing it.
+1. Will merge the PR.

@hanishakoneru hanishakoneru merged commit 6d979e4 into apache:master Jul 14, 2020
ChenSammi pushed a commit that referenced this pull request Jul 22, 2020
rakeshadr pushed a commit to rakeshadr/hadoop-ozone that referenced this pull request Sep 3, 2020
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.

4 participants