Re: pgsql: Allow page lock to conflict among parallel group members.

2020-03-21 Thread Amit Kapila
On Sun, Mar 22, 2020 at 5:57 AM Andres Freund wrote: > > Hi, > > On 2020-03-21 03:27:07 +, Amit Kapila wrote: > > Currently, the parallel mode is strictly read-only, but after this patch > > we have the infrastructure to allow parallel inserts and parallel copy. > > Minor nit: I don't think th

Re: pgsql: Allow page lock to conflict among parallel group members.

2020-03-21 Thread Andres Freund
Hi, On 2020-03-21 03:27:07 +, Amit Kapila wrote: > Currently, the parallel mode is strictly read-only, but after this patch > we have the infrastructure to allow parallel inserts and parallel copy. Minor nit: I don't think this gets to fully having the infrastructure for that. It just removes

pgsql: Fix up recent breakage of headerscheck and cpluspluscheck.

2020-03-21 Thread Tom Lane
Fix up recent breakage of headerscheck and cpluspluscheck. headerscheck and cpluspluscheck should skip the recently-added cmdtaglist.h header, since (like kwlist.h and some other similarly- designed headers) it's not meant to be included standalone. evtcache.h was missing an #include to support i

Re: pgsql: Skip WAL for new relfilenodes, under wal_level=minimal.

2020-03-21 Thread Noah Misch
On Sat, Mar 21, 2020 at 03:04:51PM -0400, Tom Lane wrote: > Noah Misch writes: > > Skip WAL for new relfilenodes, under wal_level=minimal. > > Various buildfarm members seem not happy with this, > though it's not universal. Yeah, see the main thread: https://postgr.es/m/20200321190127.GA1763544%

Re: pgsql: Skip WAL for new relfilenodes, under wal_level=minimal.

2020-03-21 Thread Tom Lane
Noah Misch writes: > Skip WAL for new relfilenodes, under wal_level=minimal. Various buildfarm members seem not happy with this, though it's not universal. Also, given the invasiveness of the patch, I'm quite astonished that you chose to back-patch it. Is this really worth ABI breakage risks in

pgsql: During heap rebuild, lock any TOAST index until end of transacti

2020-03-21 Thread Noah Misch
During heap rebuild, lock any TOAST index until end of transaction. swap_relation_files() calls toast_get_valid_index() to find and lock this index, just before swapping with the rebuilt TOAST index. The latter function releases the lock before returning. Potential for mischief is low; a concurr

pgsql: During heap rebuild, lock any TOAST index until end of transacti

2020-03-21 Thread Noah Misch
During heap rebuild, lock any TOAST index until end of transaction. swap_relation_files() calls toast_get_valid_index() to find and lock this index, just before swapping with the rebuilt TOAST index. The latter function releases the lock before returning. Potential for mischief is low; a concurr

pgsql: In log_newpage_range(), heed forkNum and page_std arguments.

2020-03-21 Thread Noah Misch
In log_newpage_range(), heed forkNum and page_std arguments. The function assumed forkNum=MAIN_FORKNUM and page_std=true, ignoring the actual arguments. Existing callers passed exactly those values, so there's no live bug. Back-patch to v12, where the function first appeared, because another fix

pgsql: Back-patch log_newpage_range().

2020-03-21 Thread Noah Misch
Back-patch log_newpage_range(). Back-patch a subset of commit 9155580fd5fc2a0cbb23376dfca7cd21f59c2c7b to v11, v10, 9.6, and 9.5. Include the latest repairs to this function. Use a new XLOG_FPI_MULTI value instead of reusing XLOG_FPI. That way, if an older server reads WAL from this function, th

pgsql: Fix cosmetic blemishes involving rd_createSubid.

2020-03-21 Thread Noah Misch
Fix cosmetic blemishes involving rd_createSubid. Remove an obsolete comment from AtEOXact_cleanup(). Restore formatting of a comment in struct RelationData, mangled by the pgindent run in commit 9af4159fce6654aa0e081b00d02bca40b978745c. Back-patch to 9.5 (all supported versions), because another

pgsql: Skip WAL for new relfilenodes, under wal_level=minimal.

2020-03-21 Thread Noah Misch
Skip WAL for new relfilenodes, under wal_level=minimal. Until now, only selected bulk operations (e.g. COPY) did this. If a given relfilenode received both a WAL-skipping COPY and a WAL-logged operation (e.g. INSERT), recovery could lose tuples from the COPY. See src/backend/access/transam/READM

pgsql: Fix cosmetic blemishes involving rd_createSubid.

2020-03-21 Thread Noah Misch
Fix cosmetic blemishes involving rd_createSubid. Remove an obsolete comment from AtEOXact_cleanup(). Restore formatting of a comment in struct RelationData, mangled by the pgindent run in commit 9af4159fce6654aa0e081b00d02bca40b978745c. Back-patch to 9.5 (all supported versions), because another

pgsql: Fix cosmetic blemishes involving rd_createSubid.

2020-03-21 Thread Noah Misch
Fix cosmetic blemishes involving rd_createSubid. Remove an obsolete comment from AtEOXact_cleanup(). Restore formatting of a comment in struct RelationData, mangled by the pgindent run in commit 9af4159fce6654aa0e081b00d02bca40b978745c. Back-patch to 9.5 (all supported versions), because another

pgsql: During heap rebuild, lock any TOAST index until end of transacti

2020-03-21 Thread Noah Misch
During heap rebuild, lock any TOAST index until end of transaction. swap_relation_files() calls toast_get_valid_index() to find and lock this index, just before swapping with the rebuilt TOAST index. The latter function releases the lock before returning. Potential for mischief is low; a concurr

pgsql: Skip WAL for new relfilenodes, under wal_level=minimal.

2020-03-21 Thread Noah Misch
Skip WAL for new relfilenodes, under wal_level=minimal. Until now, only selected bulk operations (e.g. COPY) did this. If a given relfilenode received both a WAL-skipping COPY and a WAL-logged operation (e.g. INSERT), recovery could lose tuples from the COPY. See src/backend/access/transam/READM

pgsql: During heap rebuild, lock any TOAST index until end of transacti

2020-03-21 Thread Noah Misch
During heap rebuild, lock any TOAST index until end of transaction. swap_relation_files() calls toast_get_valid_index() to find and lock this index, just before swapping with the rebuilt TOAST index. The latter function releases the lock before returning. Potential for mischief is low; a concurr

pgsql: Skip WAL for new relfilenodes, under wal_level=minimal.

2020-03-21 Thread Noah Misch
Skip WAL for new relfilenodes, under wal_level=minimal. Until now, only selected bulk operations (e.g. COPY) did this. If a given relfilenode received both a WAL-skipping COPY and a WAL-logged operation (e.g. INSERT), recovery could lose tuples from the COPY. See src/backend/access/transam/READM

pgsql: Back-patch log_newpage_range().

2020-03-21 Thread Noah Misch
Back-patch log_newpage_range(). Back-patch a subset of commit 9155580fd5fc2a0cbb23376dfca7cd21f59c2c7b to v11, v10, 9.6, and 9.5. Include the latest repairs to this function. Use a new XLOG_FPI_MULTI value instead of reusing XLOG_FPI. That way, if an older server reads WAL from this function, th

pgsql: Back-patch log_newpage_range().

2020-03-21 Thread Noah Misch
Back-patch log_newpage_range(). Back-patch a subset of commit 9155580fd5fc2a0cbb23376dfca7cd21f59c2c7b to v11, v10, 9.6, and 9.5. Include the latest repairs to this function. Use a new XLOG_FPI_MULTI value instead of reusing XLOG_FPI. That way, if an older server reads WAL from this function, th

pgsql: Fix cosmetic blemishes involving rd_createSubid.

2020-03-21 Thread Noah Misch
Fix cosmetic blemishes involving rd_createSubid. Remove an obsolete comment from AtEOXact_cleanup(). Restore formatting of a comment in struct RelationData, mangled by the pgindent run in commit 9af4159fce6654aa0e081b00d02bca40b978745c. Back-patch to 9.5 (all supported versions), because another

pgsql: Skip WAL for new relfilenodes, under wal_level=minimal.

2020-03-21 Thread Noah Misch
Skip WAL for new relfilenodes, under wal_level=minimal. Until now, only selected bulk operations (e.g. COPY) did this. If a given relfilenode received both a WAL-skipping COPY and a WAL-logged operation (e.g. INSERT), recovery could lose tuples from the COPY. See src/backend/access/transam/READM

pgsql: Back-patch log_newpage_range().

2020-03-21 Thread Noah Misch
Back-patch log_newpage_range(). Back-patch a subset of commit 9155580fd5fc2a0cbb23376dfca7cd21f59c2c7b to v11, v10, 9.6, and 9.5. Include the latest repairs to this function. Use a new XLOG_FPI_MULTI value instead of reusing XLOG_FPI. That way, if an older server reads WAL from this function, th

pgsql: Fix cosmetic blemishes involving rd_createSubid.

2020-03-21 Thread Noah Misch
Fix cosmetic blemishes involving rd_createSubid. Remove an obsolete comment from AtEOXact_cleanup(). Restore formatting of a comment in struct RelationData, mangled by the pgindent run in commit 9af4159fce6654aa0e081b00d02bca40b978745c. Back-patch to 9.5 (all supported versions), because another

pgsql: Skip WAL for new relfilenodes, under wal_level=minimal.

2020-03-21 Thread Noah Misch
Skip WAL for new relfilenodes, under wal_level=minimal. Until now, only selected bulk operations (e.g. COPY) did this. If a given relfilenode received both a WAL-skipping COPY and a WAL-logged operation (e.g. INSERT), recovery could lose tuples from the COPY. See src/backend/access/transam/READM

pgsql: During heap rebuild, lock any TOAST index until end of transacti

2020-03-21 Thread Noah Misch
During heap rebuild, lock any TOAST index until end of transaction. swap_relation_files() calls toast_get_valid_index() to find and lock this index, just before swapping with the rebuilt TOAST index. The latter function releases the lock before returning. Potential for mischief is low; a concurr

pgsql: Skip WAL for new relfilenodes, under wal_level=minimal.

2020-03-21 Thread Noah Misch
Skip WAL for new relfilenodes, under wal_level=minimal. Until now, only selected bulk operations (e.g. COPY) did this. If a given relfilenode received both a WAL-skipping COPY and a WAL-logged operation (e.g. INSERT), recovery could lose tuples from the COPY. See src/backend/access/transam/READM

pgsql: Fix cosmetic blemishes involving rd_createSubid.

2020-03-21 Thread Noah Misch
Fix cosmetic blemishes involving rd_createSubid. Remove an obsolete comment from AtEOXact_cleanup(). Restore formatting of a comment in struct RelationData, mangled by the pgindent run in commit 9af4159fce6654aa0e081b00d02bca40b978745c. Back-patch to 9.5 (all supported versions), because another

pgsql: In log_newpage_range(), heed forkNum and page_std arguments.

2020-03-21 Thread Noah Misch
In log_newpage_range(), heed forkNum and page_std arguments. The function assumed forkNum=MAIN_FORKNUM and page_std=true, ignoring the actual arguments. Existing callers passed exactly those values, so there's no live bug. Back-patch to v12, where the function first appeared, because another fix

pgsql: During heap rebuild, lock any TOAST index until end of transacti

2020-03-21 Thread Noah Misch
During heap rebuild, lock any TOAST index until end of transaction. swap_relation_files() calls toast_get_valid_index() to find and lock this index, just before swapping with the rebuilt TOAST index. The latter function releases the lock before returning. Potential for mischief is low; a concurr