WPB-22959 migrate team feature data to postgres#4979
Merged
battermann merged 21 commits intodevelopfrom Feb 4, 2026
Merged
Conversation
50ce8a9 to
988e78d
Compare
b8c3f52 to
e18928a
Compare
8ddaeb0 to
de4a599
Compare
Contributor
There was a problem hiding this comment.
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.
libs/wire-subsystems/postgres-migrations/20260123124917-team-features.sql
Show resolved
Hide resolved
blackheaven
approved these changes
Jan 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://wearezeta.atlassian.net/browse/WPB-22959
Checklist
changelog.d