Skip to content

Skip logical slot processing in PostgreSQL polling mode - #651

Merged
toluaina merged 1 commit into
toluaina:mainfrom
vvsos1:fix/postgresql-polling-checkpoint
Aug 28, 2026
Merged

Skip logical slot processing in PostgreSQL polling mode#651
toluaina merged 1 commit into
toluaina:mainfrom
vvsos1:fix/postgresql-polling-checkpoint

Conversation

@vvsos1

@vvsos1 vvsos1 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • advance the PostgreSQL polling checkpoint after each successful forward pass
  • skip WAL and logical replication-slot processing in polling mode
  • add regression coverage

Problem

PGSync documents --polling as operating
instead of logical replication
and requiring
only database read access.

However, Sync.pull(polling=True) still calls logical-slot operations. If
the slot is missing or the user lacks replication privileges, the checkpoint
is not updated, causing the same rows—or the full table—to be scanned again
on every cycle.

Solution

After a successful forward pass, PostgreSQL polling mode now stores the
captured snapshot_xmin checkpoint and returns before accessing the WAL or
logical replication slot.

MySQL/MariaDB and PostgreSQL replication-based modes are unchanged.

Tests

  • pytest tests/test_sync_polling.py -vv
  • ./scripts/lint.sh

@toluaina toluaina left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great find. and thanks for adding test

@toluaina
toluaina merged commit 7f3c881 into toluaina:main Aug 28, 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