[
https://issues.apache.org/jira/browse/HDFS-17479?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ZanderXu updated HDFS-17479:
----------------------------
Attachment: image-2024-04-18-11-00-12-451.png
> [FGL] Snapshot related operations still use global lock
> -------------------------------------------------------
>
> Key: HDFS-17479
> URL: https://issues.apache.org/jira/browse/HDFS-17479
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Reporter: ZanderXu
> Priority: Major
> Attachments: image-2024-04-18-11-00-02-011.png,
> image-2024-04-18-11-00-12-451.png
>
>
> Snapshot feature is a very useful feature in certain scenarios. As far as I
> know, very few companies use this feature on the prod environment. The
> implementation is complex and it is difficult to support FGL with only a
> minor modifications.
> So we can still use the Global lock to make snapshot-related operations
> thread-safe.
>
> Snapshot has some access modules, let's analyze them and find a way to still
> use GlobalLock.
>
> !image-2024-04-18-10-31-34-458.png|width=288,height=219!
> The above picture shows a simple case, we can access the iNode foo through
> the following paths:
> # /abc/foo
> # /abc/.snapshot/s1/foo
> If we want to delete the iNode foo, we need to lock /abc and
> /abc/.snapshot/s1 (DirectoryWithSnapshotFeature on iNode abc).
> If we want to change permission of the iNode foo, we need to lock /abc/foo
> and /abc/.snapshot/s1/foo (DirectoryWithSnapshotFeature on the iNode foo)
>
> For this case, we can directly acquire the global lock when resolving the
> IIPs for the input path if there is an iNode that has
> DirectorySnapshottableFeature.
> !image-2024-04-18-10-48-08-773.png|width=368,height=383!
> After /abc/foo is renamed to /xyz/bar, the access modules will be changed, as
> the above picture shows. We can access this bar through the following path:
> # /abc/.snapshot/s1/bar
> # /xyz/bar
> For /abc/.snapshot/s1/bar, since the iNode abc has
> DirectorySnapshottableFeature, so we can identify it and acquire the global
> lock.
> For /xyz/bar, we can identify it through Reference flag, since the iNode bar
> is a DstReference Node.
>
> So we can use DirectorySnapshottableFeature and Reference to determine if we
> need to acquire the Global lock when resolving the IIPs for input path.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]