Skip to content

feat(gateway): support If-None-Match wildcard - #7479

Open
ilcm96 wants to merge 8 commits into
juicedata:mainfrom
ilcm96:feat/if-none-match-wildcard
Open

feat(gateway): support If-None-Match wildcard#7479
ilcm96 wants to merge 8 commits into
juicedata:mainfrom
ilcm96:feat/if-none-match-wildcard

Conversation

@ilcm96

@ilcm96 ilcm96 commented Aug 29, 2026

Copy link
Copy Markdown

Summary

Add S3 conditional-write support for If-None-Match: * to JuiceFS Gateway.

  • enforce create-only semantics for PutObject, CopyObject, and multipart completion
  • publish new directory markers through a fully prepared temporary inode and RenameNoReplace
  • preserve the target state when a conditional directory-marker request fails
  • return 412 Precondition Failed for existing explicit markers and 501 Not Implemented for implicit POSIX directories that cannot yet be promoted atomically
  • clean up temporary directory-marker inodes on every failed publish path
  • add unit, race, and S3 integration coverage, including repeated If-None-Match header fields

Fixes #6460.

MinIO dependency

This PR depends on juicedata/minio#84.

The current go.mod replacement 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 corresponding github.com/juicedata/minio commit before this PR is merged.

Verification

All verification was run in Docker:

go test ./pkg/gateway -count=1
go test ./cmd -run IfNoneMatch -count=1  # in the MinIO repository
bash -n integration/s3gateway_test.sh

The live JuiceFS Gateway checks also verified:

  • conditional PUT and CopyObject against an implicit directory return 501 without changing inode state or child data
  • a new directory marker is created successfully and a duplicate conditional write returns 412
  • repeated raw If-None-Match fields are combined correctly: an empty field followed by * returns 412, while * followed by an ETag returns 400
  • the existing object content remains unchanged after failed conditional requests

@CLAassistant

CLAassistant commented Aug 29, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

s3 gateway does not support CONDITIONAL WRITE

2 participants