-
Notifications
You must be signed in to change notification settings - Fork 334
WPB-22959 migrate team feature data to postgres #4979
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
base: develop
Are you sure you want to change the base?
WPB-22959 migrate team feature data to postgres #4979
Conversation
50ce8a9 to
988e78d
Compare
b8c3f52 to
e18928a
Compare
8ddaeb0 to
de4a599
Compare
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.
Pull request overview
This pull request implements the migration of team feature data from Cassandra to PostgreSQL, following the established pattern used for conversation and conversation codes migrations.
Changes:
- Adds PostgreSQL support for team features storage with a new table schema and queries
- Implements a migrating interpreter that handles dual-write scenarios during the migration phase
- Introduces a migration lock mechanism for team features using PostgreSQL advisory locks
- Adds configuration options to control the migration across galley and background-worker services
- Includes comprehensive integration tests covering all migration phases
Reviewed changes
Copilot reviewed 39 out of 39 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
libs/wire-subsystems/src/Wire/PostgresMigrationOpts.hs |
New module defining storage location options and migration configuration |
libs/wire-subsystems/src/Wire/TeamFeatureStore/Postgres.hs |
PostgreSQL interpreter for team feature store operations |
libs/wire-subsystems/src/Wire/TeamFeatureStore/Postgres/Queries.hs |
SQL queries for PostgreSQL team features storage |
libs/wire-subsystems/src/Wire/TeamFeatureStore/Cassandra.hs |
Refactored Cassandra interpreter with extracted query definitions |
libs/wire-subsystems/src/Wire/TeamFeatureStore/Cassandra/Queries.hs |
Cassandra query definitions extracted to separate module |
libs/wire-subsystems/src/Wire/TeamFeatureStore/Migrating.hs |
Dual-write interpreter managing Cassandra-to-PostgreSQL cutover |
libs/wire-subsystems/src/Wire/TeamFeatureStore/Migration.hs |
Migration logic for backfilling data from Cassandra to PostgreSQL |
libs/wire-subsystems/src/Wire/TeamFeatureStore/Error.hs |
Error types for team feature store operations |
libs/wire-subsystems/src/Wire/MigrationLock.hs |
Extended with support for team feature locking |
libs/wire-api/src/Wire/API/Team/Feature.hs |
PostgreSQL marshalling instances for feature types |
services/galley/src/Galley/App.hs |
Integration of team feature migration into galley service |
services/galley/src/Galley/Options.hs |
Import update for PostgresMigrationOpts |
services/background-worker/src/Wire/PostgresMigrations.hs |
Team features migration entrypoint |
services/background-worker/src/Wire/BackgroundWorker.hs |
Integration of team features migration worker |
services/background-worker/src/Wire/BackgroundWorker/Options.hs |
Migration option for team features |
postgres-schema.sql |
New team_features table schema |
libs/wire-subsystems/postgres-migrations/20260123124917-team-features.sql |
Migration file for team_features table |
integration/test/Test/Migration/TeamFeatures.hs |
Comprehensive integration tests for the migration |
docs/src/developer/reference/config-options.md |
Documentation updates for migration configuration |
| Configuration files | Updates across galley, background-worker, and helm charts |
Comments suppressed due to low confidence (1)
docs/src/developer/reference/config-options.md:1885
- The documentation should be updated to include the team features migration metric name. After line 1885 where conversation codes metric is mentioned, you should add information about the team features migration metric:
wire_team_features_migration_finished.
Wait for the store-specific migration metrics to reach `1.0`. For
conversations: `wire_local_convs_migration_finished` and
`wire_user_remote_convs_migration_finished`. For conversation codes:
`wire_conv_codes_migration_finished`.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
https://wearezeta.atlassian.net/browse/WPB-22959
Checklist
changelog.d