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

changed WAL update logic #458

Merged
merged 3 commits into from
Sep 30, 2023
Merged

changed WAL update logic #458

merged 3 commits into from
Sep 30, 2023

Conversation

heavycrystal
Copy link
Contributor

@heavycrystal heavycrystal commented Sep 29, 2023

This PR is debugging an issue where schema change propagation (#368) don't apply properly when there are parallel transactions happening during an ALTER TABLE statement.

Borrowing from jackc/pglogrepl#59

This PR changes the handling of clientXLogPos to match the one from Postgres' own pg_recvlogical:

  • keepalive messages should bump the position too, as they're only sent (from what I can tell) after any xlogdata message;
  • both the WALStart and the ServerWALEnd in logical xlogdata messages represent the position that should be reported back, and adding the length of the post-decoding data to it is meaningless;
  • relation messages have a position of zero, and in general we should match the pg_recvlogical behavior of only increasing the local position.

@iskakaushik iskakaushik force-pushed the schema-changes-fix-wal branch from 488b419 to 6961482 Compare September 30, 2023 13:23
@iskakaushik iskakaushik merged commit 71930a4 into main Sep 30, 2023
19 checks passed
@serprex serprex deleted the schema-changes-fix-wal branch July 19, 2024 15:18
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