mc icon indicating copy to clipboard operation
mc copied to clipboard

`mc mirror` without `--overwrite` does not continue syncing other objects after one fails to synchronize

Open skirsten opened this issue 2 years ago • 1 comments

Expected behavior

As the docs state and as one would expect using common sense:

Without --overwrite, if an object already exists on the Destination, the mirror process fails to synchronize that object. mc mirror logs an error and continues to synchronize other objects.

Actual behavior

It does not, in fact, continues to synchronize other objects.

Steps to reproduce the behavior

$ touch a.txt
$ mc mirror --json . r2/test # mirrors a.txt successfully
{
 "status": "success",
 "source": "/home/.../a.txt",
 "target": "r2/test/a.txt",
 "size": 0,
 "totalCount": 1,
 "totalSize": 0
}
{
 "status": "success",
 "total": 0,
 "transferred": 0,
 "speed": 0
}
$ touch a.txt b.txt
$ mc mirror --json . r2/test # does NOT mirror b.txt because a.txt was updated (even though it clearly has a status of success)
{
 "status": "success",
 "source": "/home/.../b.txt",
 "target": "r2/test/b.txt",
 "size": 0,
 "totalCount": 1,
 "totalSize": 0
}
{
 "status": "error",
 "error": {
  "message": "Failed to perform mirroring, with error condition (mm-source-mtime)",
  "cause": {
   "message": "Overwrite not allowed for `https://.../test/a.txt`. Use `--overwrite` to override this behavior.",
   "error": {}
  },
  "type": "error"
 }
}
{
 "status": "success",
 "total": 0,
 "transferred": 0,
 "speed": 0
}
$ mc ls r2/test # only a.txt exists
[2022-08-15 19:35:50 CEST]     0B STANDARD a.txt

mc --version

  • mc version RELEASE.2022-08-11T00-30-48Z (commit-id=c2c2ab4299bbb243c55644984392f1c39af499cf)

And no, I do not want to enable --overwrite.

skirsten avatar Aug 15 '22 17:08 skirsten

@taran-p Can you PTAL?

kannappanr avatar Aug 31 '22 12:08 kannappanr

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 24 '22 08:12 stale[bot]