|
|
|
|
|
by anarazel
338 days ago
|
|
> Postgres codebase is a shining example of good engineering. They walk a very fine line between many drawbacks. Code is battle tested (and surprisingly readable). Not many people (or groups) can do much better - and if they think they can, they are probably going to learn a lesson in humility. To be fair, we have/PG has plenty crud-y code... Some of it even written by yours truly :(. Including some of the code involved here. But just saying "go back to the drawing board" without really understanding the problem isn't particularly useful. |
|
As mentioned, there should be a read-replica specific code that works using event listeners. Repurposing the primary's code is what causes the issue.
The following pseudocode would give a better picture on the next steps
// Read replica specific implementation
void StandbyWaitForTransactionCompletion(TransactionId xid) {
// Register to receive WAL notifications about this transaction RegisterForWALNotification(xid);