ChenSammi commented on PR #8090: URL: https://github.com/apache/ozone/pull/8090#issuecomment-2735189904
> @ChenSammi Thanks for heads up. > > > which is the core part to preventing space over allocation. > > ` Further, 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.` > > I think that requires: [HDDS-12556. Use closable handle to allocate and release committed bytes](https://issues.apache.org/jira/browse/HDDS-12556), as currently VolumeChoosingPolicy just select and return a volume, and the real allocate part isn't its scope. Making it synchronize would just prevent race condition on the volumeList. 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. Refer to #7981 which do double check after chooseVolume returns. (https://issues.apache.org/jira/browse/HDDS-12556) aims to provide a auto closeable handler, so that committedSpace can be auto adjusted when handler is closed, avoid the case that committedSpace adjustment is forget. It doesn't include the goal to avoid over allocation. -- 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]
