mirror of
https://github.com/postgres/postgres.git
synced 2025-05-05 09:19:17 +03:00
Fix comments in heapam.c.
After commits 85f6b49c2c and 3ba59ccc89, we can allow parallel inserts which was earlier not possible as parallel group members won't conflict for relation extension and page lock. In those commits, we forgot to update comments at few places. Author: Amit Kapila Reviewed-by: Robert Haas and Dilip Kumar Backpatch-through: 13 Discussion: https://postgr.es/m/CAFiTN-tMrQh5FFMPx5aWJ+1gi1H6JxktEhq5mDwCHgnEO5oBkA@mail.gmail.com
This commit is contained in:
parent
0abd9cd2f3
commit
f083afac9d
@ -2013,12 +2013,10 @@ heap_prepare_insert(Relation relation, HeapTuple tup, TransactionId xid,
|
|||||||
CommandId cid, int options)
|
CommandId cid, int options)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Parallel operations are required to be strictly read-only in a parallel
|
* To allow parallel inserts, we need to ensure that they are safe to be
|
||||||
* worker. Parallel inserts are not safe even in the leader in the
|
* performed in workers. We have the infrastructure to allow parallel
|
||||||
* general case, because group locking means that heavyweight locks for
|
* inserts in general except for the cases where inserts generate a new
|
||||||
* relation extension or GIN page locks will not conflict between members
|
* CommandId (eg. inserts into a table having a foreign key column).
|
||||||
* of a lock group, but we don't prohibit that case here because there are
|
|
||||||
* useful special cases that we can safely allow, such as CREATE TABLE AS.
|
|
||||||
*/
|
*/
|
||||||
if (IsParallelWorker())
|
if (IsParallelWorker())
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
@ -5694,10 +5692,10 @@ heap_inplace_update(Relation relation, HeapTuple tuple)
|
|||||||
uint32 newlen;
|
uint32 newlen;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For now, parallel operations are required to be strictly read-only.
|
* For now, we don't allow parallel updates. Unlike a regular update,
|
||||||
* Unlike a regular update, this should never create a combo CID, so it
|
* this should never create a combo CID, so it might be possible to relax
|
||||||
* might be possible to relax this restriction, but not without more
|
* this restriction, but not without more thought and testing. It's not
|
||||||
* thought and testing. It's not clear that it would be useful, anyway.
|
* clear that it would be useful, anyway.
|
||||||
*/
|
*/
|
||||||
if (IsInParallelMode())
|
if (IsInParallelMode())
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user