aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xlog.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2014-03-18 22:06:59 +0200
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2014-03-18 22:10:35 +0200
commit59a5ab3f426e74e3f901dc2cf533726bcea08ed2 (patch)
tree4835577649e139a2a2b12b486919261e92996729 /src/backend/access/transam/xlog.c
parent1d3b258cbe4aedfb49c92c28b9cbd7c18d277e04 (diff)
downloadpostgresql-59a5ab3f426e74e3f901dc2cf533726bcea08ed2.tar.gz
postgresql-59a5ab3f426e74e3f901dc2cf533726bcea08ed2.zip
Remove rm_safe_restartpoint machinery.
It is no longer used, none of the resource managers have multi-record actions that would make it unsafe to perform a restartpoint. Also don't allow rm_cleanup to write WAL records, it's also no longer required. Move the call to rm_cleanup routines to make it more symmetric with rm_startup.
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r--src/backend/access/transam/xlog.c50
1 files changed, 7 insertions, 43 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 5f3c3b9be1e..a2577314bcf 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -7143,6 +7143,13 @@ StartupXLOG(void)
recoveryPausesHere();
}
+ /* Allow resource managers to do any required cleanup. */
+ for (rmid = 0; rmid <= RM_MAX_ID; rmid++)
+ {
+ if (RmgrTable[rmid].rm_cleanup != NULL)
+ RmgrTable[rmid].rm_cleanup();
+ }
+
ereport(LOG,
(errmsg("redo done at %X/%X",
(uint32) (ReadRecPtr >> 32), (uint32) ReadRecPtr)));
@@ -7368,27 +7375,6 @@ StartupXLOG(void)
if (InRecovery)
{
- int rmid;
-
- /*
- * Resource managers might need to write WAL records, eg, to record
- * index cleanup actions. So temporarily enable XLogInsertAllowed in
- * this process only.
- */
- LocalSetXLogInsertAllowed();
-
- /*
- * Allow resource managers to do any required cleanup.
- */
- for (rmid = 0; rmid <= RM_MAX_ID; rmid++)
- {
- if (RmgrTable[rmid].rm_cleanup != NULL)
- RmgrTable[rmid].rm_cleanup();
- }
-
- /* Disallow XLogInsert again */
- LocalXLogInsertAllowed = -1;
-
/*
* Perform a checkpoint to update all our recovery activity to disk.
*
@@ -8750,32 +8736,10 @@ CheckPointGuts(XLogRecPtr checkPointRedo, int flags)
static void
RecoveryRestartPoint(const CheckPoint *checkPoint)
{
- int rmid;
-
/* use volatile pointer to prevent code rearrangement */
volatile XLogCtlData *xlogctl = XLogCtl;
/*
- * Is it safe to restartpoint? We must ask each of the resource managers
- * whether they have any partial state information that might prevent a
- * correct restart from this point. If so, we skip this opportunity, but
- * return at the next checkpoint record for another try.
- */
- for (rmid = 0; rmid <= RM_MAX_ID; rmid++)
- {
- if (RmgrTable[rmid].rm_safe_restartpoint != NULL)
- if (!(RmgrTable[rmid].rm_safe_restartpoint()))
- {
- elog(trace_recovery(DEBUG2),
- "RM %d not safe to record restart point at %X/%X",
- rmid,
- (uint32) (checkPoint->redo >> 32),
- (uint32) checkPoint->redo);
- return;
- }
- }
-
- /*
* Also refrain from creating a restartpoint if we have seen any
* references to non-existent pages. Restarting recovery from the
* restartpoint would not see the references, so we would lose the