pilorama: Fix duplicate directory handling #1234

Merged
fyrchik merged 2 commits from fyrchik/frostfs-node:fix-duplicate-directory into master 2024-07-10 06:11:42 +00:00
Owner

Consider a/b/c and a/b/x being created concurrently.
Internal nodes a/b and a/b will be different even after synchronization, as unique ID is generated for each of them.
Currently, GetByPath() takes only one path, because it assumes no other paths exist.
This commit fixes the issue by using sets of nodes instead of a single node during traversal.

Consider `a/b/c` and `a/b/x` being created concurrently. Internal nodes `a/b` and `a/b` will be different even after synchronization, as unique ID is generated for each of them. Currently, GetByPath() takes only one path, because it assumes no other paths exist. This commit fixes the issue by using sets of nodes instead of a single node during traversal.
fyrchik requested review from storage-core-committers 2024-07-08 11:04:41 +00:00
fyrchik requested review from storage-core-developers 2024-07-08 11:04:42 +00:00
fyrchik force-pushed fix-duplicate-directory from ac446febbe to c8272bfd9b 2024-07-08 11:05:13 +00:00 Compare
fyrchik force-pushed fix-duplicate-directory from c8272bfd9b to 11129661ac 2024-07-08 11:08:00 +00:00 Compare
aarifullin reviewed 2024-07-08 12:18:37 +00:00
@ -1412,6 +1414,36 @@ func (t *boltForest) TreeListTrees(ctx context.Context, prm TreeListTreesPrm) (*
return &res, nil
}
func (t *boltForest) getPathPrefixNew(bTree *bbolt.Bucket, attr string, path []string) (int, []Node, error) {
Member

After ...New we'll need the ...Newest? :)

Let's rename it to getPathPrefixDepthTraverse?

After `...New` we'll need the `...Newest`? :) Let's rename it to `getPathPrefixDepthTraverse`?
Author
Owner

Right, was from testing, fixed

Right, was from testing, fixed
aarifullin marked this conversation as resolved
fyrchik force-pushed fix-duplicate-directory from 11129661ac to 00be714af6 2024-07-08 12:27:36 +00:00 Compare
aarifullin approved these changes 2024-07-08 12:56:27 +00:00
aarifullin left a comment
Member

LGTM

LGTM
dstepanov-yadro approved these changes 2024-07-08 13:15:31 +00:00
dkirillov approved these changes 2024-07-08 14:50:21 +00:00
acid-ant approved these changes 2024-07-09 08:45:21 +00:00
achuprov approved these changes 2024-07-09 09:22:59 +00:00
fyrchik merged commit b027a7f91e into master 2024-07-10 06:11:42 +00:00
fyrchik deleted branch fix-duplicate-directory 2024-07-10 06:11:43 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
6 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#1234
No description provided.