pgsql: Document a few caveats in synchronous logical replication.

2021-06-16 Thread Amit Kapila
Document a few caveats in synchronous logical replication. In a synchronous logical setup, locking [user] catalog tables can cause deadlock. This is because logical decoding of transactions can lock catalog tables to access them so exclusively locking those in transactions can lead to deadlock. To

pgsql: Document a few caveats in synchronous logical replication.

2021-06-16 Thread Amit Kapila
Document a few caveats in synchronous logical replication. In a synchronous logical setup, locking [user] catalog tables can cause deadlock. This is because logical decoding of transactions can lock catalog tables to access them so exclusively locking those in transactions can lead to deadlock. To

pgsql: Document a few caveats in synchronous logical replication.

2021-06-16 Thread Amit Kapila
Document a few caveats in synchronous logical replication. In a synchronous logical setup, locking [user] catalog tables can cause deadlock. This is because logical decoding of transactions can lock catalog tables to access them so exclusively locking those in transactions can lead to deadlock. To

pgsql: Document a few caveats in synchronous logical replication.

2021-06-16 Thread Amit Kapila
Document a few caveats in synchronous logical replication. In a synchronous logical setup, locking [user] catalog tables can cause deadlock. This is because logical decoding of transactions can lock catalog tables to access them so exclusively locking those in transactions can lead to deadlock. To

pgsql: Document a few caveats in synchronous logical replication.

2021-06-16 Thread Amit Kapila
Document a few caveats in synchronous logical replication. In a synchronous logical setup, locking [user] catalog tables can cause deadlock. This is because logical decoding of transactions can lock catalog tables to access them so exclusively locking those in transactions can lead to deadlock. To

pgsql: Document a few caveats in synchronous logical replication.

2021-06-16 Thread Amit Kapila
Document a few caveats in synchronous logical replication. In a synchronous logical setup, locking [user] catalog tables can cause deadlock. This is because logical decoding of transactions can lock catalog tables to access them so exclusively locking those in transactions can lead to deadlock. To

pgsql: Detect unused steps in isolation specs and do some cleanup

2021-06-16 Thread Michael Paquier
Detect unused steps in isolation specs and do some cleanup This is useful for developers to find out if an isolation spec is over-engineered or if it needs more work by warning at the end of a test run if a step is not used, generating a failure with extra diffs. While on it, clean up all the spe

pgsql: Detect unused steps in isolation specs and do some cleanup

2021-06-16 Thread Michael Paquier
Detect unused steps in isolation specs and do some cleanup This is useful for developers to find out if an isolation spec is over-engineered or if it needs more work by warning at the end of a test run if a step is not used, generating a failure with extra diffs. While on it, clean up all the spe

pgsql: Detect unused steps in isolation specs and do some cleanup

2021-06-16 Thread Michael Paquier
Detect unused steps in isolation specs and do some cleanup This is useful for developers to find out if an isolation spec is over-engineered or if it needs more work by warning at the end of a test run if a step is not used, generating a failure with extra diffs. While on it, clean up all the spe

pgsql: Detect unused steps in isolation specs and do some cleanup

2021-06-16 Thread Michael Paquier
Detect unused steps in isolation specs and do some cleanup This is useful for developers to find out if an isolation spec is over-engineered or if it needs more work by warning at the end of a test run if a step is not used, generating a failure with extra diffs. While on it, clean up all the spe

pgsql: Remove dry-run mode from isolationtester

2021-06-16 Thread Michael Paquier
Remove dry-run mode from isolationtester The original purpose of the dry-run mode is to be able to print all the possible permutations from a spec file, but it has become less useful since isolation tests have improved regarding deadlock detection as one step not wanted by the author could block i

pgsql: Remove dry-run mode from isolationtester

2021-06-16 Thread Michael Paquier
Remove dry-run mode from isolationtester The original purpose of the dry-run mode is to be able to print all the possible permutations from a spec file, but it has become less useful since isolation tests have improved regarding deadlock detection as one step not wanted by the author could block i

pgsql: Remove dry-run mode from isolationtester

2021-06-16 Thread Michael Paquier
Remove dry-run mode from isolationtester The original purpose of the dry-run mode is to be able to print all the possible permutations from a spec file, but it has become less useful since isolation tests have improved regarding deadlock detection as one step not wanted by the author could block i

pgsql: Remove dry-run mode from isolationtester

2021-06-16 Thread Michael Paquier
Remove dry-run mode from isolationtester The original purpose of the dry-run mode is to be able to print all the possible permutations from a spec file, but it has become less useful since isolation tests have improved regarding deadlock detection as one step not wanted by the author could block i

pgsql: Fix plancache refcount leak after error in ExecuteQuery.

2021-06-16 Thread Tom Lane
Fix plancache refcount leak after error in ExecuteQuery. When stuffing a plan from the plancache into a Portal, one is not supposed to risk throwing an error between GetCachedPlan and PortalDefineQuery; if that happens, the plan refcount incremented by GetCachedPlan will be leaked. I managed to b

pgsql: Fix plancache refcount leak after error in ExecuteQuery.

2021-06-16 Thread Tom Lane
Fix plancache refcount leak after error in ExecuteQuery. When stuffing a plan from the plancache into a Portal, one is not supposed to risk throwing an error between GetCachedPlan and PortalDefineQuery; if that happens, the plan refcount incremented by GetCachedPlan will be leaked. I managed to b

pgsql: Fix plancache refcount leak after error in ExecuteQuery.

2021-06-16 Thread Tom Lane
Fix plancache refcount leak after error in ExecuteQuery. When stuffing a plan from the plancache into a Portal, one is not supposed to risk throwing an error between GetCachedPlan and PortalDefineQuery; if that happens, the plan refcount incremented by GetCachedPlan will be leaked. I managed to b

pgsql: Fix plancache refcount leak after error in ExecuteQuery.

2021-06-16 Thread Tom Lane
Fix plancache refcount leak after error in ExecuteQuery. When stuffing a plan from the plancache into a Portal, one is not supposed to risk throwing an error between GetCachedPlan and PortalDefineQuery; if that happens, the plan refcount incremented by GetCachedPlan will be leaked. I managed to b

pgsql: Fix plancache refcount leak after error in ExecuteQuery.

2021-06-16 Thread Tom Lane
Fix plancache refcount leak after error in ExecuteQuery. When stuffing a plan from the plancache into a Portal, one is not supposed to risk throwing an error between GetCachedPlan and PortalDefineQuery; if that happens, the plan refcount incremented by GetCachedPlan will be leaked. I managed to b

pgsql: Fix plancache refcount leak after error in ExecuteQuery.

2021-06-16 Thread Tom Lane
Fix plancache refcount leak after error in ExecuteQuery. When stuffing a plan from the plancache into a Portal, one is not supposed to risk throwing an error between GetCachedPlan and PortalDefineQuery; if that happens, the plan refcount incremented by GetCachedPlan will be leaked. I managed to b

pgsql: Fix copying data into slots with FDW batching

2021-06-16 Thread Tomas Vondra
Fix copying data into slots with FDW batching Commit b676ac443b optimized handling of tuple slots with bulk inserts into foreign tables, so that the slots are initialized only once and reused for all batches. The data was however copied into the slots only after the initialization, inserting dupli

pgsql: Improve SQLSTATE reporting in some replication-related code.

2021-06-16 Thread Tom Lane
Improve SQLSTATE reporting in some replication-related code. I started out with the goal of reporting ERRCODE_CONNECTION_FAILURE when walrcv_connect() fails, but as I looked around I realized that whoever wrote this code was of the opinion that errcodes are purely optional. That's not my understa

pgsql: Fix outdated comment that talked about seek position of WAL file

2021-06-16 Thread Heikki Linnakangas
Fix outdated comment that talked about seek position of WAL file. Since commit c24dcd0cfd, we have been using pg_pread() to read the WAL file, which doesn't change the seek position (unless we fall back to the implementation in src/port/pread.c). Update comment accordingly. Backpatch-through: 12,

pgsql: Fix outdated comment that talked about seek position of WAL file

2021-06-16 Thread Heikki Linnakangas
Fix outdated comment that talked about seek position of WAL file. Since commit c24dcd0cfd, we have been using pg_pread() to read the WAL file, which doesn't change the seek position (unless we fall back to the implementation in src/port/pread.c). Update comment accordingly. Backpatch-through: 12,

pgsql: Fix outdated comment that talked about seek position of WAL file

2021-06-16 Thread Heikki Linnakangas
Fix outdated comment that talked about seek position of WAL file. Since commit c24dcd0cfd, we have been using pg_pread() to read the WAL file, which doesn't change the seek position (unless we fall back to the implementation in src/port/pread.c). Update comment accordingly. Backpatch-through: 12,