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

Commitdcfecaa

Browse files
committed
Fix parallel query on standby servers.
Without this fix, it inevitably bombs out with "ERROR: failed toinitialize transaction_read_only to 0". Repair.Ashutosh Sharma; comments adjusted by me.
1 parent070140e commitdcfecaa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎src/backend/commands/variable.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,11 +482,13 @@ show_log_timezone(void)
482482
* nothing since XactReadOnly will be reset by the next StartTransaction().
483483
* The IsTransactionState() test protects us against trying to check
484484
* RecoveryInProgress() in contexts where shared memory is not accessible.
485+
* (Similarly, if we're restoring state in a parallel worker, just allow
486+
* the change.)
485487
*/
486488
bool
487489
check_transaction_read_only(bool*newval,void**extra,GucSourcesource)
488490
{
489-
if (*newval== false&&XactReadOnly&&IsTransactionState())
491+
if (*newval== false&&XactReadOnly&&IsTransactionState()&& !InitializingParallelWorker)
490492
{
491493
/* Can't go to r/w mode inside a r/o transaction */
492494
if (IsSubTransaction())

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp