-
-
Notifications
You must be signed in to change notification settings - Fork 57
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: Deprecate TOPIC_PARTITION_COUNTS setting #5868
Conversation
Snuba should fetch the actual value from the broker on startup rather than rely on a hardcoded TOPIC_PARTITION_COUNTS settings. This will ensure that it always has the correct values and remove the manual process and associated drift in ops that is currently involved in keeping this up to date.
snuba/datasets/table_storage.py
Outdated
config = get_default_kafka_configuration(self.__topic, None) | ||
client = AdminClient(config) | ||
topic_name = self.get_physical_topic_name() | ||
print(topic_name) |
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 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.
i'm debugging a test that fails in CI but not locally
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.
removed 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.
Out of curiousity, if the partition check fails for some reason, what would happen
@property | ||
def replication_factor(self) -> int: | ||
return 1 | ||
config = get_default_kafka_configuration(self.__topic, None) |
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 connection already happens in bootstrap.py
. Is there a way we could leverage that code, to avoid connecting twice on startup?
Also, there is a utility function that does this: https://github.com/getsentry/snuba/blob/master/snuba/consumers/utils.py#L17
Could we use that instead?
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.
Ugggh I just noticed a pretty bad bug with that other function. It does not properly resolve the topic name if it is overridden to something else and assumes the default. So I guess we can't safely use it right now, but also... this probably needs to be fixed?
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.
Sounds like it should be fixed. Did you want to add it to this PR?
The pod would crash if Kafka or the topic is unavailable for some reason. This applies to the subscription scheduler pod as well as the API pod if the subscription POST endpoint is called. |
Is there any way around this so that the API pod doesn't crash? This kinda reminds me of the old readiness health-check we had before where snuba API would crash if it isn't able to connect to ClickHouse. Ideally, the API still works for all other the other datasets even if one partition check fails for a single dataset. |
Discussed offline. Looks like exception handling and returning a proper response is already automatically handled by Lines 173 to 194 in 177e23e
|
also needs getsentry/sentry#70809 |
fix test for getsentry/snuba#5868 the events topic needs to exist for subscriptions to work
sentry test is failing |
PR reverted: ed0426b |
This reverts commit 4aedda7. Co-authored-by: lynnagara <1779792+lynnagara@users.noreply.github.com>
This reverts commit ed0426b.
we need to actually create the topic in CI (this worked locally because of auto-create settings) getsentry/snuba#5868 had to be reverted until we get this fix in as CI will fail
fix test for getsentry/snuba#5868 the events topic needs to exist for subscriptions to work
we need to actually create the topic in CI (this worked locally because of auto-create settings) getsentry/snuba#5868 had to be reverted until we get this fix in as CI will fail
Snuba should fetch the actual value from the broker on startup rather than rely on a hardcoded TOPIC_PARTITION_COUNTS settings. This will ensure that it always has the correct values and remove the manual process and associated drift in ops that is currently involved in keeping this up to date.
Depends on getsentry/sentry#70478
This is a prerequisite to https://github.com/getsentry/ops/pull/10392 and https://github.com/getsentry/ops/pull/10451 which will enable clean up of topicctl configuration in ops.