Skip to content

Replication feedback: a zero interval floods the server, invalid intervals break the stream, SendStatusUpdate hides write failures #6698

Description

@Brar
  • WalReceiverStatusInterval = TimeSpan.Zero makes the status update timer fire in a loop: it starts with a due time of 0 and is re-armed with 0 after each update, so the client sends status updates as fast as it can. WalReceiverTimeout = TimeSpan.Zero does the same with updates that request a reply, which the server answers every time (ReplicationConnection.cs:137, 143-152, 456-457, 665-667). In PostgreSQL, 0 turns these off for wal_receiver_status_interval and wal_receiver_timeout (postgres doc/src/sgml/config.sgml:5511-5512, 5573).
  • The setters accept negative values and values too large for a timer (:137, 143-152). Then new Timer(…) throws ArgumentOutOfRangeException after the server has entered COPY mode (:456-457), which leaves the connection unusable. With PostgreSQL 14.24 and 18.6, a negative interval or TimeSpan.MaxValue made the first MoveNextAsync throw, e.g. "dueTime ('-1000') must be greater than or equal to '-1'" for -1 s, and the next IDENTIFY_SYSTEM then failed with "Received backend message CopyData while expecting RowDescriptionMessage. Please file a bug."
  • SendStatusUpdate logs a failed write and returns normally, so a caller that pushes its flush position, e.g. for synchronous replication, can't tell that it never reached the server (:596 calls SendFeedback, which swallows it at :654-657).
  • The log message reads "SendStatusUpdatewas called" (:595).

The same code is on the 8.0, 9.0 and 10.0 hotfix branches. #6456 was the related InfiniteTimeSpan case, fixed by #6464.

Activity

  1. added this to the 11.0.0 milestone on Oct 25, 2026
  2. self-assigned this
    on Oct 25, 2026
  3. added theissue type on Oct 25, 2026
  4. modified the milestones: 11.0.0, 12.0.0 on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions