Skip to content

WPB-22955: migrate mls-proposal-refs to PostGreSQL - #5411

Open
blackheaven wants to merge 2 commits into
developfrom
gdifolco/WPB-22955-migration-postgres-mls-proposal-refs
Open

blackheaven wants to merge 2 commits into
developfrom
gdifolco/WPB-22955-migration-postgres-mls-proposal-refs

Conversation

@blackheaven

@blackheaven blackheaven commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

https://wearezeta.atlassian.net/browse/WPB-22955

Checklist

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

@blackheaven
blackheaven requested review from a team as code owners August 4, 2026 08:21
@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Aug 4, 2026
@blackheaven
blackheaven force-pushed the gdifolco/WPB-22955-migration-postgres-mls-proposal-refs branch from 504d497 to d79a73f Compare August 4, 2026 08:24
@blackheaven
blackheaven force-pushed the gdifolco/WPB-22955-migration-postgres-mls-proposal-refs branch 2 times, most recently from 48de034 to 3a550ad Compare September 11, 2026 17:49
@blackheaven
blackheaven force-pushed the gdifolco/WPB-22955-migration-postgres-mls-proposal-refs branch from 3a550ad to 406e93c Compare September 24, 2026 07:24

@akshaymankar akshaymankar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This table is expected to see a lot of updates, since the backend sends the proposals and the clients race to commit them. So, I think the dual write strategy is not the best here. WDYT?

@blackheaven

Copy link
Copy Markdown
Contributor Author

It deserves benchmarks, but if it is a concern, we can go for unlogged tables.

@blackheaven
blackheaven force-pushed the gdifolco/WPB-22955-migration-postgres-mls-proposal-refs branch from 406e93c to 19f1bd7 Compare October 20, 2026 17:29
@blackheaven
blackheaven force-pushed the gdifolco/WPB-22955-migration-postgres-mls-proposal-refs branch from 19f1bd7 to 8ac04c3 Compare October 29, 2026 19:33

@akshaymankar akshaymankar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The expired data should be cleaned up in a background task.

@akshaymankar

Copy link
Copy Markdown
Member

Another thing I found:
The propsals are being written one by one from here, perhaps we should bulk write them:

msgs <- for indices $ \idx -> do
let proposal = mkRawMLS (RemoveProposal idx)
pmsg <-
liftRandom $
mkSignedPublicMessage @ss
kp
(cnvmlsGroupId meta)
(cnvmlsEpoch meta)
(TaggedSenderExternal 0)
(FramedContentProposal proposal)
let msg = mkRawMLS (mkMessage (MessagePublic pmsg))
storeProposal
(cnvmlsGroupId meta)
(cnvmlsEpoch meta)
StoredProposal
{ ref = publicMessageRef cs pmsg,
origin = Just ProposalOriginBackend,
proposal
}

@blackheaven
blackheaven force-pushed the gdifolco/WPB-22955-migration-postgres-mls-proposal-refs branch 2 times, most recently from 67e0807 to 46f06b5 Compare November 5, 2026 12:10
@blackheaven

Copy link
Copy Markdown
Contributor Author

Both asks are implemented: expired mls_proposal_refs rows are deleted daily by the pg_cron job scheduled in 20261104121503-mls-proposal-refs-ttl-cleanup.sql (skips with WARNING when pg_cron is absent); the unused GetProposal/GetAllPendingProposalRefs ops were deleted (0d88a5d). Rebased onto current develop.

@blackheaven
blackheaven force-pushed the gdifolco/WPB-22955-migration-postgres-mls-proposal-refs branch 3 times, most recently from a8f9e9c to 7966d32 Compare November 16, 2026 20:10
@blackheaven
blackheaven force-pushed the gdifolco/WPB-22955-migration-postgres-mls-proposal-refs branch from 7966d32 to bd9a528 Compare November 17, 2026 14:06
@blackheaven
blackheaven force-pushed the gdifolco/WPB-22955-migration-postgres-mls-proposal-refs branch 2 times, most recently from d10ab27 to d024e4e Compare November 30, 2026 08:29
@blackheaven

Copy link
Copy Markdown
Contributor Author

@akshaymankar FYI, data migration have been removed to speed up the support of PostGreSQL, feel free to have a look at it when you have some time, thanks in advance.

@blackheaven
blackheaven force-pushed the gdifolco/WPB-22955-migration-postgres-mls-proposal-refs branch 2 times, most recently from db94f8d to fc3bed8 Compare December 3, 2026 08:47
@blackheaven
blackheaven force-pushed the gdifolco/WPB-22955-migration-postgres-mls-proposal-refs branch from fc3bed8 to af09248 Compare December 3, 2026 23:52
Move the pool usage error redaction (CleanupFailure, classifyUsageError,
renderCleanupFailure, cleanupFailedMessage) into Wire.UsageErrorRedaction
and use it where background-worker turned a UsageError into text: the
effect runner of adminless, background and meetings cleanup jobs no
longer embeds `show` of the error, and the meetings cleanup log no
longer shows the text again.

Extract runCleanupWith from runExpirationsCleanup and test that it logs
and throws only the redacted category, test the effect runner's mapping,
and make the redaction property assert that rendering ignores the
error's free-form text.

This branch has not been deployed

No deployments
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.

4 participants