Repository navigation
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
1 task done
…ta download The function Download in pkg/storage/utils/metadata/cs3.go changed each error of InitiateFileDownload to errtypes.NotFound. InitiateFileDownload does not read the file. It only returns the download URL. So an error from this call is a connection error, for example Unavailable from a dead replica. A caller that gets NotFound continues as if the file does not exist: - The settings service skips the role assignment and returns an empty role list. The proxy then assigns the default role "User" and so removes the old role, for example Admin. - The jsoncs3 share manager resets a share cache to empty. Changes: - Return the error of InitiateFileDownload without a change. - Change a non-OK status of InitiateFileDownload to the matching typed error. - Add tests in pkg/storage/utils/metadata/cs3_download_test.go with a fake storage provider. For a missing file, the GET request gets HTTP 404, and that still gives NotFound. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2403905
force-pushed
the
fix/8.0/OCISDEV-1714
branch
from
November 18, 2026 17:25
adb14c8 to
bdbc4f4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The function
Downloadinpkg/storage/utils/metadata/cs3.gochanged each error ofInitiateFileDownloadtoerrtypes.NotFound.InitiateFileDownloaddoes not read the file. It only returns the download URL (internal/grpc/services/storageprovider/storageprovider.go,InitiateFileDownload). So an error from this call is a connection error, for exampleUnavailablefrom a dead replica. For a missing file, the GET request that comes next gets HTTP 404, and that givesNotFound.A caller that gets
NotFoundcontinues as if the file does not exist:ListRoleAssignmentsskips the assignment and returns an empty role list. The proxy then assigns the default role "User".WriteRoleAssignmentdeletes the old assignments first, so an Admin becomes a User without an error.providercache,sharecacheandreceivedsharecachego tocas.DecideNotFoundResetand reset the cache to empty.The trigger is a partial failure of storage-system:
Authenticatereaches a good replica, andInitiateFileDownloadreaches a bad replica. The pool selects a replica for each RPC.Changes
InitiateFileDownloadwithout a change.InitiateFileDownloadto the matching typed error (errtypes.NewErrtypeFromStatus).pkg/storage/utils/metadata/cs3_download_test.go. A fake storage provider returnsUnavailableorPERMISSION_DENIED. Without the fix, the tests geterrtypes.NotFoundand the message "metadata storage doesn't support the spaces download protocol".Effect on the callers
defaultbranch returns the error.syncWithRetryretries, becausecas.IsSyncTransientdetects the raw gRPC error. Each retry selects a replica again.defaultbranch returns the error. The role does not change.Related issue
How has this been tested?
go test ./pkg/storage/utils/metadata/...go test ./pkg/share/manager/jsoncs3/... ./pkg/share/manager/cs3/... ./pkg/publicshare/manager/... ./pkg/storage/utils/indexer/...go.work.🤖 Generated with Claude Code