[
https://issues.apache.org/jira/browse/HDDS-116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16494505#comment-16494505
]
Hanisha Koneru commented on HDDS-116:
-------------------------------------
Thanks for the review [~xyao].
{quote}nextVolumeIndex can be replaced with a LongAdder. This way, we might not
need a policy lock.{quote}
But we do not just update the {{nextVolumeIndex}} incrementally by one. Also,
IIUC, LongAdder is preferred when multiple threads update a common sum. Here,
we need to be able to change the value.
I think we can instead use AtomicLong? Thoughts?
{quote}Line 40-51: we need to grab the volumeset lock here to avoid changes
during the choosing. Assuming we get a unmodifible list from VolumeSet, the
actual volume in VolumeSet may still be removed even with the
RRVolumeChoosingPolicy lock in line 51, resulting in I/O error when writing to
a removed volume.{quote}
Even if we grab the VolumeSet lock here, the Container to which this volume is
returned might still write to a removed volume. We should have the calling
function grab a lock the VolumeSet when passing the volumeList to
RRVolumeChoosingPolicy.
I am working on addressing rest of the comments.
> Implement VolumeSet to manage disk volumes
> ------------------------------------------
>
> Key: HDDS-116
> URL: https://issues.apache.org/jira/browse/HDDS-116
> Project: Hadoop Distributed Data Store
> Issue Type: Sub-task
> Reporter: Hanisha Koneru
> Assignee: Hanisha Koneru
> Priority: Major
> Labels: ContainerIO
> Fix For: 0.2.1
>
> Attachments: HDDS-116-HDDS-48.001.patch, HDDS-116-HDDS-48.002.patch,
> HDDS-116-HDDS-48.003.patch
>
>
> VolumeSet would be responsible for managing volumes in the Datanode. Some of
> its functions are:
> # Initialize volumes on startup
> # Provide APIs to add/ remove volumes
> # Choose and return volume to calling service based on the volume choosingÂ
> policy (currently implemented Round Robin choosing policy)
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]