mirror of
https://github.com/pgsty/minio.git
synced 2026-11-09 17:21:51 +03:00
fix(batch): let a write refuse to replace a locked version
Add ObjectOptions.RefuseLockedOverwrite. With it set, PutObject (before the rename) and CompleteMultipartUpload check, under the destination's write lock, the stored version the write would replace: the version it addresses, or the null version. DeleteObject checks the stored version that a delete marker it writes names; in a multi-pool deployment that version is resolved across pools. A version under retention or legal hold is refused with ObjectLocked. The check reads the version's own metadata, whatever the bucket configuration, and returns read errors. Nothing sets the option yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Feng Ruohang <rh@vonng.com>
This commit is contained in:
@@ -117,6 +117,12 @@ type ObjectOptions struct {
|
||||
// Pools-layer version resolver; the caller holds the shared object lock.
|
||||
replicaObjectInfo GetObjectInfoFn
|
||||
|
||||
// RefuseLockedOverwrite refuses, under the destination's write lock, a
|
||||
// write that would replace a stored version Object Lock protects: the
|
||||
// version it writes, or the version a delete marker it writes names.
|
||||
// It returns ObjectLocked. Set by batch replication pulls.
|
||||
RefuseLockedOverwrite bool
|
||||
|
||||
Speedtest bool // object call specifically meant for SpeedTest code, set to 'true' when invoked by SpeedtestHandler.
|
||||
|
||||
// Use the maximum parity (N/2), used when saving server configuration files
|
||||
|
||||
Reference in New Issue
Block a user