pgsql: Move MarkCurrentTransactionIdLoggedIfAny() out of the critical s

2021-11-01 Thread Amit Kapila
Move MarkCurrentTransactionIdLoggedIfAny() out of the critical section. We don't modify any shared state in this function which could cause problems for any concurrent session. This will make it look similar to the other updates for the same structure (TransactionState) which avoids confusion for

pgsql: Replace XLOG_INCLUDE_XID flag with a more localized flag.

2021-11-01 Thread Amit Kapila
Replace XLOG_INCLUDE_XID flag with a more localized flag. Commit 0bead9af484c introduced XLOG_INCLUDE_XID flag to indicate that the WAL record contains subXID-to-topXID association. It uses that flag later to mark in CurrentTransactionState that top-xid is logged so that we should not try to log i

pgsql: Replace unicode characters in comments with ascii

2021-11-01 Thread Daniel Gustafsson
Replace unicode characters in comments with ascii The unicode characters, while in comments and not code, caused MSVC to emit compiler warning C4819: The file contains a character that cannot be represented in the current code page (number). Save the file in Unicode format to prevent data

pgsql: Avoid some other O(N^2) hazards in list manipulation.

2021-11-01 Thread Tom Lane
Avoid some other O(N^2) hazards in list manipulation. In the same spirit as 6301c3ada, fix some more places where we were using list_delete_first() in a loop and thereby risking O(N^2) behavior. It's not clear that the lists manipulated in these spots can get long enough to be really problematic

pgsql: Avoid some other O(N^2) hazards in list manipulation.

2021-11-01 Thread Tom Lane
Avoid some other O(N^2) hazards in list manipulation. In the same spirit as 6301c3ada, fix some more places where we were using list_delete_first() in a loop and thereby risking O(N^2) behavior. It's not clear that the lists manipulated in these spots can get long enough to be really problematic

pgsql: Avoid some other O(N^2) hazards in list manipulation.

2021-11-01 Thread Tom Lane
Avoid some other O(N^2) hazards in list manipulation. In the same spirit as 6301c3ada, fix some more places where we were using list_delete_first() in a loop and thereby risking O(N^2) behavior. It's not clear that the lists manipulated in these spots can get long enough to be really problematic

pgsql: Handle XLOG_OVERWRITE_CONTRECORD in DecodeXLogOp

2021-11-01 Thread Alvaro Herrera
Handle XLOG_OVERWRITE_CONTRECORD in DecodeXLogOp Failing to do so results in inability of logical decoding to process the WAL stream. Handle it by doing nothing. Backpatch all the way back. Reported-by: Petr Jelínek Branch -- REL_10_STABLE Details --- https://git.postgresql.org/pg/co

pgsql: Handle XLOG_OVERWRITE_CONTRECORD in DecodeXLogOp

2021-11-01 Thread Alvaro Herrera
Handle XLOG_OVERWRITE_CONTRECORD in DecodeXLogOp Failing to do so results in inability of logical decoding to process the WAL stream. Handle it by doing nothing. Backpatch all the way back. Reported-by: Petr Jelínek Branch -- REL_12_STABLE Details --- https://git.postgresql.org/pg/co

pgsql: Handle XLOG_OVERWRITE_CONTRECORD in DecodeXLogOp

2021-11-01 Thread Alvaro Herrera
Handle XLOG_OVERWRITE_CONTRECORD in DecodeXLogOp Failing to do so results in inability of logical decoding to process the WAL stream. Handle it by doing nothing. Backpatch all the way back. Reported-by: Petr Jelínek Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/co

pgsql: Handle XLOG_OVERWRITE_CONTRECORD in DecodeXLogOp

2021-11-01 Thread Alvaro Herrera
Handle XLOG_OVERWRITE_CONTRECORD in DecodeXLogOp Failing to do so results in inability of logical decoding to process the WAL stream. Handle it by doing nothing. Backpatch all the way back. Reported-by: Petr Jelínek Branch -- master Details --- https://git.postgresql.org/pg/commitdif

pgsql: Handle XLOG_OVERWRITE_CONTRECORD in DecodeXLogOp

2021-11-01 Thread Alvaro Herrera
Handle XLOG_OVERWRITE_CONTRECORD in DecodeXLogOp Failing to do so results in inability of logical decoding to process the WAL stream. Handle it by doing nothing. Backpatch all the way back. Reported-by: Petr Jelínek Branch -- REL9_6_STABLE Details --- https://git.postgresql.org/pg/co

pgsql: Handle XLOG_OVERWRITE_CONTRECORD in DecodeXLogOp

2021-11-01 Thread Alvaro Herrera
Handle XLOG_OVERWRITE_CONTRECORD in DecodeXLogOp Failing to do so results in inability of logical decoding to process the WAL stream. Handle it by doing nothing. Backpatch all the way back. Reported-by: Petr Jelínek Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/co

pgsql: Handle XLOG_OVERWRITE_CONTRECORD in DecodeXLogOp

2021-11-01 Thread Alvaro Herrera
Handle XLOG_OVERWRITE_CONTRECORD in DecodeXLogOp Failing to do so results in inability of logical decoding to process the WAL stream. Handle it by doing nothing. Backpatch all the way back. Reported-by: Petr Jelínek Branch -- REL_14_STABLE Details --- https://git.postgresql.org/pg/co