xl: Add '.CORRUPTED' prefix to corrupted objects#6592
xl: Add '.CORRUPTED' prefix to corrupted objects#6592kannappanr merged 1 commit intominio:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6592 +/- ##
==========================================
- Coverage 55.45% 54.81% -0.64%
==========================================
Files 251 249 -2
Lines 38330 31367 -6963
==========================================
- Hits 21254 17193 -4061
+ Misses 15124 12211 -2913
- Partials 1952 1963 +11
Continue to review full report at Codecov.
|
harshavardhana
left a comment
There was a problem hiding this comment.
LGTM as agreed and tested.
|
Here is what was discussed on what needs to be done
|
What's the real reason for this? When we will add .CORRUPTED extension ? I suggest that healing should do this, I mean renaming objects that healing was unable to heal to add .CORRUTPED extension. |
|
Well there are problems adding extensions causes Listing to be all clobbered up. So I think the solution needs more discussion. |
yeah I agree, that's why I suggested that healing does the rename of these objects to add .CORRUPTED extension, but also I am not sure why we add that extension in the first place. |
|
Will explain @vadmeste here in a bit about final approach, just discussed. |
harshavardhana
left a comment
There was a problem hiding this comment.
I discussed with @abperiasamy the changes here are fine but we also have to make few more changes, i.e we should rename the object which are stale with "objectName.CORRUPTED" atomically.
Also allow them to be available in the listing output such that they can be deleted by mc rm.
What we need to do should be carefully understood here
- First we read the
xl.jsonfrom all disks and then ascertain how many disks its missing - Then pick one of the common
xl.jsonand decide the quorum. - Once the quorum is obtained see how many places the object still exists, rename all of them as objectName.corrupted
- Recreate empty objects on non-existent disks such as objectName.CORRUPTED with
xl.json - This would allow for quorum and for the objects to be deleted.
All of this happens inside a ReadLock which is okay since other write locks will be blocked, we don't need to acquire a new write lock. Similar to healing but we are actively doing this during GetObjectInfo()
@harshavardhana I think recreating empty object is not needed. I know that the general rule is that we should not allow deleting an object if there is no write quorum |
By the way, that's how it is working right now. I investigated this before. |
284f30d to
8783b63
Compare
|
|
This is not WIP anymore, but the code doesn't create empty files. As I said, Delete API already doesn't count nonexistent object in some disks as an error since this is already a confirmation of the Delete action. So Delete actually can remove objects that don't have quorum. This PR modifies getObjectInfo(), but we should notice that this is a dangerous change because if there is any mistake anywhere, |
harshavardhana
left a comment
There was a problem hiding this comment.
We have to be extra careful yes, but it is okay to make the object a user interactive responsibility.
We are not actively deleting anything so it is okay.
cmd/xl-v1-object.go
Outdated
| } | ||
| } | ||
| // If xl.json is not present in read quorum disks, | ||
| // add .CORRUPTION prefix to the current object. |
There was a problem hiding this comment.
.CORRUPTED typo here.
Fixed
cmd/xl-v1-object.go
Outdated
| // If xl.json is not present in read quorum disks, | ||
| // add .CORRUPTION prefix to the current object. | ||
| if len(xl.getDisks())-notFoundXLJSON < readQuorum { | ||
| rename(ctx, xl.getDisks(), bucket, object, bucket, object+xlCorruptedSuffix, true, len(xl.getDisks())/2+1, []error{errFileNotFound}) |
There was a problem hiding this comment.
We can keep the quorum similar to global standard class ?
There was a problem hiding this comment.
We can keep the quorum similar to global standard class ?
Fixed
acb20f9 to
759cae0
Compare
getObjectInfo() checks if a given object has enough xl.json in disks, returns 404 if not and added .CORRUPTED suffix to object.
Mint Automation
|
This PR completes the missing functionality from minio#6592
This PR completes the missing functionality from minio#6592
This PR completes the missing functionality from #6592
Description
getObjectInfo() checks if a given object has enough xl.json in disks, returns 404 if not and added .CORRUPTED suffix to object.
Motivation and Context
Fixes #6575 and #6591
Regression
No
How Has This Been Tested?
Types of changes
Checklist:
mintPR # here: )