minio / mc

Unix like utilities for object store
https://min.io/download
GNU Affero General Public License v3.0
2.86k stars 548 forks source link

mirror:copy events also can mirror #4842

Closed dormanze closed 8 months ago

dormanze commented 9 months ago

Community Contribution License

All community contributions in this pull request are licensed to the project maintainers under the terms of the Apache 2 license. By creating this pull request I represent that I have the right to license the contributions to the project maintainers under the Apache 2 license.

Description

copy events cannot mirror.

Recurrence Condition:

setp1: Create three buckets

mc mb myminio/bucket1
mc mb myminio/bucket2
mc mb myminio/bucket3

setp2: Create a test file and upload it to bucket1

mc cp test_file myminio/bucket1

step3: Use mirror to copy the test files from bucket1 to bucket2 and exit the command

mc mirror myminio/bucket1 myminio/bucket2 --remove --overwrite --quiet -a -w

setp4: Create mirrors for bucket1 and bucket3 and keep watch.

mc mirror myminio/bucket1 myminio/bucket3 --remove --overwrite --quiet -a -w

step5: Delete the test file from bucket1, The deleted event is synchronized to bucket3.

mc rm myminio/bucket1/test_file

step6: After data is copied from bucket2 to bucket1, the data cannot be synchronized to bucket3 when the mirror synchronization still exists.

mc cp  myminio/bucket2/test_file myminio/bucket1/test_file

Motivation and Context

We expect the copy command to be supported in mirror as well.

How to test this PR?

Refer to the preceding steps.

Types of changes

Checklist: