Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: mirror --summary should work like -q #4923

Merged
merged 2 commits into from
May 10, 2024

Conversation

jiuker
Copy link
Contributor

@jiuker jiuker commented May 8, 2024

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

fix: mirror --summary should work like -q

Or user must use --summary with -q to avoid incorrect ProgressStatus.

jiuker@MacBook-Pro mc % ./mc mirror --overwrite --retry --summary --skip-errors /Users/jiuker/workspace/go/src/pkg/mc /Users/jiuker/workspace/go/src/minio/stage/issueBucket
.../go/src/pkg/mc/testdata/localhost.crt: 68.04 MiB / 68.04 MiB  ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓  64.99 MiB/s 1s
jiuker@MacBook-Pro mc % ./mc mirror --overwrite --retry --summary --skip-errors /Users/jiuker/workspace/go/src/pkg/mc /Users/jiuker/workspace/go/src/minio/stage/issueBucket -q
Total: 0 B, Transferred: 0 B, Speed: 0 B/s

Motivation and Context

How to test this PR?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Optimization (provides speedup with no functional changes)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • Fixes a regression (If yes, please add commit-id or PR # here)
  • Unit tests added/updated
  • Internal documentation updated
  • Create a documentation update request here

@jiuker jiuker force-pushed the fix_mirror_summary_work_as_quiet branch from 22e3ed4 to 21322a6 Compare May 8, 2024 02:54
fix: --summary should work like -q
@jiuker jiuker force-pushed the fix_mirror_summary_work_as_quiet branch from 21322a6 to 641a689 Compare May 8, 2024 02:57
Copy link
Contributor

@shtripat shtripat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@klauspost klauspost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't --summary operate independent of -q, so it displays progress AND prints the summary when done?

@jiuker
Copy link
Contributor Author

jiuker commented May 8, 2024

Can't --summary operate independent of -q, so it displays progress AND prints the summary when done?

Yes. See the test case.

jiuker@MacBook-Pro mc % ./mc mirror --overwrite --retry --summary --skip-errors /Users/jiuker/workspace/go/src/pkg/mc /Users/jiuker/workspace/go/src/minio/stage/issueBucket
.../go/src/pkg/mc/testdata/localhost.crt: 68.04 MiB / 68.04 MiB  ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓  64.99 MiB/s 1s
jiuker@MacBook-Pro mc % ./mc mirror --overwrite --retry --summary --skip-errors /Users/jiuker/workspace/go/src/pkg/mc /Users/jiuker/workspace/go/src/minio/stage/issueBucket -q
Total: 0 B, Transferred: 0 B, Speed: 0 B/s
jiuker@MacBook-Pro mc % ./mc mirror --overwrite --retry --summary --skip-errors /Users/jiuker/workspace/go/src/pkg/mc /Users/jiuker/workspace/go/src/minio/stage/issueBucket -q
Total: 68.13 MiB, Transferred: 68.13 MiB, Speed: 59.86 MiB/s

The second one show zero for nothing to copy with the same commad. It will show the correct size if that have objects to copy really.
@klauspost

@jiuker jiuker requested a review from klauspost May 9, 2024 02:30
Copy link
Contributor

@zveinn zveinn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Member

@vadmeste vadmeste left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@harshavardhana harshavardhana merged commit 1b89094 into minio:master May 10, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants