-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pg: reset seq num in replication after commit msg
Untracked transaction are intended to have a sequence number of -1, indicating there was no sequence update, which is used by transactions from a pg.DB instance to correlate WAL data updates with a certain transaction. This commit fixes the replication monitor to work correctly with concurrent untracked transactions by: - reset the seq var to -1 in the captureRepl loop after each commit - when a commit is reached with seq still -1 (not updated by an untracked transaction), do NOT send the commit ID on the channel This also beefs up the logging and error handling in unexpected cases, which corresponds to improper use of replMon methods or concurrent (ab)use of the sentry table to break correct transaction sequencing. Also, update the low-level replConn test: It only sends commit IDs for sequenced transactions now because it needs to work with concurrent transactions not created by a pg.DB instance.
- Loading branch information
1 parent
e9411ce
commit da52bba
Showing
3 changed files
with
62 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters