Did we forget to unpin buf in function "revmap_physical_extend" ?

From: "Jinyu Zhang" <beijing_pg(at)163(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Did we forget to unpin buf in function "revmap_physical_extend" ?
Date: 2015-09-11 12:28:27
Message-ID: 60c2fe76.15f2e.14fbc60d61a.Coremail.beijing_pg@163.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2015-09-11 12:36:04 Re: Moving SS_finalize_plan processing to the end of planning
Previous Message Christoph Berg 2015-09-11 12:25:39 Re: 9.3.9 and pg_multixact corruption