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

Commit97ff2a5

Browse files
committed
Don't MultiXactIdIsRunning when in recovery
In 9.1 and earlier, it is possible for index_getnext() to try to examinea heap buffer for possible HOT-prune when in recovery; this causes aproblem when a multixact is found in a tuple's Xmax, becauseGetMultiXactIdMembers refuses to run when in recovery, raising an error:ERROR: cannot GetMultiXactIdMembers() during recoveryThis can be solved easily by having MultiXactIdIsRunning always returnfalse when in recovery, which is reasonable because a HOT standby cannotacquire further tuple locks nor update/delete tuples.(Note: it doesn't look like this specific code path has a problem in9.2, because instead of doing HeapTupleSatisfiesUpdate directly,heap_hot_search_buffer uses HeapTupleIsSurelyDead instead. Still, theremay be other paths affected by the same bug, for instance in pgrowlocks,and the multixact code hasn't changed; so apply the same fixthroughout.)Apply this fix to 9.0 through 9.2. In 9.3 the multixact code has beenchanged completely and is no longer subject to this problem.Per report from Marko Tiikkaja,https://www.postgresql.org/message-id/54EB3283.2080305@joh.toAnalysis by Andres Freund
1 parent520fecf commit97ff2a5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,21 @@ MultiXactIdIsRunning(MultiXactId multi)
382382

383383
debug_elog3(DEBUG2,"IsRunning %u?",multi);
384384

385+
/*
386+
* During recovery, all multixacts can be considered not running: in
387+
* effect, tuple locks are not held in standby servers, which is fine
388+
* because the standby cannot acquire further tuple locks nor update/delete
389+
* tuples.
390+
*
391+
* We need to do this first, because GetMultiXactIdMembers complains if
392+
* called on recovery.
393+
*/
394+
if (RecoveryInProgress())
395+
{
396+
debug_elog2(DEBUG2,"IsRunning: in recovery");
397+
return false;
398+
}
399+
385400
nmembers=GetMultiXactIdMembers(multi,&members);
386401

387402
if (nmembers<0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp