You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Replication feedback: a zero interval floods the server, invalid intervals break the stream, SendStatusUpdate hides write failures #6698
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