mirror of
https://github.com/minio/minio.git
synced 2025-04-19 18:17:30 -04:00
Add deployment-id and source bucket to transitioned object name (#12693)
This allows remote bucket admin to identify the origin of transitioned objects by simply inspecting the object prefixes. e.g let's take a remote tier TIER-1 pointing to a remote bucket (prefix) testbucket/testprefix-1. The remote bucket admin can list all transitioned objects from a MinIO deployment identified by '2e78e906-1c5d-4f94-8689-9df44cafde39' and source bucket 'mybucket' like so, ``` $ ./mc ls -r minio-tier-target/testbucket/testprefix-1/2e78e906-1c5d-4f94-8689-9df44cafde39/mybucket/ [2021-07-12 17:15:50 PDT] 160B 48/fb/48fbc0e6-3a73-458b-9337-8e722c619ca4 [2021-07-12 16:58:46 PDT] 160B 7d/1c/7d1c96bd-031a-48d4-99ea-b1304e870830 ```
This commit is contained in:
parent
ab7584eeac
commit
6ea083d197
@ -269,13 +269,13 @@ func expireTransitionedObject(ctx context.Context, objectAPI ObjectLayer, oi *Ob
|
|||||||
}
|
}
|
||||||
|
|
||||||
// generate an object name for transitioned object
|
// generate an object name for transitioned object
|
||||||
func genTransitionObjName() (string, error) {
|
func genTransitionObjName(bucket string) (string, error) {
|
||||||
u, err := uuid.NewRandom()
|
u, err := uuid.NewRandom()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
us := u.String()
|
us := u.String()
|
||||||
obj := fmt.Sprintf("%s/%s/%s", us[0:2], us[2:4], us)
|
obj := fmt.Sprintf("%s/%s/%s/%s/%s", globalDeploymentID, bucket, us[0:2], us[2:4], us)
|
||||||
return obj, nil
|
return obj, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1399,7 +1399,7 @@ func (er erasureObjects) TransitionObject(ctx context.Context, bucket, object st
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
destObj, err := genTransitionObjName()
|
destObj, err := genTransitionObjName(bucket)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user