Skip to content

Conversation

gschuager
Copy link

This is intended to solve #222.

Added gap detection and tombstone creation for PostgreSQL subscriptions:

Gap Detection:

  • Monitors sequential global positions during polling
  • Detects when next event position > expected (start + 1)
  • Configurable timeouts to avoid indefinite blocking

Optional tombstones creation:

  • Creates placeholder events at gap positions using try_insert_tombstone SQL function
  • Inserts into special __tombstones__ stream with $tombstone message type
  • Automatically filtered out from user handlers

Configuration Options:

  • GapAgeThresholdMs: Ignore old gaps (default: 1 hour)
  • GapSkipTimeoutMs: Max wait time for gaps (default: 5 seconds)
  • GapHandlingTimeoutMs: When to create tombstones (default: disabled)

Benefits

  • Prevents event skipping in high-concurrency scenarios
  • Configurable and backward compatible (opt-in)

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.

1 participant