Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0a5de09

Browse files
committed
Disable parallel execution in snapshot
1 parent ba67b4a commit 0a5de09

File tree

6 files changed

+424
-5
lines changed

6 files changed

+424
-5
lines changed

src/backend/access/index/indexam.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
#include "storage/bufmgr.h"
7979
#include "storage/lmgr.h"
8080
#include "storage/predicate.h"
81+
#include "storage/snapfs.h"
8182
#include "utils/snapmgr.h"
8283
#include "utils/tqual.h"
8384

@@ -634,7 +635,7 @@ index_fetch_heap(IndexScanDesc scan)
634635
* recovery because it may violate MVCC to do so. See comments in
635636
* RelationGetIndexScan().
636637
*/
637-
if (!scan->xactStartedInRecovery)
638+
if (!scan->xactStartedInRecovery && !SFS_IN_SNAPSHOT())
638639
scan->kill_prior_tuple = all_dead;
639640

640641
return NULL;

src/backend/optimizer/plan/planner.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
#include "parser/parse_agg.h"
5454
#include "rewrite/rewriteManip.h"
5555
#include "storage/dsm_impl.h"
56+
#include "storage/snapfs.h"
5657
#include "utils/rel.h"
5758
#include "utils/selfuncs.h"
5859
#include "utils/lsyscache.h"
@@ -338,6 +339,7 @@ standard_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
338339
parse->commandType == CMD_SELECT &&
339340
!parse->hasModifyingCTE &&
340341
max_parallel_workers_per_gather > 0 &&
342+
!SFS_IN_SNAPSHOT() &&
341343
!IsParallelWorker() &&
342344
!IsolationIsSerializable())
343345
{

0 commit comments

Comments
 (0)