Skip to content

Postgres source: slot startup check and feedback inaccuracies #97

Description

@lukashes

Grouped findings from the stability review, all in the replication path.

  • The slot existence check (createSlotIfNotExists) queries pg_replication_slots by name only. A same-named slot in another database, or one created with a different plugin, passes the check, then START_REPLICATION fails on every start: a crash loop the supervisor cannot heal. Add AND database = current_database() and verify plugin = 'pgoutput' with a clear error.
  • The drain loop swallows receive errors (source.zig: self.protocol.receiveMessage(0) catch break). A real connection failure is masked, the batch is returned as successful, and the error surfaces only on the next blocking receive. Log it at least.
  • sendFeedback sends client_time as Unix seconds, but the protocol expects microseconds since 2000-01-01. pg_stat_replication.reply_time shows garbage. Cosmetic, still worth fixing while nobody depends on it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions