-
-
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
feat(migrations): add discover local #5788
Conversation
This PR has a migration; here is the generated SQL -- start migrations
-- forward migration discover : 0008_discover_fix_add_local_table
Local op: CREATE TABLE IF NOT EXISTS discover_local (event_id UUID, project_id UInt64, type LowCardinality(String), timestamp DateTime, platform LowCardinality(String), environment LowCardinality(Nullable(String)), release LowCardinality(Nullable(String)), dist LowCardinality(Nullable(String)), transaction_name LowCardinality(String), message String, title String, user String, user_hash UInt64, user_id Nullable(String), user_name Nullable(String), user_email Nullable(String), ip_address_v4 Nullable(IPv4), ip_address_v6 Nullable(IPv6), sdk_name LowCardinality(Nullable(String)), sdk_version LowCardinality(Nullable(String)), http_method LowCardinality(Nullable(String)), http_referer Nullable(String), tags Nested(key String, value String), _tags_hash_map Array(UInt64), contexts Nested(key String, value String), span_id Nullable(UInt64), trace_id Nullable(UUID), deleted UInt8) ENGINE Merge(currentDatabase(), '^errors_local$|^transactions_local$');
-- end forward migration discover : 0008_discover_fix_add_local_table
-- backward migration discover : 0008_discover_fix_add_local_table
-- end backward migration discover : 0008_discover_fix_add_local_table |
Test Failures Detected: Due to failing tests, we cannot provide coverage reports at this time. ❌ Failed Test Results:Completed 1 tests with View the full list of failed tests
|
I'm confused about what is going on here, there is already a migration with the local table: https://github.com/getsentry/snuba/blob/master/snuba/snuba_migrations/discover/0001_discover_merge_table.py#L48 |
That is correct. We have the migration but we didn't run it in SaaS. |
But then why add the migration again? Why not run the migration in SaaS? |
The table has changed since then. |
Our migrations in SaaS don't have the discover local table. This causes a mismatch between discover migrations in SaaS and self-hosted/CI. The mismatch prevents us from running any new discover migrations.
To fix this , this migration adds a
discover_local
table if it doesn't exist to reconcile SaaS with the self-hosted migrations. In SaaS the local table will not be used because we merge the distributed tables directly, but this will allow us to unblock discover migrations.