-
Notifications
You must be signed in to change notification settings - Fork 334
Allow configuring page size and parallelism for conversation migration to PostgreSQL #4904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 adds configurable page size and parallelism parameters for the conversation migration from Cassandra to PostgreSQL. The migration previously used hardcoded values (pageSize: 10000), but now allows operators to tune these parameters based on their infrastructure capacity and migration requirements.
Key changes:
- Introduces
MigrationOptionsdata type withpageSizeandparallelismfields - Updates migration functions to accept and use configurable options
- Adds configuration settings in Helm charts and YAML config files
- Implements parallel processing using
unsafePooledMapConcurrentlyN_for improved migration performance
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| libs/wire-subsystems/src/Wire/ConversationStore/Migration.hs | Adds MigrationOptions data type, updates migration functions to accept options, implements parallelism using unsafePooledMapConcurrentlyN_, and adds Concurrency 'Unsafe effect to the effect stack |
| services/background-worker/src/Wire/MigrateConversations.hs | Updates function calls to pass MigrationOptions (incomplete - uses underscore placeholders) |
| services/background-worker/src/Wire/BackgroundWorker/Options.hs | Adds migrateConversationsOptions field to Opts data type |
| services/background-worker/background-worker.integration.yaml | Adds default configuration values for migration options (pageSize: 10000, parallelism: 2) |
| charts/background-worker/values.yaml | Adds migration options configuration to Helm chart defaults |
| charts/background-worker/templates/configmap.yaml | Updates ConfigMap template to include migration options in generated configuration |
| changelog.d/2-features/faster-migration | Documents the new feature with configuration example |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| convLoop <- async . lift $ migrateConvsLoop _ cassClient pgPool logger convMigCounter convMigFinished convMigFailed | ||
| userLoop <- async . lift $ migrateUsersLoop _ cassClient pgPool logger userMigCounter userMigFinished userMigFailed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typed hole can't be correct here
| convLoop <- async . lift $ migrateConvsLoop cassClient pgPool logger convMigCounter convMigFinished convMigFailed | ||
| userLoop <- async . lift $ migrateUsersLoop cassClient pgPool logger userMigCounter userMigFinished userMigFailed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it compile with holes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, why did you approve it 😅
1c4803d to
3c1d331
Compare
Checklist
changelog.d