Skip to content

Commit 58c9600

Browse files
committed
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
1 parent 7081ac4 commit 58c9600

File tree

3 files changed

+3
-20
lines changed

3 files changed

+3
-20
lines changed

src/backend/access/transam/xact.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,12 +1373,6 @@ RecordTransactionCommit(void)
13731373
replorigin = (replorigin_session_origin != InvalidRepOriginId &&
13741374
replorigin_session_origin != DoNotReplicateId);
13751375

1376-
/*
1377-
* Begin commit critical section and insert the commit XLOG record.
1378-
*/
1379-
/* Tell bufmgr and smgr to prepare for commit */
1380-
BufmgrCommit();
1381-
13821376
/*
13831377
* Mark ourselves as within our "commit critical section". This
13841378
* forces any concurrent checkpoint to wait until we've updated
@@ -1400,6 +1394,9 @@ RecordTransactionCommit(void)
14001394
START_CRIT_SECTION();
14011395
MyProc->delayChkptFlags |= DELAY_CHKPT_START;
14021396

1397+
/*
1398+
* Insert the commit XLOG record.
1399+
*/
14031400
XactLogCommitRecord(GetCurrentTransactionStopTimestamp(),
14041401
nchildren, children, nrels, rels,
14051402
ndroppedstats, droppedstats,
@@ -2536,9 +2533,6 @@ PrepareTransaction(void)
25362533

25372534
prepared_at = GetCurrentTimestamp();
25382535

2539-
/* Tell bufmgr and smgr to prepare for commit */
2540-
BufmgrCommit();
2541-
25422536
/*
25432537
* Reserve the GID for this transaction. This could fail if the requested
25442538
* GID is invalid or already in use.

src/backend/storage/buffer/bufmgr.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2789,16 +2789,6 @@ CheckPointBuffers(int flags)
27892789
BufferSync(flags);
27902790
}
27912791

2792-
2793-
/*
2794-
* Do whatever is needed to prepare for commit at the bufmgr and smgr levels
2795-
*/
2796-
void
2797-
BufmgrCommit(void)
2798-
{
2799-
/* Nothing to do in bufmgr anymore... */
2800-
}
2801-
28022792
/*
28032793
* BufferGetBlockNumber
28042794
* Returns the block number associated with a buffer.

src/include/storage/bufmgr.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ extern bool HoldingBufferPinThatDelaysRecovery(void);
182182

183183
extern void AbortBufferIO(void);
184184

185-
extern void BufmgrCommit(void);
186185
extern bool BgBufferSync(struct WritebackContext *wb_context);
187186

188187
extern void TestForOldSnapshot_impl(Snapshot snapshot, Relation relation);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy