Repository navigation
fix: reject mixed V2 storage and harden cross-volume staging - #18
Merged
Merged
Conversation
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.
V2 auto-local configuration can currently coexist with legacy backend settings in C/GC, allowing C and Go to resolve objects differently. This change rejects that configuration before backend construction and makes cross-volume publication use hidden staging with an fsync before rename.
Baseline:
origin/dev6bb3c42865ab4769c1aa84a15f9d5c435aa18553.Changes:
enable_storage_classes.<destination-directory>/.cf-tmp-<name>-XXXXXX, clean up failures, and keep descriptor ownership local (the existingcopy_fdcloses descriptors internally).os.ModePerm: C block shard creation requests0777, subject to umask (tested as0755under0022).Validation:
cloudfile-build-base:ce14-v2:bash tests/local_storage/run.sh→Native and managed C object staging, cleanup and enumeration passed;C configuration guard and real cross-filesystem copy/failure cleanup passed./tmpto/dev/shm(differentst_dev) and checks hidden staging, unpublished destination, copy/fsync failure cleanup, plus same-filesystem hardlinks. Backend permission and enumeration tests run for both native and managed routes.CF_TEST_BIND_MOUNTS=1 CF_AUTO_STORAGE_CASES=/docker-docs/features/automatic-local-storage-cases.json go test ./objstore/... -count=1 -v→PASS,ok .../objstore 0.071s. Backend, repository and shard bind mounts all pass and each fixture reproduces EXDEV for the old staging layout.GOCACHE=/Users/bobo/workspace/openfile/.gocache go test ./objstore/... -count=1 -v→PASS,ok .../objstore 1.033s.git diff --checkpasses.Not covered:
CF_S3_TEST_ENDPOINTis not set; this is not S3 acceptance.Initial Linux harness attempts failed on missing writable legacy test output, disabled dependency downloads, and missing shared fixture paths. The final run uses a disposable writable source copy, a read-only existing module cache, and the explicit shared fixture; no tests are skipped to conceal those failures.
Upstream integration: GC must validate before constructing any storage backend, including offline sessions; this cannot be implemented only in the V2 path resolver. The companion Docker change should register
server/gc/seafile-session.cin its upstream-patch inventory. Do not merge before combined validation.