Skip to content

UserStore: Add migration logic and migration interpreter - #5324

Merged
akshaymankar merged 49 commits into
developfrom
user-pg-migration-code
Sep 1, 2026
Merged

UserStore: Add migration logic and migration interpreter#5324
akshaymankar merged 49 commits into
developfrom
user-pg-migration-code

Conversation

@akshaymankar

@akshaymankar akshaymankar commented Jul 7, 2026

Copy link
Copy Markdown
Member

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Jul 7, 2026
@akshaymankar
akshaymankar force-pushed the user-pg-migration-code branch from 3e94d0b to 4dcb50c Compare July 9, 2026 12:35
@akshaymankar
akshaymankar force-pushed the user-pg-migration-code branch 6 times, most recently from c109be7 to acf0807 Compare August 3, 2026 09:25
@akshaymankar
akshaymankar force-pushed the user-pg-migration-code branch 2 times, most recently from 51dd43c to 1f3a077 Compare August 4, 2026 15:05
Comment thread integration/test/Test/Migration/User.hs
Comment thread integration/test/Test/Migration/User.hs Outdated
Comment thread integration/test/Test/Migration/User.hs
Comment thread integration/test/Test/Migration/Util.hs
Comment thread services/brig/src/Brig/Data/Activation.hs Outdated
Comment thread services/brig/src/Brig/Data/Activation.hs Outdated
Comment thread libs/wire-subsystems/src/Wire/UserStore/Cassandra.hs Outdated
Comment thread integration/test/Test/Migration/User.hs Outdated
Comment thread libs/wire-subsystems/src/Wire/UserStore/Migration.hs
Comment thread libs/wire-subsystems/src/Wire/UserStore/Migration.hs
Comment thread services/brig/src/Brig/Schema/V93_ReduceUserGCGracePeriod.hs Outdated
Comment thread libs/wire-subsystems/src/Wire/UserStore/Migration.hs Outdated
Comment thread libs/wire-subsystems/src/Wire/UserStore/Migration.hs
@akshaymankar
akshaymankar force-pushed the user-pg-migration-code branch 5 times, most recently from dda9c2d to d86bc83 Compare August 25, 2026 14:04
@akshaymankar
akshaymankar changed the base branch from develop to remove-handle-from-new-stored-user August 25, 2026 14:27
@akshaymankar
akshaymankar marked this pull request as ready for review August 25, 2026 14:37
@akshaymankar
akshaymankar requested review from a team as code owners August 25, 2026 14:37

@blackheaven blackheaven left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nits only, LGTM

Comment thread integration/test/Test/Migration/User.hs
Comment thread libs/wire-subsystems/src/Wire/UserStore/Cassandra.hs Outdated
Comment thread libs/wire-subsystems/src/Wire/UserStore/Postgres.hs Outdated
Comment thread libs/wire-subsystems/src/Wire/UserStore/Cassandra.hs
Comment thread docs/src/developer/reference/config-options.md Outdated

migration :: Migration
migration =
Migration 94 "reduce user gc_grace_period" $ do

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a changelog entry for this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, but we also don't have an entry for other tables we did this for.

Base automatically changed from remove-handle-from-new-stored-user to develop August 26, 2026 07:58
@akshaymankar
akshaymankar force-pushed the user-pg-migration-code branch from d86bc83 to f9aab14 Compare August 26, 2026 07:58
akshaymankar and others added 26 commits August 31, 2026 14:27
Using `runAppropriateInterpreter` queries PG twice if the user exists in PG
When using `State` sometimes the error count is not correct.
These can happen due to race in the migration interpreter. The user who gets it
in postgresql first, wins.
Also refactor integration tests for clarity.
Co-authored-by: Gautier DI FOLCO <gautier.difolco@wire.com>
@akshaymankar
akshaymankar force-pushed the user-pg-migration-code branch from c203ed7 to c62cffd Compare August 31, 2026 12:28
@akshaymankar
akshaymankar merged commit 6fb1308 into develop Sep 1, 2026
10 checks passed
@akshaymankar
akshaymankar deleted the user-pg-migration-code branch September 1, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants