rich7420 opened a new pull request, #11057:
URL: https://github.com/apache/ozone/pull/11057
## What changes were proposed in this pull request?
OMAllocateBlockRequest.validateAndUpdateCache computes the already-allocated
key size only to multiply by the block size, but calls getLocationList()
(documented as not O(1)) purely to read size(), then discards the list — on
every block allocation, under the bucket write lock:
long hadAllocatedKeySize =
openKeyInfo.getLatestVersionLocations().getLocationList().size()
* ozoneManager.getScmBlockSize();
Fix: use getLocationListCount()
(values().stream().mapToLong(List::size).sum()), which returns the same total
with no allocation. The result already widens to long for the multiplication,
so the value is unchanged. Behavior unchanged.
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-16211
## How was this patch tested?
https://github.com/rich7420/ozone/actions/runs/32219890598
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]