MCPcopy Create free account
hub / github.com/apache/cloudberry / DecodeSpecConfirm

Function DecodeSpecConfirm

src/backend/replication/logical/decode.c:1171–1197  ·  view source on GitHub ↗

* Parse XLOG_HEAP_CONFIRM from wal into a confirmation change. * * This is pretty trivial, all the state essentially already setup by the * speculative insertion. */

Source from the content-addressed store, hash-verified

1169 * speculative insertion.
1170 */
1171static void
1172DecodeSpecConfirm(LogicalDecodingContext *ctx, XLogRecordBuffer *buf)
1173{
1174 XLogReaderState *r = buf->record;
1175 ReorderBufferChange *change;
1176 RelFileNode target_node;
1177
1178 /* only interested in our database */
1179 XLogRecGetBlockTag(r, 0, &target_node, NULL, NULL);
1180 if (target_node.dbNode != ctx->slot->data.database)
1181 return;
1182
1183 /* output plugin doesn't look for this origin, no need to queue */
1184 if (FilterByOrigin(ctx, XLogRecGetOrigin(r)))
1185 return;
1186
1187 change = ReorderBufferGetChange(ctx->reorder);
1188 change->action = REORDER_BUFFER_CHANGE_INTERNAL_SPEC_CONFIRM;
1189 change->origin_id = XLogRecGetOrigin(r);
1190
1191 memcpy(&change->data.tp.relnode, &target_node, sizeof(RelFileNode));
1192
1193 change->data.tp.clear_toast_afterwards = true;
1194
1195 ReorderBufferQueueChange(ctx->reorder, XLogRecGetXid(r), buf->origptr,
1196 change, false);
1197}
1198
1199
1200/*

Callers 1

heap_decodeFunction · 0.85

Calls 4

XLogRecGetBlockTagFunction · 0.85
FilterByOriginFunction · 0.85
ReorderBufferGetChangeFunction · 0.85
ReorderBufferQueueChangeFunction · 0.85

Tested by

no test coverage detected