-
-
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
feat(uptime): Propagate checker configs to redis as well as kafka #84151
Conversation
❌ 1 Tests Failed:
View the top 1 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
def get_partition_keys(subscription_id: UUID) -> tuple[str, str]: | ||
partition = get_partition_from_subscription_id(subscription_id) | ||
return f"uptime:configs:{partition}", f"uptime:updates:{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.
nit: Sort of prefer this to be two functions, just so the naming is a bit more clear.
though you can pretty much tell from looking at the return strings, and at the call site what the unwrapped values are
pipe = cluster.pipeline() | ||
if value is None: | ||
pipe.hdel(config_key, key) | ||
action = "delete" |
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.
Would be nice to have a type for this, maybe a dataclass that knows how to serialize itself
@dataclass
class ConfigUpdate():
action: Literal["delete" | "upsert"]
subscription_id: Uuid
def as_msgpack(self):
return msgpack.packb(
{
"action": self.action,
"subscription_id": self.subscription_id.hex,
}
)
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.
potentially could be redis aware as well
@property
def redis_update_key(self):
partition = get_partition_from_subscription_id(self.subscription_id)
return f"uptime:updates:{partition}"
Just a thought
This propagates our checker configs to our new redis config store. For the moment we're dual writing, but we'll remove the Kafka code once it is stable and running in prod.
11594aa
to
4676e0a
Compare
…4151) This propagates our checker configs to our new redis config store. For the moment we're dual writing, but we'll remove the Kafka code once it is stable and running in prod. <!-- Describe your PR here. -->
…4151) This propagates our checker configs to our new redis config store. For the moment we're dual writing, but we'll remove the Kafka code once it is stable and running in prod. <!-- Describe your PR here. -->
This propagates our checker configs to our new redis config store. For the moment we're dual writing, but we'll remove the Kafka code once it is stable and running in prod.