Dump XLOG_HINT records with xlogdump
Adds a facility to dump XLOG_HINT records with xlogdump. We have backported
XLOG_HINT xlog records from upstream and this record type never existed at the
time that xlogdump was originally created.
#include "catalog/pg_control.h"
#include "commands/dbcommands.h"
#include "cdb/cdbappendonlyam.h"
+#include "access/xlog_internal.h"
#if PG_VERSION_NUM >=90000
#include "utils/relmapper.h"
@@ -282,6 +283,29 @@ print_rmgr_xlog(XLogRecPtr cur, XLogRecord *record, uint8 info, bool hideTimesta
}
#endif
+#if PG_VERSION_NUM >= 80300
+ case XLOG_HINT:
+ {
+ char spaceName[NAMEDATALEN] = "";
+ char dbName[NAMEDATALEN] = "";
+ char relName[NAMEDATALEN] = "";
+ BkpBlock bkb;
+ char *blk = XLogRecGetData(record);
+
+ memcpy(&bkb, blk, sizeof(BkpBlock));
+
+ getSpaceName(bkb.node.spcNode, spaceName, sizeof(spaceName));
+ getDbName(bkb.node.dbNode, dbName, sizeof(dbName));
+ getRelName(bkb.node.relNode, relName, sizeof(relName));
+
+ snprintf(buf, sizeof(buf), "xlog hint: bkpblock s/d/r:%s/%s/%s blk:%u hole_off/len:%u/%u apply:%d",
+ spaceName, dbName, relName,
+ bkb.block, bkb.hole_offset, bkb.hole_length,
+ (bkb.block_info & BLOCK_APPLY) != 0);
+ break;
+ }
+#endif
+
default:
snprintf(buf, sizeof(buf), "unknown XLOG operation - 0x%02x.", info);
break;
