Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat(hybridcloud) Use control file for user/sentryapp avatars #54118
feat(hybridcloud) Use control file for user/sentryapp avatars #54118
Changes from all commits
5c03d7a
4348b72
c346bf8
cfc0bd6
e3444d0
57da4cf
69ba210
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This behavior may be a bit problematic in split DB test contexts, since accessing the normal
file_id
in a fallback case will likely result in a cross-DB access in some transaction contexts (seetest_doc_integration_avatar.py
for example). Are we sure we don't want to just default tocontrol_file_id
at this point?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.
Non-saas environments never moved useravatar or sentryapp avatars to control file (as they don't have the separate bucket config). We need to continue using
file_id
for those environments as that is where their files are.I'm considering following up this change with a backfill migration that copies all the file/fileblob/fileblobindex records for user & sentryapp avatars into ControlFile. If we do that backfill then all environments will become consistent and we can simplify this code as we don't need to split reads anymore.
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.
Ahh I didn't realize we hadn't backfilled the non-saas deploys 😞 Yeah that makes sense. Should we maybe do an env check for split db mode and fail fast in that scenario just to ensure we don't keep around these cross-db accesses?
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.
Yeah a split db check could work too. I'd like to get rid of the cross-db reads, but how to get there is the part I'm still trying to figure out. Migrations only have access to historical models which don't have the methods we need to move file records between backends. We could spawn the copy file task, but we'll need to account for the task changing signature/going missing in the future.