[
https://issues.apache.org/jira/browse/HDDS-15656?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ashish Kumar updated HDDS-15656:
--------------------------------
Epic Link: (was: HDDS-15534)
> sizeActuallyMovedInLatestIteration can give wrong result
> ---------------------------------------------------------
>
> Key: HDDS-15656
> URL: https://issues.apache.org/jira/browse/HDDS-15656
> Project: Apache Ozone
> Issue Type: Sub-task
> Reporter: Ashish Kumar
> Priority: Major
>
>
> Multiple container moves can complete simultaneously, and each
> {{whenComplete}} callback executes in its own thread. The compound {{+=}}
> operation on a {{long}} is not atomic and can produce incorrect results.
> {code:java}
> future = future.whenComplete((result, ex) -> {
> metrics.incrementCurrentIterationContainerMoveMetric(result,1);
> moveSelectionToFutureMap.remove(moveSelection);
> if(ex !=null) {
> ... } else {
> if(result ==MoveManager.MoveResult.COMPLETED){
> sizeActuallyMovedInLatestIteration += // ← non-atomic
> containerInfo.getUsedBytes(); {code}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]