Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug: lastReceiveLSN not valid for logical replication
Algorithm of calculate lastReceiveLSN are different for logical and physical replication. For physical replication it startLsn from XLogData plus payload size. For logical replication as lastReceiveLSN should be use startLSN from XLogData. Add to result payload size not available, because from WAL reads not RAW data - as a result logical decoding message size can change and we get lsn from the future random future transaction.
- Loading branch information
1 parent
941fa78
commit 44c808b
Showing
5 changed files
with
87 additions
and
15 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
11 changes: 11 additions & 0 deletions
11
pgjdbc/src/main/java/org/postgresql/replication/ReplicationType.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
* Copyright (c) 2017, PostgreSQL Global Development Group | ||
* See the LICENSE file in the project root for more information. | ||
*/ | ||
|
||
package org.postgresql.replication; | ||
|
||
public enum ReplicationType { | ||
LOGICAL, | ||
PHYSICAL | ||
} |
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