Skip to content
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

SMP server PostgreSQL storage - feature branch (merge, dont squash) #1467

Merged
merged 16 commits into from
Mar 18, 2025

Conversation

epoberezkin
Copy link
Member

@epoberezkin epoberezkin commented Feb 24, 2025

* smp server: queue store typeclass

* parameterize JournalMsgStore

* typeclass for queue store

* postgres WIP

* compiles, passes tests

* remove StoreType

* split migrations

* progress

* addQueueRec

* reduce type spaghetti

* remove addQueue from typeclass definition

* getQueue

* test postgres storage in SMP server

* fix schema

* comment

* import queues to postgresql

* import queues to postgresql

* log

* fix test

* counts

* ci: test smp server with postgres backend (#1463)

* ci: test smp server with postgres backend

* postgres service

* attempt

* attempt

* empty

* empty

* PGHOST attempt

* PGHOST + softlink attempt

* only softlink attempt

* working attempt (PGHOST)

* remove env var

* empty

* do not start server without DB schema, do not import when schema exists

* export database

* enable all tests, disable two tests

* option for migration confirmation

* comments

---------

Co-authored-by: spaced4ndy <[email protected]>
@epoberezkin epoberezkin changed the base branch from stable to master February 24, 2025 15:48
epoberezkin and others added 7 commits February 25, 2025 15:33
* agent, smp server: PostgreSQL connection pool

* simplify, create all connections before start

* rename

* remove imports
* refactor journal store

* update postgres store methods to update STM cache only after DB update

* todos

* drop

Co-authored-by: spaced4ndy <[email protected]>

* fix GHC 8.10.7

---------

Co-authored-by: spaced4ndy <[email protected]>
…ted, combine tables (#1471)

* smp server: expire messages in postgres database

* tty

* fail if nothing updated in db

* remove old deleted queues

* index

* fix tests
…ngs on server start (#1478)

* smp server: check queue storage settings on server start

* fix incorrect postgres migration not throwing exception
* tests: run agent tests with PostgreSQL SMP servers

* agent tests with postgres database

* enable tests

* fix store log tests

* fix test
…t loading and compacting, for debugging during migration) (#1480)

* smp server: optionally maintain store log with postgres storage (without loading and compacting, for debugging during migration)

* refactor

* remove comment
…tate consistency (#1481)

* smp server: mask database store operations from async exception for state consistency

* remove unused, comments
epoberezkin and others added 5 commits March 15, 2025 20:11
…pirations (#1483)

* smp server: expire only active queues

* version

* do not cache all queues while processing expirations

* refactor

* foldWithOptions_

* version

* use shared lock when expiring all queues

* use TMVar

* comment

* rename

* remove fold options

* do not create locks in the Map for temporarily loaded queues

* fix

* revert version
…equire postgres library in the main binary (#1482)

* smp server: split postgres support to a separate executable, to not require postgres library in the main binary

* comments

* enable server_postgres flag by default, add CPP option to test

* refactor

* change default for server_postgres to False

* diff
…1484)

* smp server: CLI option to compact store log with PostgreSQL database

* version

* fix test
…urrency and error handling (#1487)

* smp server: use COPY to import store log to postgres db

* compact queues when importing to postgres

* mempty

* version

* handle errors while expiring, mask async exceptions while getting queue

* whitespace

* version
@epoberezkin epoberezkin merged commit 5c0adcb into master Mar 18, 2025
4 of 8 checks passed
@epoberezkin epoberezkin deleted the postgres branch March 18, 2025 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants