Repository navigation
WPB-22954: migrate mls-commit-locks to PostGreSQL - #5415
blackheaven wants to merge 6 commits into
Conversation
akshaymankar
left a comment
There was a problem hiding this comment.
Why do we need to migrate these locks? Can we not just use some pg advisory locks instead of creating a table?
|
Agreed — no table needed. This is now a direct cutover to pg advisory locks (cc03ef9), reusing the same session-scoped advisory-lock mechanism as the domain-registration/team-feature dual-writes ( |
cc03ef9 to
abc0f6f
Compare
76ff607 to
4bf7ce9
Compare
4bf7ce9 to
3a03695
Compare
3a03695 to
f272542
Compare
f272542 to
92525e5
Compare
5f57cff to
d4eed5d
Compare
d4eed5d to
7532eba
Compare
Migrate the MLS commit-lock store (galley) from Cassandra to PostgreSQL using the dual-write + background-worker pattern, following the CodeStore recipe. The Postgres acquire replicates Cassandra's IF NOT EXISTS USING TTL via INSERT ... ON CONFLICT DO UPDATE WHERE expires_at < now() RETURNING, honoring both CAS mutual exclusion and TTL expiry (a pure DO NOTHING would leave an expired lock blocking its (group_id, epoch) forever, since Postgres has no TTL reaper). Adds Postgres/DualWrite/Migration interpreters, a migration flag + metrics, helm/config/docs wiring, schema migration, and an integration test.
Replaces the mls_commit_locks table + dual-write + backfill migration from the previous commit with a direct cutover to session-scoped pg advisory locks (Wire.MigrationLock try-lock). Contention answers stale-message immediately; crash safety comes from the holding connection dying instead of the 10-minute TTL. Deletes the MLSCommitLockStore.DualWrite/Migration modules, the background-worker migration job, the 20260804143320 SQL migration and all mlsCommitLocks/migrateMLSCommitLocks config knobs. The cassandra mls_commit_locks table becomes unread; dropping it (and galley schema V68) is a follow-up.
A rebase onto develop with bad conflict resolutions silently reverted newer upstream work: cannon.configuratorImage in the wire-server chart values (broke the kube-integration CI helm render at cannon/statefulset.yaml:146), the background-worker user-migration wiring (migrateUsers), meetings time-setting values/docs, and a separator line in postgres-schema.sql. Restore all of these from origin/develop; the MLS advisory-lock cutover needs none of the reverted content.
randomUser users are not connected, so galley rejects the commit bundle with 403 not-connected. Use createAndConnectUsers, matching the old testCommitLock and the other integration-package MLS tests.
7532eba to
2bfe2be
Compare
https://wearezeta.atlassian.net/browse/WPB-22954
Checklist
changelog.d