aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xlog.c
diff options
context:
space:
mode:
authorSimon Riggs <simon@2ndQuadrant.com>2011-06-28 22:58:17 +0100
committerSimon Riggs <simon@2ndQuadrant.com>2011-06-28 22:58:17 +0100
commit465883b0a2b4236ba6b31b648a9eabef3b7cdddb (patch)
tree830d1e0365e02b4a9fa897eb1a084b36f342e428 /src/backend/access/transam/xlog.c
parent6f3efa76b042cdc457dba5bf8d8257f3ae83fb10 (diff)
downloadpostgresql-465883b0a2b4236ba6b31b648a9eabef3b7cdddb.tar.gz
postgresql-465883b0a2b4236ba6b31b648a9eabef3b7cdddb.zip
Introduce compact WAL record for the common case of commit (non-DDL).
XLOG_XACT_COMMIT_COMPACT leaves out invalidation messages and relfilenodes, saving considerable space for the vast majority of transaction commits. XLOG_XACT_COMMIT keeps same definition as XLOG_PAGE_MAGIC 0xD067 and earlier. Leonardo Francalanci and Simon Riggs
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r--src/backend/access/transam/xlog.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 4952d223cdf..178a458eb78 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -5593,7 +5593,14 @@ recoveryStopsHere(XLogRecord *record, bool *includeThis)
if (record->xl_rmid != RM_XACT_ID && record->xl_rmid != RM_XLOG_ID)
return false;
record_info = record->xl_info & ~XLR_INFO_MASK;
- if (record->xl_rmid == RM_XACT_ID && record_info == XLOG_XACT_COMMIT)
+ if (record->xl_rmid == RM_XACT_ID && record_info == XLOG_XACT_COMMIT_COMPACT)
+ {
+ xl_xact_commit_compact *recordXactCommitData;
+
+ recordXactCommitData = (xl_xact_commit_compact *) XLogRecGetData(record);
+ recordXtime = recordXactCommitData->xact_time;
+ }
+ else if (record->xl_rmid == RM_XACT_ID && record_info == XLOG_XACT_COMMIT)
{
xl_xact_commit *recordXactCommitData;
@@ -5680,7 +5687,7 @@ recoveryStopsHere(XLogRecord *record, bool *includeThis)
recoveryStopTime = recordXtime;
recoveryStopAfter = *includeThis;
- if (record_info == XLOG_XACT_COMMIT)
+ if (record_info == XLOG_XACT_COMMIT_COMPACT || record_info == XLOG_XACT_COMMIT)
{
if (recoveryStopAfter)
ereport(LOG,