mirror of
https://github.com/lldap/lldap.git
synced 2026-04-26 00:36:01 +03:00
[GH-ISSUE #1194] [BUG] Metadata table error with Postgres Replica #422
Labels
No labels
backend
blocked
bug
cleanup
dependencies
docker
documentation
duplicate
enhancement
enhancement
frontend
github_actions
good first issue
help wanted
help wanted
integration
invalid
ldap
pull-request
question
rust
rust
tests
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/lldap-lldap#422
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @azamaulanaaa on GitHub (Jun 28, 2025).
Original GitHub issue: https://github.com/lldap/lldap/issues/1194
Describe the bug
I want to connect lldap with postgresql with replica via
wal_level = logical. lldap produce error on intial or successive connection to postgresTo Reproduce
Steps to reproduce the behavior:
wal_level = logicalExpected behavior
Work just fine.
Logs
Additional context
it is fixable through run this sql query then restart lldap
@nitnelave commented on GitHub (Jun 28, 2025):
It doesn't really make sense for the metadata table to have a serial ID. Here, we're kinda abusing the SQL DB to store single scalar values (and currently just one, the migration version), in order to avoid having state anywhere else.
I'm not familiar with postgres replication, so I'm not sure I can help here
@azamaulanaaa commented on GitHub (Jun 28, 2025):
Sorry,
wal_level = logicalis not enough to produce error, it requires a publication. here is how i achieve publicationnerdctl exec -it postgres psql -U postgres -d postgres -c "CREATE PUBLICATION postgres_pub FOR ALL TABLES;"note
@azamaulanaaa commented on GitHub (Jun 28, 2025):
given the circumstances that metadata table has, i found the fastest way is to make version column as primary key.
alter table metadata add constraint metadata_pkey primary key (version);i able to do the pr but i cannot guarantee 100% works as the ci hard to replicate in my side. i need to patch a lot of github ci yaml. as long as it able to compile and pass all the tests, it should be fine right?
@nitnelave commented on GitHub (Jun 28, 2025):
I feel like the best solution would be to not create a publication for the metadata table. It only changes on DB migrations, which happen on startup when changing LLDAP versions
@azamaulanaaa commented on GitHub (Jun 28, 2025):
sorry, i miss that option.
after looking closely at pgsql docs for publication. pgsql's publication does not include alter table. so
metadatatable should not include at publication. i will close this issue and the pr. Thank you