Repository navigation
WPB-29579: migrate properties to PostGreSQL - #5643
Open
blackheaven wants to merge 4 commits into
Open
blackheaven wants to merge 4 commits into
blackheaven wants to merge 4 commits into
Conversation
blackheaven
force-pushed
the
gdifolco/WPB-29579-migration-postgres-properties
branch
2 times, most recently
from
October 29, 2026 18:50
2943f13 to
95ef331
Compare
blackheaven
force-pushed
the
gdifolco/WPB-29579-migration-postgres-properties
branch
from
November 4, 2026 15:23
0bc0310 to
2065634
Compare
blackheaven
force-pushed
the
gdifolco/WPB-29579-migration-postgres-properties
branch
from
November 5, 2026 13:32
2065634 to
6b0ede9
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The backfill can overwrite acknowledged updates or resurrect deleted properties, while overlapping backend phases cause the migration integration test to time out before exercising migration.
2 open issues
What changed in this PR
Adds PostgreSQL storage and a Cassandra-to-PostgreSQL migration path for user properties, integrated with Brig and the background worker.
Changes:
- Adds the properties schema, PostgreSQL operations, serialization, and dual-write support.
- Adds background migration execution, metrics, configuration, and operator documentation.
- Adds serialization round-trip tests and an integration migration scenario.
| File | Description |
|---|---|
| services/galley/galley.integration.yaml | Selects PostgreSQL for properties in integration configuration. |
| services/brig/src/Brig/CanonicalInterpreter.hs | Selects the property-store interpreter by migration mode. |
| services/brig/brig.integration.yaml | Enables PostgreSQL property storage for integration tests. |
| services/background-worker/test/Test/Wire/Util.hs | Adds the properties setting to test configuration. |
| services/background-worker/test/Test/Wire/BackendNotificationPusherSpec.hs | Updates migration-option test fixtures. |
| services/background-worker/src/Wire/PostgresMigrations.hs | Starts property migration with metrics and cleanup. |
| services/background-worker/src/Wire/BackgroundWorker/Options.hs | Adds the property migration flag. |
| services/background-worker/src/Wire/BackgroundWorker.hs | Wires migration startup and shutdown. |
| services/background-worker/background-worker.integration.yaml | Adds property storage and migration settings. |
| postgres-schema.sql | Records the properties table and primary key. |
| libs/wire-subsystems/wire-subsystems.cabal | Exposes the new property-store modules. |
| libs/wire-subsystems/src/Wire/PropertyStore/Postgres.hs | Implements PostgreSQL property operations. |
| libs/wire-subsystems/src/Wire/PropertyStore/Migration.hs | Implements paginated Cassandra backfill. |
| libs/wire-subsystems/src/Wire/PropertyStore/DualWrite.hs | Mirrors mutations while retaining Cassandra reads. |
| libs/wire-subsystems/src/Wire/PropertyStore/Cassandra.hs | Exposes a full-table query for migration. |
| libs/wire-subsystems/src/Wire/PostgresMigrationOpts.hs | Adds the properties storage selector. |
| libs/wire-subsystems/postgres-migrations/20261022140000-properties.sql | Creates the PostgreSQL properties table. |
| libs/wire-api/test/unit/Test/Wire/API/Roundtrip/PostgresMarshall.hs | Adds property serialization round-trip tests. |
| libs/wire-api/src/Wire/API/Properties.hs | Adds PostgreSQL conversions and value generation for tests. |
| integration/test/Test/Migration/Properties.hs | Adds a migration and cutover test scenario. |
| integration/integration.cabal | Registers the migration test module. |
| hack/helm_vars/wire-server/values.yaml.gotmpl | Passes the properties storage preference into Helm values. |
| hack/helm_vars/common.yaml.gotmpl | Defines the properties storage preference. |
| docs/src/developer/reference/config-options.md | Documents property migration settings and completion metrics. |
| charts/wire-server/values.yaml | Adds default storage and migration settings. |
| charts/wire-server/templates/background-worker/configmap.yaml | Renders the property migration flag. |
| changelog.d/5-internal/WPB-29579-migration-postgres-properties | Announces the property-store migration support. |
Review effort: Balanced
blackheaven
force-pushed
the
gdifolco/WPB-29579-migration-postgres-properties
branch
2 times, most recently
from
November 10, 2026 08:31
67fc87c to
75b2e93
Compare
- Test/Migration/Properties.hs: run the three dynamic-backend phases sequentially (previous backend fully stopped before the next starts) instead of nesting the callbacks, which deadlocked on port acquisition. - PropertyStore backfill: copy rows with insert-if-absent (ON CONFLICT DO NOTHING) so a stale Cassandra snapshot cannot clobber newer rows that dual-write already put in Postgres; accepted residual races documented in haddock on migratePropertiesRow per the in-code trade-off convention.
…gs, migration tests)
blackheaven
force-pushed
the
gdifolco/WPB-29579-migration-postgres-properties
branch
from
November 13, 2026 11:13
75b2e93 to
221299c
Compare
This branch has not been deployed
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-29579
Checklist
changelog.d