Skip to content

Conversation

@akshaymankar
Copy link
Member

@akshaymankar akshaymankar commented Sep 8, 2025

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

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 Sep 8, 2025
@akshaymankar akshaymankar force-pushed the conversation-postgres branch 2 times, most recently from 9b41958 to 3f46a4d Compare September 10, 2025 08:19
@akshaymankar akshaymankar changed the title Migrate conversation data to postgres Implement Postgres interpreter for ConversationStore Sep 10, 2025
@akshaymankar akshaymankar force-pushed the conversation-postgres branch 10 times, most recently from 53b1c71 to 648ce9c Compare September 17, 2025 07:50
@akshaymankar akshaymankar force-pushed the conversation-postgres branch 7 times, most recently from fa80140 to 7d4af0f Compare September 29, 2025 09:53
@akshaymankar akshaymankar marked this pull request as ready for review October 1, 2025 08:48
@akshaymankar akshaymankar requested review from a team as code owners October 1, 2025 08:48
@akshaymankar akshaymankar requested a review from Copilot October 1, 2025 10:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a PostgreSQL interpreter for ConversationStore, enabling conversation data to be stored in PostgreSQL instead of Cassandra. The purpose is to provide an alternative data storage backend for conversation-related operations while maintaining compatibility with the existing Cassandra implementation.

Key changes include:

  • Implementation of a complete PostgreSQL interpreter for ConversationStore operations
  • Addition of new configuration options to control storage location (Cassandra vs PostgreSQL)
  • Removal of deprecated Cassandra-only functionality and code cleanup

Reviewed Changes

Copilot reviewed 61 out of 61 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
libs/wire-subsystems/src/Wire/ConversationStore/Postgres.hs New 1,228-line PostgreSQL interpreter implementation for ConversationStore
services/galley/src/Galley/Options.hs Added PostgresMigrationOpts configuration and StorageLocation enum
services/galley/src/Galley/App.hs Integrated PostgreSQL interpreter selection based on configuration
libs/wire-subsystems/src/Wire/ConversationStore.hs Refactored interface to separate MLSCommitLockStore and update method signatures
Multiple test files Updated test code to work with the new conversation store interface
Multiple API files Added PostgreSQL marshalling instances for various data types

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@fisx fisx left a comment

Choose a reason for hiding this comment

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

looks nice :-)! hope i didn't leave too many comments. i'm not feeling strongly about most of them.

@akshaymankar akshaymankar force-pushed the conversation-postgres branch from 9af8b8d to ef4193f Compare October 7, 2025 13:04
This will allow us to migrate rest of the conversation data to postgres
akshaymankar and others added 26 commits October 13, 2025 11:39
Also change the Postgres interpreter to do so. In the galley code, this is
explicitly being used as an Upsert.
This replaces the use of ListItems.
The pagination can be done with a UNION query (and not a join as the comment
suggests), but it causes weird problems due to domain being NULL. We could
send the local domain in to always get the domain, but this just causes more
work for Postgres. Its probably more efficient to keep what we have.
…eries

Its too difficult to do this one, perhaps its ok to send one query per remote
domain.
This replaces the use of ListItems with LegacyPaging
Co-authored-by: Matthias Fischmann <[email protected]>
@akshaymankar akshaymankar force-pushed the conversation-postgres branch from 7bd863e to 1be7f26 Compare October 13, 2025 09:39
@akshaymankar akshaymankar merged commit 95e2791 into develop Oct 13, 2025
9 checks passed
@akshaymankar akshaymankar deleted the conversation-postgres branch October 13, 2025 11:38
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