heap_insert xl_heap_insert xlrec; xl_heap_header xlhdr; XLogReGISterData((char *)&nbs
heap_insert
xl_heap_insert xlrec;
xl_heap_header xlhdr;
XLogReGISterData((char *) &xlrec, SizeOfHeapinsert);->//xl_heap_insert
|-- XLogRecData *rdata;
| rdata->data = data;
| rdata->len = len;
| mainrdata_last->next = rdata;
| mainrdata_last = rdata;
|-- mainrdata_len += len;
//xl_heap_header+heapup->t_data
XLogRegisterBufData(0, (char *) &xlhdr, SizeOfHeapHeader);->
|-- regbuf = ®istered_buffers[block_id];
| rdata->data = data;
| rdata->len = len;
| regbuf->rdata_tail->next = rdata;
| regbuf->rdata_tail = rdata;
|-- regbuf->rdata_len += len;
XLogRegisterBufData(0,(char *) heaptup->t_data + SizeofHeapTupleHeader,heaptup->t_len - SizeofHeapTupleHeader);
recptr = XLogInsert(RM_HEAP_ID, info);->
|-- rdt = XLogRecordAssemble(rmid, info, RedoRecPtr, doPageWrites,&fpw_lsn);
|-- EndPos = XLogInsertRecord(rdt, fpw_lsn, curinsert_flags);
static XLogRecData hdr_rdt;
XLogRecordAssemble:
char *scratch = hdr_scratch;//hdr_scratch是一个xlog记录的开始位置
rechdr = (XLogRecord *) scratch;
scratch += SizeOfXLogRecord;
hdr_rdt.next = NULL;
rdt_datas_last = &hdr_rdt;//xlog记录链表头
hdr_rdt.data = hdr_scratch;
//hdr_rdt->next=xl_heap_header+heapup->t_data
registered_buffer *regbuf = ®istered_buffers[block_id];
rdt_datas_last->next = regbuf->rdata_head;
dt_datas_last = regbuf->rdata_tail;
//xl_heap_header+heapup->t_data后面紧跟着xl_heap_insert
rdt_datas_last->next = mainrdata_head;
rdt_datas_last = mainrdata_last;
--结束END--
本文标题: PostgreSQL xlog格式之no backup full page
本文链接: https://lsjlt.com/news/36507.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-10-23
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0