Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcce1ecf

Browse files
committed
Adjust assertion in GetCurrentCommandId.
currentCommandIdUsed is only used to skip redundant increments of thecommand counter, and CommandCounterIncrement() is categorically deniedunder parallelism anyway. Therefore, it's OK forGetCurrentCommandId() to mark the counter value used, as long as ithappens in the leader, not a worker.Prior to commite9baa5e, the slightlyincorrect check didn't matter, but now it does. A test case added bycommit1804284 uncovered the problemby accident; it caused failures with force_parallel_mode=on/regress.Report and review by Andres Freund. Patch by me.Discussion:http://postgr.es/m/20171221143106.5lhtygohvmazli3x@alap3.anarazel.de
1 parent6719b23 commitcce1ecf

File tree

1 file changed

+3
-3
lines changed
  • src/backend/access/transam

1 file changed

+3
-3
lines changed

‎src/backend/access/transam/xact.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -683,12 +683,12 @@ GetCurrentCommandId(bool used)
683683
if (used)
684684
{
685685
/*
686-
* Forbid setting currentCommandIdUsed in parallelmode, because we
687-
* have no provision for communicating this back to the master. We
686+
* Forbid setting currentCommandIdUsed inaparallelworker, because
687+
*wehave no provision for communicating this back to the master. We
688688
* could relax this restriction when currentCommandIdUsed was already
689689
* true at the start of the parallel operation.
690690
*/
691-
Assert(CurrentTransactionState->parallelModeLevel==0);
691+
Assert(!IsParallelWorker());
692692
currentCommandIdUsed= true;
693693
}
694694
returncurrentCommandId;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp