mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-06-09 18:32:43 +00:00
4e421400e4
Add an optional WriteCondition to CreateEntryRequest. When set, the filer evaluates it against the current entry while holding the per-path lock, so the check and the write are atomic on this filer, and returns PRECONDITION_FAILED when it does not hold. The condition is a single primitive (exists / not-exists / etag match / etag mismatch / [un]modified-since). The caller reduces request semantics such as RFC 7232 precedence to one primitive; the filer just compares. ETag comparison mirrors the S3 gateway's precedence (stored Seaweed ETag attribute, then the Md5/chunk fallback) so results match without coupling the filer to S3 handling.