feat(gateway): support If-None-Match wildcard - #7479
Conversation
|
Hi,Could we add destination If-Match: support alongside If-None-Match: *? AWS supports it for PutObject, CopyObject, and CompleteMultipartUpload. S3 User Guide: https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-requests.html |
f193215 to
31853dd
Compare
Thanks for the suggestion. I'd prefer to keep this PR focused on The current implementation atomically checks that the destination does not exist. |
Point the temporary fork replacement at the squashed, pushed MinIO feature commit used by the upstream pull request.
Replace NotImplemented with atomic directory marker creation when If-None-Match: * targets an implicit directory with HeadDir disabled. Add transactional marker updates across Redis, SQL, and KV metadata engines, preserving the directory inode, children, and unrelated xattrs. Keep PreconditionFailed for existing markers and HeadDir-enabled directories. Handle PostgreSQL-compatible transaction retry SQLSTATEs for CockroachDB. Add concurrency and rollback tests and document the new marker operation.
31853dd to
8164c6c
Compare
|
MinIO PR juicedata/minio#84 has been merged. I rebased this PR onto the latest |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7479 +/- ##
===========================================
- Coverage 57.18% 22.22% -34.96%
===========================================
Files 181 31 -150
Lines 60100 25143 -34957
===========================================
- Hits 34370 5589 -28781
+ Misses 22111 18950 -3161
+ Partials 3619 604 -3015 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Add S3 conditional-write support for
If-None-Match: *to JuiceFS Gateway.RenameNoReplace--head-dir=false; return412 Precondition Failedfor existing explicit markers or directories exposed by--head-dir=trueIf-None-Matchheader fieldsFixes #6460.
MinIO dependency
This PR depends on juicedata/minio#84.
The current
go.modreplacement intentionally points to the pushed feature commit in my MinIO fork so this PR and its CI can be tested before the MinIO PR is merged. After #84 is merged, I will update the replacement to the correspondinggithub.com/juicedata/miniocommit before this PR is merged.Verification
All verification was run in Docker:
The live JuiceFS Gateway checks also verified:
200with--head-dir=false, preserving the directory inode and child data; with--head-dir=true, they return412412If-None-Matchfields are combined correctly: an empty field followed by*returns412, while*followed by an ETag returns400