Skip to content

Commit

Permalink
Merge pull request #4362 from butonic/fix-concurrent-lookup
Browse files Browse the repository at this point in the history
Fix concurrent lookup
  • Loading branch information
butonic authored Nov 24, 2023
2 parents 5b6c6f2 + d08a44a commit a16959a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/fix-concurrent-lookup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Fix concurrent lookup

We have fixed a bug that overwrites existing variables, leading to flaky lookup of spaces

https://github.com/cs3org/reva/pull/4362
8 changes: 4 additions & 4 deletions pkg/storage/utils/decomposedfs/spaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,15 +424,15 @@ func (fs *Decomposedfs) ListStorageSpaces(ctx context.Context, filter []*provide
continue
}
// always read link in case storage space id != node id
spaceID, nodeID, err = ReadSpaceAndNodeFromIndexLink(match)
linkSpaceID, linkNodeID, err := ReadSpaceAndNodeFromIndexLink(match)
if err != nil {
appctx.GetLogger(ctx).Error().Err(err).Str("match", match).Msg("could not read link, skipping")
continue
}

n, err := node.ReadNode(ctx, fs.lu, spaceID, nodeID, true, nil, true)
n, err := node.ReadNode(ctx, fs.lu, linkSpaceID, linkNodeID, true, nil, true)
if err != nil {
appctx.GetLogger(ctx).Error().Err(err).Str("id", nodeID).Msg("could not read node, skipping")
appctx.GetLogger(ctx).Error().Err(err).Str("id", linkNodeID).Msg("could not read node, skipping")
continue
}

Expand All @@ -448,7 +448,7 @@ func (fs *Decomposedfs) ListStorageSpaces(ctx context.Context, filter []*provide
case errtypes.NotFound:
// ok
default:
appctx.GetLogger(ctx).Error().Err(err).Str("id", nodeID).Msg("could not convert to storage space")
appctx.GetLogger(ctx).Error().Err(err).Str("id", linkNodeID).Msg("could not convert to storage space")
}
continue
}
Expand Down

0 comments on commit a16959a

Please sign in to comment.