-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Cleanup Bulk Delete Exception Logging #41693
Cleanup Bulk Delete Exception Logging #41693
Conversation
original-brownbear
commented
Apr 30, 2019
- Follow up to Implement Bulk Deletes for GCS Repository #41368
- Collect all failed blob deletes and add them to the exception message
- Remove logging of blob name list from caller exception logging
* Follow up to elastic#41368 * Collect all failed blob deletes and add them to the exception message * Remove logging of blob name list from caller exception logging
Pinging @elastic/es-distributed |
link relevant discussion #41368 (comment) |
@@ -146,21 +152,23 @@ public void deleteBlobsIgnoringIfNotExists(List<String> blobNames) throws IOExce | |||
for (DeleteObjectsRequest deleteRequest : deleteRequests) { | |||
try { | |||
clientReference.client().deleteObjects(deleteRequest); | |||
outstanding.removeAll(partition); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're removing "partition" here which is always the last partition, not the partition that is deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦♂ fixed :) sorry about that. Now using the keys from the delete request here (can't use the ones from the response, since it won't contain already missing blob names).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@original-brownbear Are you sure that missing blobs won't be reported in the response?
AWS S3 docs (https://docs.aws.amazon.com/en_us/AmazonS3/latest/API/multiobjectdeleteapi.html) say:
Note that, if the object specified in the request is not found, Amazon S3 returns the result as deleted.
If they're not reported, they won't be reported in MultiObjectDeleteException
exception as well, and it would mean that exception handling logic is incorrect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See here https://github.com/elastic/elasticsearch/pull/41693/files#diff-e915a7a019920d21471e0f39c435aa16R176. We have the quiet (non-verbose) option activated, so only keys that encounter an error are included. So for exceptions we're good imo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@original-brownbear sorry, I don't get it. If we're using quiet mode and only errors are reported it means we can not fetch the list of successfully deleted objects from MultiObjectDeleteException
as well?
From MultiObjectDeleteException.getDeletedObjects
JavaDoc
Returns the list of successfully deleted objects from this request. If
* {@link DeleteObjectsRequest#getQuiet()} is true, only error responses
* will be returned from s3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah fair point :D Added some more logic to account for this case now :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@original-brownbear good. Now, why we mess up with outstanding and performing remove/add to it? Why not just to add errors to the failedBlobs set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically just to cover running into some other runtime exception in the loop that is then caught in https://github.com/elastic/elasticsearch/pull/41693/files#diff-e915a7a019920d21471e0f39c435aa16R171 (just in case I guess ... not sure how likely/possible it is running into that).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@original-brownbear do you mean running into AmazonClientException
? Ok, I see your point. Can you please add the comment to the method describing the design decision because of quiet mode and generic AmazonClientException
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done :)
Jenkins run elasticsearch-ci/bwc |
@andrershov ping :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@original-brownbear sorry for the delay, now LGTM
@andrershov np + thanks for reviewing! |
* elastic/master: (414 commits) Add tasks to build Docker build context artifacts (elastic#41819) Replace more uses of immutable map builder (elastic#41823) Force selection of calendar or fixed intervals in date histo agg (elastic#33727) Switch run task to use real distro (elastic#41590) Clarify that path_match also considers object fields. (elastic#41658) [DOCS] remove 'es.scripting.update.ctx_in_params' system property for 7.0 (elastic#41643) Clarify _doc is a permanent part of certain document APIs. (elastic#41727) Remove the jdk directory to save space on bwc tests (elastic#41743) Fix full text queries test that start with now (elastic#41854) Remove `nonApplicationWrite` from `SSLDriver` (elastic#41829) SQL: [Docs] Add example for custom bucketing with CASE (elastic#41787) Cleanup Bulk Delete Exception Logging (elastic#41693) [DOCS] Rewrite `term` query docs for new format (elastic#41498) Mute PermissionsIT#testWhen[...]ByILMPolicy (elastic#41858) ReadOnlyEngine assertion fix (elastic#41842) [ML] addresses preview bug, and adds check to PUT (elastic#41803) Fix javadoc in WrapperQueryBuilder Testsclusters use seprate configurations per version (elastic#41504) Skip explain fetch sub phase when request holds only suggestions (elastic#41739) remove unused import ...
* Cleanup Bulk Delete Exception Logging * Follow up to elastic#41368 * Collect all failed blob deletes and add them to the exception message * Remove logging of blob name list from caller exception logging
* Cleanup Bulk Delete Exception Logging * Follow up to elastic#41368 * Collect all failed blob deletes and add them to the exception message * Remove logging of blob name list from caller exception logging