runzhiwang opened a new pull request #1199:
URL: https://github.com/apache/hadoop-ozone/pull/1199


   ## 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](https://user-images.githubusercontent.com/51938049/87388645-ca3f2d80-c5d7-11ea-9ac1-75fcf348ae79.png)
   
   
![image](https://user-images.githubusercontent.com/51938049/87388853-2efa8800-c5d8-11ea-9568-50ee6beca04b.png)
   
   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](https://user-images.githubusercontent.com/51938049/87388967-6701cb00-c5d8-11ea-8597-fb909a531875.png)
   
![image](https://user-images.githubusercontent.com/51938049/87389100-b1834780-c5d8-11ea-9310-ded8caec57a5.png)
   
   
   ## 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.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to