mirror of
https://github.com/postgres/postgres.git
synced 2025-06-13 07:41:39 +03:00
Use callbacks in SlruScanDirectory for the actual action
Previously, the code assumed that the only possible action to take was to delete files behind a certain cutoff point. The async notify code was already a crock: it used a different "pagePrecedes" function for truncation than for regular operation. By allowing it to pass a callback to SlruScanDirectory it can do cleanly exactly what it needs to do. The clog.c code also had its own use for SlruScanDirectory, which is made a bit simpler with this.
This commit is contained in:
@ -606,7 +606,7 @@ TruncateCLOG(TransactionId oldestXact)
|
||||
cutoffPage = TransactionIdToPage(oldestXact);
|
||||
|
||||
/* Check to see if there's any files that could be removed */
|
||||
if (!SlruScanDirectory(ClogCtl, cutoffPage, false))
|
||||
if (!SlruScanDirectory(ClogCtl, SlruScanDirCbReportPresence, &cutoffPage))
|
||||
return; /* nothing to remove */
|
||||
|
||||
/* Write XLOG record and flush XLOG to disk */
|
||||
|
Reference in New Issue
Block a user