fix(copy): plan historical version placement before transforms

Locate exact versions for in-place updates and rewrite cross-pool references through the encryption and compression pipeline selected before copying.

Fixes #343

Signed-off-by: Feng Ruohang <rh@vonng.com>
This commit is contained in:
Feng Ruohang
2026-11-11 12:29:28 +08:00
parent f746d07076
commit a8824b341f
4 changed files with 258 additions and 29 deletions
+3
View File
@@ -124,6 +124,8 @@ type ObjectOptions struct {
replicaObjectInfo GetObjectInfoFn
// Verifies protected content in every pool before a replica commits.
replicaContentGuard replicaContentGuardFn
// Selected under the object locks, before copy encryption/compression.
copyPlan *copyObjectPlan
// RefuseLockedOverwrite refuses, under the destination's write lock, a
// write that would replace a stored version Object Lock protects: the
@@ -299,6 +301,7 @@ type ObjectLayer interface {
NewObjectNSLock(bucket, object string) RWLocker
// lockObjects locks several objects together, see erasureServerPools.
lockObjects(ctx context.Context, reqs ...objectLockRequest) (LockContext, func(), error)
prepareCopyObject(ctx context.Context, srcBucket, srcObject, dstBucket, dstObject string, srcInfo ObjectInfo, srcOpts, dstOpts ObjectOptions) (copyObjectPlan, error)
// Storage operations.
Shutdown(context.Context) error