[
https://issues.apache.org/jira/browse/HDDS-12810?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Sammi Chen reassigned HDDS-12810:
---------------------------------
Assignee: Chu Cheng Li
> Check and reserve space atomically in VolumeChoosingPolicy
> ----------------------------------------------------------
>
> Key: HDDS-12810
> URL: https://issues.apache.org/jira/browse/HDDS-12810
> Project: Apache Ozone
> Issue Type: Sub-task
> Components: Ozone Datanode
> Reporter: Chu Cheng Li
> Assignee: Chu Cheng Li
> Priority: Major
> Labels: pull-request-available
> Fix For: 2.1.0
>
>
> If VolumeChoosingPolicy#chooseVolume is not synchronized and caller required
> space reserved before chooseVolume returns, there is no easy way to guarantee
> chosen volume will have enough space.
> VolumeChoosingPolicy#chooseVolume is used for create container and container
> import. Make VolumeChoosingPolicy#chooseVolume synchronized or part of
> chooseVolume synchronized will add some latency, which is negligible for
> container import, may noticeable for create container. We can compare the
> create container latency metrics with and without the synchronization.
>
> VolumeChoosingPolicy#chooseVolume, its Java Doc says "The implementations of
> this interface must be thread-safe.", regarding the space full check and
> space reservation, it can be done as an atomic operation in the chooseVolume
> internally, so that there will no over allocation of space due to concurrent
> container creation and container import.
>
> Also need to add test to check if committedBytes is checked in container
> creation unit tests and container import, container replication unit tests.
> If not, could you add the committedBytes checks? Besides, we also need the
> unit tests to verify that if the container creation fails, container import
> fails, or container replication fails, the resevered committedBytes are
> released.
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]