mirror of
https://github.com/postgres/postgres.git
synced 2025-11-13 16:22:44 +03:00
Change the signature of rm_desc so that it's passed a XLogRecord.
Just feels more natural, and is more consistent with rm_redo.
This commit is contained in:
@@ -18,9 +18,10 @@
|
||||
|
||||
|
||||
void
|
||||
clog_desc(StringInfo buf, uint8 xl_info, char *rec)
|
||||
clog_desc(StringInfo buf, XLogRecord *record)
|
||||
{
|
||||
uint8 info = xl_info & ~XLR_INFO_MASK;
|
||||
char *rec = XLogRecGetData(record);
|
||||
uint8 info = record->xl_info & ~XLR_INFO_MASK;
|
||||
|
||||
if (info == CLOG_ZEROPAGE)
|
||||
{
|
||||
|
||||
@@ -19,9 +19,10 @@
|
||||
|
||||
|
||||
void
|
||||
dbase_desc(StringInfo buf, uint8 xl_info, char *rec)
|
||||
dbase_desc(StringInfo buf, XLogRecord *record)
|
||||
{
|
||||
uint8 info = xl_info & ~XLR_INFO_MASK;
|
||||
char *rec = XLogRecGetData(record);
|
||||
uint8 info = record->xl_info & ~XLR_INFO_MASK;
|
||||
|
||||
if (info == XLOG_DBASE_CREATE)
|
||||
{
|
||||
|
||||
@@ -77,9 +77,10 @@ desc_recompress_leaf(StringInfo buf, ginxlogRecompressDataLeaf *insertData)
|
||||
}
|
||||
|
||||
void
|
||||
gin_desc(StringInfo buf, uint8 xl_info, char *rec)
|
||||
gin_desc(StringInfo buf, XLogRecord *record)
|
||||
{
|
||||
uint8 info = xl_info & ~XLR_INFO_MASK;
|
||||
char *rec = XLogRecGetData(record);
|
||||
uint8 info = record->xl_info & ~XLR_INFO_MASK;
|
||||
|
||||
switch (info)
|
||||
{
|
||||
@@ -121,7 +122,7 @@ gin_desc(StringInfo buf, uint8 xl_info, char *rec)
|
||||
ginxlogRecompressDataLeaf *insertData =
|
||||
(ginxlogRecompressDataLeaf *) payload;
|
||||
|
||||
if (xl_info & XLR_BKP_BLOCK(0))
|
||||
if (record->xl_info & XLR_BKP_BLOCK(0))
|
||||
appendStringInfo(buf, " (full page image)");
|
||||
else
|
||||
desc_recompress_leaf(buf, insertData);
|
||||
@@ -159,7 +160,7 @@ gin_desc(StringInfo buf, uint8 xl_info, char *rec)
|
||||
|
||||
appendStringInfoString(buf, "Vacuum data leaf page, ");
|
||||
desc_node(buf, xlrec->node, xlrec->blkno);
|
||||
if (xl_info & XLR_BKP_BLOCK(0))
|
||||
if (record->xl_info & XLR_BKP_BLOCK(0))
|
||||
appendStringInfo(buf, " (full page image)");
|
||||
else
|
||||
desc_recompress_leaf(buf, &xlrec->data);
|
||||
|
||||
@@ -42,9 +42,10 @@ out_gistxlogPageSplit(StringInfo buf, gistxlogPageSplit *xlrec)
|
||||
}
|
||||
|
||||
void
|
||||
gist_desc(StringInfo buf, uint8 xl_info, char *rec)
|
||||
gist_desc(StringInfo buf, XLogRecord *record)
|
||||
{
|
||||
uint8 info = xl_info & ~XLR_INFO_MASK;
|
||||
char *rec = XLogRecGetData(record);
|
||||
uint8 info = record->xl_info & ~XLR_INFO_MASK;
|
||||
|
||||
switch (info)
|
||||
{
|
||||
|
||||
@@ -17,6 +17,6 @@
|
||||
#include "access/hash.h"
|
||||
|
||||
void
|
||||
hash_desc(StringInfo buf, uint8 xl_info, char *rec)
|
||||
hash_desc(StringInfo buf, XLogRecord *record)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -41,16 +41,17 @@ out_infobits(StringInfo buf, uint8 infobits)
|
||||
}
|
||||
|
||||
void
|
||||
heap_desc(StringInfo buf, uint8 xl_info, char *rec)
|
||||
heap_desc(StringInfo buf, XLogRecord *record)
|
||||
{
|
||||
uint8 info = xl_info & ~XLR_INFO_MASK;
|
||||
char *rec = XLogRecGetData(record);
|
||||
uint8 info = record->xl_info & ~XLR_INFO_MASK;
|
||||
|
||||
info &= XLOG_HEAP_OPMASK;
|
||||
if (info == XLOG_HEAP_INSERT)
|
||||
{
|
||||
xl_heap_insert *xlrec = (xl_heap_insert *) rec;
|
||||
|
||||
if (xl_info & XLOG_HEAP_INIT_PAGE)
|
||||
if (record->xl_info & XLOG_HEAP_INIT_PAGE)
|
||||
appendStringInfoString(buf, "insert(init): ");
|
||||
else
|
||||
appendStringInfoString(buf, "insert: ");
|
||||
@@ -69,7 +70,7 @@ heap_desc(StringInfo buf, uint8 xl_info, char *rec)
|
||||
{
|
||||
xl_heap_update *xlrec = (xl_heap_update *) rec;
|
||||
|
||||
if (xl_info & XLOG_HEAP_INIT_PAGE)
|
||||
if (record->xl_info & XLOG_HEAP_INIT_PAGE)
|
||||
appendStringInfoString(buf, "update(init): ");
|
||||
else
|
||||
appendStringInfoString(buf, "update: ");
|
||||
@@ -85,7 +86,7 @@ heap_desc(StringInfo buf, uint8 xl_info, char *rec)
|
||||
{
|
||||
xl_heap_update *xlrec = (xl_heap_update *) rec;
|
||||
|
||||
if (xl_info & XLOG_HEAP_INIT_PAGE) /* can this case happen? */
|
||||
if (record->xl_info & XLOG_HEAP_INIT_PAGE) /* can this case happen? */
|
||||
appendStringInfoString(buf, "hot_update(init): ");
|
||||
else
|
||||
appendStringInfoString(buf, "hot_update: ");
|
||||
@@ -126,9 +127,10 @@ heap_desc(StringInfo buf, uint8 xl_info, char *rec)
|
||||
appendStringInfoString(buf, "UNKNOWN");
|
||||
}
|
||||
void
|
||||
heap2_desc(StringInfo buf, uint8 xl_info, char *rec)
|
||||
heap2_desc(StringInfo buf, XLogRecord *record)
|
||||
{
|
||||
uint8 info = xl_info & ~XLR_INFO_MASK;
|
||||
char *rec = XLogRecGetData(record);
|
||||
uint8 info = record->xl_info & ~XLR_INFO_MASK;
|
||||
|
||||
info &= XLOG_HEAP_OPMASK;
|
||||
if (info == XLOG_HEAP2_CLEAN)
|
||||
@@ -172,7 +174,7 @@ heap2_desc(StringInfo buf, uint8 xl_info, char *rec)
|
||||
{
|
||||
xl_heap_multi_insert *xlrec = (xl_heap_multi_insert *) rec;
|
||||
|
||||
if (xl_info & XLOG_HEAP_INIT_PAGE)
|
||||
if (record->xl_info & XLOG_HEAP_INIT_PAGE)
|
||||
appendStringInfoString(buf, "multi-insert (init): ");
|
||||
else
|
||||
appendStringInfoString(buf, "multi-insert: ");
|
||||
|
||||
@@ -47,9 +47,10 @@ out_member(StringInfo buf, MultiXactMember *member)
|
||||
}
|
||||
|
||||
void
|
||||
multixact_desc(StringInfo buf, uint8 xl_info, char *rec)
|
||||
multixact_desc(StringInfo buf, XLogRecord *record)
|
||||
{
|
||||
uint8 info = xl_info & ~XLR_INFO_MASK;
|
||||
char *rec = XLogRecGetData(record);
|
||||
uint8 info = record->xl_info & ~XLR_INFO_MASK;
|
||||
|
||||
if (info == XLOG_MULTIXACT_ZERO_OFF_PAGE)
|
||||
{
|
||||
|
||||
@@ -26,9 +26,10 @@ out_target(StringInfo buf, xl_btreetid *target)
|
||||
}
|
||||
|
||||
void
|
||||
btree_desc(StringInfo buf, uint8 xl_info, char *rec)
|
||||
btree_desc(StringInfo buf, XLogRecord *record)
|
||||
{
|
||||
uint8 info = xl_info & ~XLR_INFO_MASK;
|
||||
char *rec = XLogRecGetData(record);
|
||||
uint8 info = record->xl_info & ~XLR_INFO_MASK;
|
||||
|
||||
switch (info)
|
||||
{
|
||||
|
||||
@@ -17,9 +17,10 @@
|
||||
#include "utils/relmapper.h"
|
||||
|
||||
void
|
||||
relmap_desc(StringInfo buf, uint8 xl_info, char *rec)
|
||||
relmap_desc(StringInfo buf, XLogRecord *record)
|
||||
{
|
||||
uint8 info = xl_info & ~XLR_INFO_MASK;
|
||||
char *rec = XLogRecGetData(record);
|
||||
uint8 info = record->xl_info & ~XLR_INFO_MASK;
|
||||
|
||||
if (info == XLOG_RELMAP_UPDATE)
|
||||
{
|
||||
|
||||
@@ -18,9 +18,10 @@
|
||||
|
||||
|
||||
void
|
||||
seq_desc(StringInfo buf, uint8 xl_info, char *rec)
|
||||
seq_desc(StringInfo buf, XLogRecord *record)
|
||||
{
|
||||
uint8 info = xl_info & ~XLR_INFO_MASK;
|
||||
char *rec = XLogRecGetData(record);
|
||||
uint8 info = record->xl_info & ~XLR_INFO_MASK;
|
||||
xl_seq_rec *xlrec = (xl_seq_rec *) rec;
|
||||
|
||||
if (info == XLOG_SEQ_LOG)
|
||||
|
||||
@@ -19,9 +19,10 @@
|
||||
|
||||
|
||||
void
|
||||
smgr_desc(StringInfo buf, uint8 xl_info, char *rec)
|
||||
smgr_desc(StringInfo buf, XLogRecord *record)
|
||||
{
|
||||
uint8 info = xl_info & ~XLR_INFO_MASK;
|
||||
char *rec = XLogRecGetData(record);
|
||||
uint8 info = record->xl_info & ~XLR_INFO_MASK;
|
||||
|
||||
if (info == XLOG_SMGR_CREATE)
|
||||
{
|
||||
|
||||
@@ -24,9 +24,10 @@ out_target(StringInfo buf, RelFileNode node)
|
||||
}
|
||||
|
||||
void
|
||||
spg_desc(StringInfo buf, uint8 xl_info, char *rec)
|
||||
spg_desc(StringInfo buf, XLogRecord *record)
|
||||
{
|
||||
uint8 info = xl_info & ~XLR_INFO_MASK;
|
||||
char *rec = XLogRecGetData(record);
|
||||
uint8 info = record->xl_info & ~XLR_INFO_MASK;
|
||||
|
||||
switch (info)
|
||||
{
|
||||
|
||||
@@ -37,9 +37,10 @@ standby_desc_running_xacts(StringInfo buf, xl_running_xacts *xlrec)
|
||||
}
|
||||
|
||||
void
|
||||
standby_desc(StringInfo buf, uint8 xl_info, char *rec)
|
||||
standby_desc(StringInfo buf, XLogRecord *record)
|
||||
{
|
||||
uint8 info = xl_info & ~XLR_INFO_MASK;
|
||||
char *rec = XLogRecGetData(record);
|
||||
uint8 info = record->xl_info & ~XLR_INFO_MASK;
|
||||
|
||||
if (info == XLOG_STANDBY_LOCK)
|
||||
{
|
||||
|
||||
@@ -18,9 +18,10 @@
|
||||
|
||||
|
||||
void
|
||||
tblspc_desc(StringInfo buf, uint8 xl_info, char *rec)
|
||||
tblspc_desc(StringInfo buf, XLogRecord *record)
|
||||
{
|
||||
uint8 info = xl_info & ~XLR_INFO_MASK;
|
||||
char *rec = XLogRecGetData(record);
|
||||
uint8 info = record->xl_info & ~XLR_INFO_MASK;
|
||||
|
||||
if (info == XLOG_TBLSPC_CREATE)
|
||||
{
|
||||
|
||||
@@ -137,9 +137,10 @@ xact_desc_assignment(StringInfo buf, xl_xact_assignment *xlrec)
|
||||
}
|
||||
|
||||
void
|
||||
xact_desc(StringInfo buf, uint8 xl_info, char *rec)
|
||||
xact_desc(StringInfo buf, XLogRecord *record)
|
||||
{
|
||||
uint8 info = xl_info & ~XLR_INFO_MASK;
|
||||
char *rec = XLogRecGetData(record);
|
||||
uint8 info = record->xl_info & ~XLR_INFO_MASK;
|
||||
|
||||
if (info == XLOG_XACT_COMMIT_COMPACT)
|
||||
{
|
||||
|
||||
@@ -32,9 +32,10 @@ const struct config_enum_entry wal_level_options[] = {
|
||||
};
|
||||
|
||||
void
|
||||
xlog_desc(StringInfo buf, uint8 xl_info, char *rec)
|
||||
xlog_desc(StringInfo buf, XLogRecord *record)
|
||||
{
|
||||
uint8 info = xl_info & ~XLR_INFO_MASK;
|
||||
char *rec = XLogRecGetData(record);
|
||||
uint8 info = record->xl_info & ~XLR_INFO_MASK;
|
||||
|
||||
if (info == XLOG_CHECKPOINT_SHUTDOWN ||
|
||||
info == XLOG_CHECKPOINT_ONLINE)
|
||||
|
||||
@@ -1276,11 +1276,12 @@ begin:;
|
||||
rdt_lastnormal->next = NULL;
|
||||
|
||||
initStringInfo(&recordbuf);
|
||||
appendBinaryStringInfo(&recordbuf, (char *) &rechdr, sizeof(XLogRecord));
|
||||
for (; rdata != NULL; rdata = rdata->next)
|
||||
appendBinaryStringInfo(&recordbuf, rdata->data, rdata->len);
|
||||
|
||||
appendStringInfoString(&buf, " - ");
|
||||
RmgrTable[rechdr->xl_rmid].rm_desc(&buf, rechdr->xl_info, recordbuf.data);
|
||||
RmgrTable[rechdr->xl_rmid].rm_desc(&buf, (XLogRecord *) recordbuf.data);
|
||||
pfree(recordbuf.data);
|
||||
}
|
||||
elog(LOG, "%s", buf.data);
|
||||
@@ -6627,9 +6628,7 @@ StartupXLOG(void)
|
||||
(uint32) (EndRecPtr >> 32), (uint32) EndRecPtr);
|
||||
xlog_outrec(&buf, record);
|
||||
appendStringInfoString(&buf, " - ");
|
||||
RmgrTable[record->xl_rmid].rm_desc(&buf,
|
||||
record->xl_info,
|
||||
XLogRecGetData(record));
|
||||
RmgrTable[record->xl_rmid].rm_desc(&buf, record);
|
||||
elog(LOG, "%s", buf.data);
|
||||
pfree(buf.data);
|
||||
}
|
||||
@@ -10453,9 +10452,7 @@ rm_redo_error_callback(void *arg)
|
||||
StringInfoData buf;
|
||||
|
||||
initStringInfo(&buf);
|
||||
RmgrTable[record->xl_rmid].rm_desc(&buf,
|
||||
record->xl_info,
|
||||
XLogRecGetData(record));
|
||||
RmgrTable[record->xl_rmid].rm_desc(&buf, record);
|
||||
|
||||
/* don't bother emitting empty description */
|
||||
if (buf.len > 0)
|
||||
|
||||
Reference in New Issue
Block a user