mirror of
https://github.com/postgres/postgres.git
synced 2025-04-27 22:56:53 +03:00
Remove empty function BufmgrCommit().
This function has been a no-op for over a decade. Even if bufmgr regains a need to be called during commit, it seems unlikely that the most appropriate call points would be precisely here, so it's not doing us much good as a placeholder either. Now, removing it probably doesn't save any noticeable number of cycles --- but the main call is inside the commit critical section, and the less work done there the better. Matthias van de Meent Discussion: https://postgr.es/m/CAEze2Wi1=tLKbxZnXzcD+8fYKyKqBtivVakLQC_mYBsP4Y8qVA@mail.gmail.com
This commit is contained in:
parent
7081ac46ac
commit
58c9600a9f
@ -1373,12 +1373,6 @@ RecordTransactionCommit(void)
|
|||||||
replorigin = (replorigin_session_origin != InvalidRepOriginId &&
|
replorigin = (replorigin_session_origin != InvalidRepOriginId &&
|
||||||
replorigin_session_origin != DoNotReplicateId);
|
replorigin_session_origin != DoNotReplicateId);
|
||||||
|
|
||||||
/*
|
|
||||||
* Begin commit critical section and insert the commit XLOG record.
|
|
||||||
*/
|
|
||||||
/* Tell bufmgr and smgr to prepare for commit */
|
|
||||||
BufmgrCommit();
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mark ourselves as within our "commit critical section". This
|
* Mark ourselves as within our "commit critical section". This
|
||||||
* forces any concurrent checkpoint to wait until we've updated
|
* forces any concurrent checkpoint to wait until we've updated
|
||||||
@ -1400,6 +1394,9 @@ RecordTransactionCommit(void)
|
|||||||
START_CRIT_SECTION();
|
START_CRIT_SECTION();
|
||||||
MyProc->delayChkptFlags |= DELAY_CHKPT_START;
|
MyProc->delayChkptFlags |= DELAY_CHKPT_START;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Insert the commit XLOG record.
|
||||||
|
*/
|
||||||
XactLogCommitRecord(GetCurrentTransactionStopTimestamp(),
|
XactLogCommitRecord(GetCurrentTransactionStopTimestamp(),
|
||||||
nchildren, children, nrels, rels,
|
nchildren, children, nrels, rels,
|
||||||
ndroppedstats, droppedstats,
|
ndroppedstats, droppedstats,
|
||||||
@ -2536,9 +2533,6 @@ PrepareTransaction(void)
|
|||||||
|
|
||||||
prepared_at = GetCurrentTimestamp();
|
prepared_at = GetCurrentTimestamp();
|
||||||
|
|
||||||
/* Tell bufmgr and smgr to prepare for commit */
|
|
||||||
BufmgrCommit();
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Reserve the GID for this transaction. This could fail if the requested
|
* Reserve the GID for this transaction. This could fail if the requested
|
||||||
* GID is invalid or already in use.
|
* GID is invalid or already in use.
|
||||||
|
@ -2789,16 +2789,6 @@ CheckPointBuffers(int flags)
|
|||||||
BufferSync(flags);
|
BufferSync(flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Do whatever is needed to prepare for commit at the bufmgr and smgr levels
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
BufmgrCommit(void)
|
|
||||||
{
|
|
||||||
/* Nothing to do in bufmgr anymore... */
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* BufferGetBlockNumber
|
* BufferGetBlockNumber
|
||||||
* Returns the block number associated with a buffer.
|
* Returns the block number associated with a buffer.
|
||||||
|
@ -182,7 +182,6 @@ extern bool HoldingBufferPinThatDelaysRecovery(void);
|
|||||||
|
|
||||||
extern void AbortBufferIO(void);
|
extern void AbortBufferIO(void);
|
||||||
|
|
||||||
extern void BufmgrCommit(void);
|
|
||||||
extern bool BgBufferSync(struct WritebackContext *wb_context);
|
extern bool BgBufferSync(struct WritebackContext *wb_context);
|
||||||
|
|
||||||
extern void TestForOldSnapshot_impl(Snapshot snapshot, Relation relation);
|
extern void TestForOldSnapshot_impl(Snapshot snapshot, Relation relation);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user