-
Notifications
You must be signed in to change notification settings - Fork 545
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
Compactor: do not issue object storage HEAD API calls to check if cached meta.json files still exist #5063
Conversation
0b19e02
to
075f1de
Compare
3ac2200
to
6f3dba5
Compare
…eta.json Signed-off-by: Marco Pracucci <[email protected]>
6f3dba5
to
8e4b3e3
Compare
Signed-off-by: Marco Pracucci <[email protected]>
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.
After the artillery preparation in previous PRs, this was a breeze. Nice work.
@@ -314,6 +343,12 @@ func (f *MetaFetcher) fetchMetadata(ctx context.Context) (interface{}, error) { | |||
return nil | |||
} | |||
|
|||
// If requested, skip any block marked for deletion. | |||
if _, marked := markedForDeletion[id]; excludeMarkedForDeletion && marked { |
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.
nit: we don't need to check for excludeMarkedForDeletion
again. If it's false
then markedForDeletion
will be nil
(ie. empty map).
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.
The reason why I added the check here as well is to make the code more obvious when reading it. Given it doesn't add extra complexity, I would keep it.
Signed-off-by: Marco Pracucci <[email protected]>
Co-authored-by: Peter Štibraný <[email protected]>
I completed the manual tests on this PR. Going to merge it. |
What this PR does
The compactor issue a "object exists" API call for every block of each tenant every
-compactor.compaction-interval
. If you run a Mimir cluster with a large number of tenants (order of tens of thousands) and 1 year blocks retention, this can causes a very high number of API calls (order of hundred of millions per day). This PR removes such call.The rationale of the change introduced in this PR is better explained here, but can be summarised as:
Exists()
on each block's meta.json). After this PR, where the call toExists()
as been removed, this case shouldn't be a real issue because we filter out the blocks that were marked for deletion before we start listing blocks in the bucket. Theblock.Delete()
also guarantees that the deletion mark is the last file to be removed when deleting a block (andmeta.json
is the first one), so this should reduce the race conditions we may have.Which issue(s) this PR fixes or relates to
Fixes #5056
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]