Did we forget to unpin buf in function "revmap_physical_extend" ? - Mailing list pgsql-hackers

From Jinyu Zhang
Subject Did we forget to unpin buf in function "revmap_physical_extend" ?
Date
Msg-id 60c2fe76.15f2e.14fbc60d61a.Coremail.beijing_pg@163.com
Whole thread Raw
Responses Re: Did we forget to unpin buf in function "revmap_physical_extend" ?
List pgsql-hackers
In function "revmap_physical_extend",  should we add "ReleaseBuffer(buf);" between line 438 and 439 ?
422     else
 423     {
 424         if (needLock)
 425             LockRelationForExtension(irel, ExclusiveLock);
 426 
 427         buf = ReadBuffer(irel, P_NEW);
 428         if (BufferGetBlockNumber(buf) != mapBlk)
 429         {
 430             /*
 431              * Very rare corner case: somebody extended the relation
 432              * concurrently after we read its length.  If this happens, give
 433              * up and have caller start over.  We will have to evacuate that
 434              * page from under whoever is using it.
 435              */
 436             if (needLock)
 437                 UnlockRelationForExtension(irel, ExclusiveLock);
 438             LockBuffer(revmap->rm_metaBuf, BUFFER_LOCK_UNLOCK);
 439             return;
 440         }
 441         LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE);
 442         page = BufferGetPage(buf);
 443 
 444         if (needLock)
 445             UnlockRelationForExtension(irel, ExclusiveLock);
 446     }

Jinyu,
regards



 

pgsql-hackers by date:

Previous
From: Christoph Berg
Date:
Subject: Re: 9.3.9 and pg_multixact corruption
Next
From: Robert Haas
Date:
Subject: Re: Moving SS_finalize_plan processing to the end of planning