Fix replication status reported on completion (#11273)

Fixes: #11272
master
Poorna Krishnamoorthy 4 years ago committed by GitHub
parent 628ef081d1
commit feaf8dfb9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      cmd/bucket-replication.go
  2. 2
      cmd/data-crawler.go
  3. 2
      docs/bucket/replication/README.md
  4. 2
      docs/zh_CN/bucket/replication/README.md
  5. 4
      pkg/bucket/replication/replication.go

@ -180,7 +180,7 @@ func checkReplicateDelete(ctx context.Context, bucket string, dobj ObjectToDelet
if gerr != nil { if gerr != nil {
validReplStatus := false validReplStatus := false
switch oi.ReplicationStatus { switch oi.ReplicationStatus {
case replication.Pending, replication.Complete, replication.Failed: case replication.Pending, replication.Completed, replication.Failed:
validReplStatus = true validReplStatus = true
} }
if oi.DeleteMarker && validReplStatus { if oi.DeleteMarker && validReplStatus {
@ -246,7 +246,7 @@ func replicateDelete(ctx context.Context, dobj DeletedObjectVersionInfo, objectA
} }
} else { } else {
if dobj.VersionID == "" { if dobj.VersionID == "" {
replicationStatus = string(replication.Complete) replicationStatus = string(replication.Completed)
} else { } else {
versionPurgeStatus = Complete versionPurgeStatus = Complete
} }
@ -471,7 +471,7 @@ func replicateObject(ctx context.Context, objInfo ObjectInfo, objectAPI ObjectLa
return return
} }
} }
replicationStatus := replication.Complete replicationStatus := replication.Completed
if rtype != replicateAll { if rtype != replicateAll {
gr.Close() gr.Close()

@ -993,7 +993,7 @@ func (i *crawlItem) healReplication(ctx context.Context, o ObjectLayer, oi Objec
case replication.Failed: case replication.Failed:
sizeS.failedSize += oi.Size sizeS.failedSize += oi.Size
globalReplicationState.queueReplicaTask(oi) globalReplicationState.queueReplicaTask(oi)
case replication.Complete: case replication.Completed, "COMPLETE":
sizeS.replicatedSize += oi.Size sizeS.replicatedSize += oi.Size
case replication.Replica: case replication.Replica:
sizeS.replicaSize += oi.Size sizeS.replicaSize += oi.Size

@ -119,7 +119,7 @@ The replication configuration follows [AWS S3 Spec](https://docs.aws.amazon.com/
When object locking is used in conjunction with replication, both source and destination buckets needs to have [object locking](https://docs.min.io/docs/minio-bucket-object-lock-guide.html) enabled. Similarly objects encrypted on the server side, will be replicated if destination also supports encryption. When object locking is used in conjunction with replication, both source and destination buckets needs to have [object locking](https://docs.min.io/docs/minio-bucket-object-lock-guide.html) enabled. Similarly objects encrypted on the server side, will be replicated if destination also supports encryption.
Replication status can be seen in the metadata on the source and destination objects. On the source side, the `X-Amz-Replication-Status` changes from `PENDING` to `COMPLETE` or `FAILED` after replication attempt either succeeded or failed respectively. On the destination side, a `X-Amz-Replication-Status` status of `REPLICA` indicates that the object was replicated successfully. Any replication failures are automatically re-attempted during a periodic disk crawl cycle. Replication status can be seen in the metadata on the source and destination objects. On the source side, the `X-Amz-Replication-Status` changes from `PENDING` to `COMPLETED` or `FAILED` after replication attempt either succeeded or failed respectively. On the destination side, a `X-Amz-Replication-Status` status of `REPLICA` indicates that the object was replicated successfully. Any replication failures are automatically re-attempted during a periodic disk crawl cycle.
To perform bi-directional replication, repeat the above process on the target site - this time setting the source bucket as the replication target. To perform bi-directional replication, repeat the above process on the target site - this time setting the source bucket as the replication target.

@ -73,7 +73,7 @@ Replication configuration applied successfully to myminio/srcbucket.
当对象锁定与复制结合使用时,源桶和目标桶都需要启用对象锁定。同理,如果目标也支持加密,则服务器端将复制加密的对象。 当对象锁定与复制结合使用时,源桶和目标桶都需要启用对象锁定。同理,如果目标也支持加密,则服务器端将复制加密的对象。
复制状态可以在源和目标对象的元数据中看到。在源端,根据复制的结果是成功还是失败,`X-Amz-Replication-Status`会从`PENDING`变更为`COMPLETE`或者 `FAILED`状态。 在目标端,对象成功复制,`X-Amz-Replication-Status`会被设置为`REPLICA`状态。在定期的磁盘扫描周期中,任何复制失败都将自动重新尝试。 复制状态可以在源和目标对象的元数据中看到。在源端,根据复制的结果是成功还是失败,`X-Amz-Replication-Status`会从`PENDING`变更为`COMPLETED`或者 `FAILED`状态。 在目标端,对象成功复制,`X-Amz-Replication-Status`会被设置为`REPLICA`状态。在定期的磁盘扫描周期中,任何复制失败都将自动重新尝试。
![put](https://raw.githubusercontent.com/minio/minio/master/docs/zh_CN/bucket/replication/PUT_bucket_replication.png) ![put](https://raw.githubusercontent.com/minio/minio/master/docs/zh_CN/bucket/replication/PUT_bucket_replication.png)

@ -31,8 +31,8 @@ const (
// Pending - replication is pending. // Pending - replication is pending.
Pending StatusType = "PENDING" Pending StatusType = "PENDING"
// Complete - replication completed ok. // Completed - replication completed ok.
Complete StatusType = "COMPLETE" Completed StatusType = "COMPLETED"
// Failed - replication failed. // Failed - replication failed.
Failed StatusType = "FAILED" Failed StatusType = "FAILED"

Loading…
Cancel
Save