Browse Source

filer: streamline remote delete client lookup and logging

Avoid a redundant mount trie traversal by resolving the remote client directly from the matched mount location, and add parity logging for successful remote directory deletions.

Made-with: Cursor
pull/8522/head
Peter 1 week ago
parent
commit
11603cf7a4
  1. 3
      weed/filer/filer_lazy_remote.go

3
weed/filer/filer_lazy_remote.go

@ -125,7 +125,7 @@ func (f *Filer) maybeDeleteFromRemote(ctx context.Context, entry *Entry) (bool,
return false, nil
}
client, _, found := f.RemoteStorage.FindRemoteStorageClient(entry.FullPath)
client, _, found := f.RemoteStorage.GetRemoteStorageClient(remoteLoc.Name)
if !found || client == nil {
return false, fmt.Errorf("resolve remote storage client for %s: not found", entry.FullPath)
}
@ -139,6 +139,7 @@ func (f *Filer) maybeDeleteFromRemote(ctx context.Context, entry *Entry) (bool,
}
return false, fmt.Errorf("remove remote directory %s: %w", entry.FullPath, err)
}
glog.V(3).InfofCtx(ctx, "maybeDeleteFromRemote: deleted directory %s from remote", entry.FullPath)
return true, nil
}

Loading…
Cancel
Save