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

mc diff returns inconsistent result #4968

Closed taind772 closed 4 months ago

taind772 commented 4 months ago

Expected behavior

mc diff A B ~ mc diff B A

Actual behavior

image

Steps to reproduce the behavior

image

mc --version

mc version RELEASE.2024-06-24T19-40-33Z (commit-id=3548007d5bd1ba8e2ed98f35d95c4776dd9a7ff9)
Runtime: go1.22.4 linux/amd64
Copyright (c) 2015-2024 MinIO, Inc.
License GNU AGPLv3 <https://www.gnu.org/licenses/agpl-3.0.html>

System information

A container based on minio/mc:RELEASE.2024-06-24T19-40-33Z running in Kubernetes (linux).

bash-5.1# cat /etc/os-release
NAME="Red Hat Enterprise Linux"
VERSION="9.4 (Plow)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="9.4"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Red Hat Enterprise Linux 9.4 (Plow)"
ANSI_COLOR="0;31"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:redhat:enterprise_linux:9::baseos"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 9"
REDHAT_BUGZILLA_PRODUCT_VERSION=9.4
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.4"

S3 backend: Ceph v17, API: s3v4

klauspost commented 4 months ago

diff: 7 is differInAASourceMTime, meaning the destination returned a modtime with either regular modtime or X-Amz-Meta-Mm-Source-Mtime, that is earlier than the source. So parameter order matters:

λ mc diff --json play/testbucket/prefix ./prefix/
{
 "status": "success",
 "first": "https://play.min.io/testbucket/prefix/file.txt",
 "second": "\\prefix\\file.txt",
 "diff": 7
}

λ mc diff --json ./prefix/ play/testbucket/prefix

λ