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

Commit58c9600

Browse files
committed
Remove empty function BufmgrCommit().
This function has been a no-op for over a decade. Even if bufmgrregains a need to be called during commit, it seems unlikely thatthe most appropriate call points would be precisely here, so it's notdoing us much good as a placeholder either. Now, removing it probablydoesn't save any noticeable number of cycles --- but the main call isinside the commit critical section, and the less work done there thebetter.Matthias van de MeentDiscussion:https://postgr.es/m/CAEze2Wi1=tLKbxZnXzcD+8fYKyKqBtivVakLQC_mYBsP4Y8qVA@mail.gmail.com
1 parent7081ac4 commit58c9600

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
externvoidAbortBufferIO(void);
184184

185-
externvoidBufmgrCommit(void);
186185
externboolBgBufferSync(structWritebackContext*wb_context);
187186

188187
externvoidTestForOldSnapshot_impl(Snapshotsnapshot,Relationrelation);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp