Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean IDCache properly #3903

Merged
merged 2 commits into from
May 22, 2023
Merged

Clean IDCache properly #3903

merged 2 commits into from
May 22, 2023

Conversation

kobergj
Copy link
Contributor

@kobergj kobergj commented May 19, 2023

Needs more work. Cache can't work like this on distributed systems

Decided to use a (configurable) go-micro store instead of the hardcoded inmemory implementation

Signed-off-by: jkoberg <jkoberg@owncloud.com>
Signed-off-by: jkoberg <jkoberg@owncloud.com>
@kobergj kobergj marked this pull request as ready for review May 19, 2023 13:21
@kobergj kobergj requested review from a team, labkode, ishank011 and glpatcern as code owners May 19, 2023 13:21
@@ -416,6 +416,10 @@ func (t *Tree) ListFolder(ctx context.Context, n *node.Node) ([]*node.Node, erro

// Delete deletes a node in the tree by moving it to the trash
func (t *Tree) Delete(ctx context.Context, n *node.Node) (err error) {
path := filepath.Join(n.ParentPath(), n.Name)
// remove entry from cache immediately to avoid inconsistencies
_ = t.idCache.Delete(path)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Little nitpick: Wouldn't it be safer to invalidate the cache after actually having deleted the file? Otherwise the cache could be filled again by another goroutine or instance between here and line 499, no?

@butonic butonic merged commit 131bdf1 into cs3org:edge May 22, 2023
@kobergj kobergj deleted the CleanIDCacheProperly branch May 22, 2023 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants