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

Commit2360eea

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 parent46c877e commit2360eea

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
@@ -383,6 +383,21 @@ MultiXactIdIsRunning(MultiXactId multi)
383383

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

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

388403
if (nmembers<0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp