-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
ref(relay): Write project config revision to Redis #75523
Conversation
🔍 Existing Issues For ReviewYour pull request is modifying functions with the following pre-existing issues: 📄 File: src/sentry/relay/projectconfig_cache/redis.py
Did you find this useful? React with a 👍 or 👎 |
@@ -63,6 +68,11 @@ def get(self, public_key): | |||
rv = zstandard.decompress(rv_b).decode() | |||
except (TypeError, zstandard.ZstdError): | |||
# assume raw json | |||
pass | |||
rv = rv_b |
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.
Drive by fix ... That would have just blown up before because rv
is not defined.
metrics.incr("relay.projectconfig_cache.write", amount=len(configs), tags={"action": "set"}) | ||
|
||
# Note: Those are multiple pipelines, one per cluster node | ||
p = self.cluster.pipeline() | ||
p = self.cluster.pipeline(transaction=False) |
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.
There is no need for this pipeline to be transactional (default value), all keys are independent.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #75523 +/- ##
==========================================
+ Coverage 77.34% 78.22% +0.88%
==========================================
Files 6819 6821 +2
Lines 302757 302954 +197
Branches 52110 52139 +29
==========================================
+ Hits 234159 236991 +2832
+ Misses 62055 59593 -2462
+ Partials 6543 6370 -173
|
Checks the 'new' revision key before actually loading and parsing the project config. Revision introduced here: getsentry/sentry#75523 Change is backwards compatible, if the key is missing the check is simply skipped. I was considering propagating the information whether something was refreshed or a fresh fetch through the state channel, but after review and consideration, I don't think that is useful information, we still have to reset a bunch of internal state and move the project out of the `in flight` status. All if which we already do, the only thing we could change is skipping the assignment of the project info contained in the project fetch state (because that's the same state as the old), but this is already only an `Arc`.
See: getsentry/relay#3887
Writes the revision to Redis as a separate key. Allowing for optimized reads by revision.
#skip-changelog