Skip to content

[DO NOT MERGE] Add migration to create logical replication slot for notify dashboard#4906

Open
DilwoarH wants to merge 1 commit into
mainfrom
add-ft-service-stats-db-updates-1
Open

[DO NOT MERGE] Add migration to create logical replication slot for notify dashboard#4906
DilwoarH wants to merge 1 commit into
mainfrom
add-ft-service-stats-db-updates-1

Conversation

@DilwoarH

@DilwoarH DilwoarH commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

NOTE: DO NOT MERGE UNTIL DB HAS BEEN RESTARTED

What

Add migration to create logical replication slot for notify dashboard

Why

This allows us to keep track of changes in the database

@DilwoarH

DilwoarH commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Needs https://github.com/alphagov/notifications-aws/pull/3035 to be merged in first

@DilwoarH
DilwoarH force-pushed the add-ft-service-stats-db-updates-1 branch 2 times, most recently from 81f9491 to 661c1ca Compare July 7, 2026 09:20
@spatel033

Copy link
Copy Markdown
Contributor

max_slot_wal_keep_size is set to -1 on the local database, which means PostgreSQL will retain WAL indefinitely until a consumer connects and acknowledges them. Is there a deployment plan or any precautions in place to ensure the consumer is available and doesn't cause WAL to grow indefinitely?

@DilwoarH
DilwoarH force-pushed the add-ft-service-stats-db-updates-1 branch from 661c1ca to c95c5f5 Compare July 14, 2026 11:37
@DilwoarH

Copy link
Copy Markdown
Contributor Author

max_slot_wal_keep_size is set to -1 on the local database, which means PostgreSQL will retain WAL indefinitely until a consumer connects and acknowledges them. Is there a deployment plan or any precautions in place to ensure the consumer is available and doesn't cause WAL to grow indefinitely?

Good point - I think we'll have to update this here:
https://github.com/alphagov/notifications-local/blob/main/docker-compose.yml#L8-L11

I'll get on this

@DilwoarH
DilwoarH force-pushed the add-ft-service-stats-db-updates-1 branch 3 times, most recently from 7a0aa49 to 579d4df Compare July 15, 2026 11:33
@DilwoarH
DilwoarH force-pushed the add-ft-service-stats-db-updates-1 branch 4 times, most recently from 01ad569 to 278215e Compare July 15, 2026 13:56
@DilwoarH
DilwoarH force-pushed the add-ft-service-stats-db-updates-1 branch from 278215e to fb582fd Compare July 15, 2026 14:09
@spatel033

Copy link
Copy Markdown
Contributor

Good point - I think we'll have to update this here: https://github.com/alphagov/notifications-local/blob/main/docker-compose.yml#L8-L11

I'll get on this

The same issue could happen in the production database if the data is not consumed, unless the production database is configured differently.

@DilwoarH

DilwoarH commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Good point - I think we'll have to update this here: https://github.com/alphagov/notifications-local/blob/main/docker-compose.yml#L8-L11
I'll get on this

The same issue could happen in the production database if the data is not consumed, unless the production database is configured differently.

I don't think we want to restrict production as we'll be relying on the data to update the stats. Also WAL is used for other things so don't want to change any of these

@DilwoarH DilwoarH changed the title Add migration to create logical replication slot for notify dashboard [DO NOT MERGE] Add migration to create logical replication slot for notify dashboard Jul 18, 2026
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.

2 participants