Skip to content

[BUG] mc mirror will overwrite the same key in target minio bucket #5192

Open
@sheiy

Description

@sheiy

Expected Behavior

mc mirror --watch m2/from m1/tot
the key in bucket of from should not overwrite the key in tot bucket

Current Behavior

the key in bucket of from overwrite the key in tot bucket

Steps to Reproduce (for bugs)

  1. run 2 minio server and 1 minio client
docker run -itd --name minio1 \
    -p 19000:19000 -p 19001:19001                 \
    --env MINIO_CONSOLE_PORT_NUMBER="19001" \
    --env MINIO_API_PORT_NUMBER="19000" \
    bitnami/minio:latest


    docker run -itd --name minio2 \
    -p 29000:29000 -p 29001:29001                 \
    --env MINIO_CONSOLE_PORT_NUMBER="29001" \
    --env MINIO_API_PORT_NUMBER="29000" \
    bitnami/minio:latest



    docker run -it --rm --name minio-client \
    --network host \
    bitnami/minio-client \
    bash
  1. set alias m1 and m2 in minio-client bash exec
    mc alias s m2 http://host.docker.internal:29000 UCT7IcRVcPkwTH8HiQxM qrob0lPKuQXOWXm6KAoKZ2rQ9L9Fb2Cdclf2dR5b
    mc alias s m1 http://host.docker.internal:19000 zCcEb0HhhYMxR7yg8v0P tvMu62i3gaWKTu4KoWO03JBEVl0OUyLOkzGrOt7j
  2. start mirror
    mc mirror --watch m2/from m1/tot
  3. upload a key named 1.txt(content is 1) to m1's tot bucket with console
  4. upload a key named 1.txt(content is 12) to m2's from bucket with console
  5. the m1's tot bucket key of 1.txt will change

Context

I want to cp all keys from m2's 'from' bucket to m1's tot bucket

Your Environment

  • Version used (minio --version): minio version DEVELOPMENT.2025-04-08T15-41-24Z (commit-id=d0cada583fce88f60cb276ddfb06f5cb16820069)
  • Server setup and configuration: see docker cmd
  • Operating System and version (uname -a): Linux 2abac2c0f4fd 6.13.7-orbstack-00283-g9d1400e7e9c6 minio/minio#104 SMP Mon Mar 17 06:15:48 UTC 2025 aarch64 GNU/Linux
  • mc version minio/stable/mc RELEASE.2025-04-08T15-39-49Z_1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions