hexdump查看分析wal文件xlog 页头

本文记录了UXDB系统中WAL日志的一次异常情况,详细展示了从日志的LSN地址出发,逐步排查并定位问题的过程。通过解析不同类型的WAL记录及其描述,揭示了导致错误的具体原因。

[uxdb@localhost bin]$ hexdump -C -s 0x6E46F8 -n 58 rec1/instances/1/ux_wal/000000010000000000000001

006e46f8 3a 00 00 00 00 00 00 00 b8 46 6e 01 00 00 00 00 |:…Fn…|
006e4708 01 00 00 00 00 00 00 00 10 08 00 00 c7 94 10 6f |…o|
006e4718 ff 18 00 00 00 00 00 00 00 00 00 e5 91 00 32 02 |…2.|
006e4728 00 00 32 02 00 00 3f 02 00 00 |…2…?..|
006e4732
[uxdb@localhost bin]$
加粗字体位上一条wal日志的LSN地址 0x016E46B8

rmgr: Transaction len (rec/tot): 50/ 50, tx: 571, sno: 2, lsn: 0/016E45F8, prev 0/016E45B8, desc: COMMIT 2021-03-17 10:50:13.770405 CST
rmgr: Heap len (rec/tot): 78/ 78, tx: 572, sno: 2, lsn: 0/016E4630, prev 0/016E45F8, desc: HOT_UPDATE off 9 xmax 572 ; new off 11 xmax 0, blkref #0: rel 1663/13231/16384 blk 0
rmgr: Transaction len (rec/tot): 50/ 50, tx: 572, sno: 2, lsn: 0/016E4680, prev 0/016E4630, desc: COMMIT 2021-03-17 10:50:13.774401 CST
rmgr: Standby len (rec/tot): 58/ 58, tx: 0, sno: 2, lsn: 0/016E46B8, prev 0/016E4680, desc: RUNNING_XACTS nextXid 573 latestCompletedXid 572 oldestRunningXid 573
ux_waldump: FATAL: error in WAL record at 0/16E46B8: invalid record length at 0/16E46F8: wanted 32, got 0

定位分析查看 页头内容:
rmgr: Btree len (rec/tot): 61/ 5541, tx: 562, sno: 2, lsn: 0/016E28D0, prev 0/016E1018, desc: INSERT_LEAF off 120, blkref #0: rel 1663/13231/2674 blk 27 FPW
rmgr: Standby len (rec/tot): 50/ 50, tx: 562, sno: 2, lsn: 0/016E3E78, prev 0/016E28D0, desc: LOCK xid 562 db 13231 rel 16384
ux_waldump: FATAL: error in WAL record at 0/16E3E78: unexpected pageaddr 0/16C8000 in log segment 000000000000000000000001, offset 7225344

7225344 十六进制 0x6E4000

[uxdb@localhost bin]$ hexdump -s 0x6E4000 -n 16 -C rec1/instances/1/ux_wal/000000010000000000000001
006e4000 97 d0 05 00 01 00 00 00 00 80 6c 01 00 00 00 00 |…l…|
006e4010

typedef struct XLogPageHeaderData
{
uint16 xlp_magic; /* magic value for correctness checks /
uint16 xlp_info; /
flag bits, see below /
TimeLineID xlp_tli; /
TimeLineID of first record on page /
XLogRecPtr xlp_pageaddr; /
XLOG address of this page */

/*
 * When there is not enough space on current page for whole record, we
 * continue on the next page.  xlp_rem_len is the number of bytes
 * remaining from a previous page.
 *
 * Note that xl_rem_len includes backup-block data; that is, it tracks
 * xl_tot_len not xl_len in the initial header.  Also note that the
 * continuation data isn't necessarily aligned.
 */
uint32		xlp_rem_len;	/* total len of remaining data for record */

} XLogPageHeaderData;

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值