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

Return delete markers in mc find #5083

Merged
merged 3 commits into from
Nov 20, 2024

Conversation

allanrogerr
Copy link
Contributor

@allanrogerr allanrogerr commented Nov 19, 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

Default to list delete flags if they are part of the result set, so that they are not hidden from the find function

Motivation and Context

The default behaviour of mc find is to not return delete flags. However, for example in the case of ILM, this makes it difficult to detect if there are delete marker candidates for processing, even when the versions flag is specified.

How to test this PR?

Run mc find --versions on a specific bucket where delete markers are known to be present. These delete markers should be part of the result set.
e.g.

➜  mc git:(find-versions) ./mc find --smaller 1B local/find --json --versions                     
{
 "status": "success",
 "type": "",
 "lastModified": "2024-11-19T06:35:14.294-04:00",
 "size": 0,
 "key": "local/find/pics/47110640341_df7a79b41b_o.jpg",
 "etag": "",
 "versionId": "3ad022fa-230a-4bbd-86cf-b4dd12a3f4b0"
}
➜  mc git:(find-versions) ./mc find --smaller 1B local/find --json           
➜  mc git:(find-versions) 

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

…hat they are not hidden from the find function
@allanrogerr allanrogerr self-assigned this Nov 19, 2024
@klauspost
Copy link
Contributor

Wouldn't this change existing behavior? Maybe do a --with-dm flag?

@allanrogerr
Copy link
Contributor Author

Wouldn't this change existing behavior? Maybe do a --with-dm flag?

It would however @vadmeste opinion was that although it may break in some rare corner cases in the community, it is better than adding a new flag. Your thoughts @klauspost ?

@klauspost
Copy link
Contributor

I see potential scripts breaking... And weird stuff people use it for breaking in strange ways... So personally uncomfortable changing it.

@allanrogerr
Copy link
Contributor Author

I see potential scripts breaking... And weird stuff people use it for breaking in strange ways... So personally uncomfortable changing it.

Let me take a closer look.

@allanrogerr
Copy link
Contributor Author

Simplified the implementation by enabling delete marker listing when using --versions

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.

Let's hope nobody loses data, then.

@harshavardhana harshavardhana merged commit 35cb4b8 into minio:master Nov 20, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants