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

Function begin_replication_step

src/backend/replication/logical/worker.c:289–303  ·  view source on GitHub ↗

* Begin one step (one INSERT, UPDATE, etc) of a replication transaction. * * Start a transaction, if this is the first step (else we keep using the * existing transaction). * Also provide a global snapshot and ensure we run in ApplyMessageContext. */

Source from the content-addressed store, hash-verified

287 * Also provide a global snapshot and ensure we run in ApplyMessageContext.
288 */
289static void
290begin_replication_step(void)
291{
292 SetCurrentStatementStartTimestamp();
293
294 if (!IsTransactionState())
295 {
296 StartTransactionCommand();
297 maybe_reread_subscription();
298 }
299
300 PushActiveSnapshot(GetTransactionSnapshot());
301
302 MemoryContextSwitchTo(ApplyMessageContext);
303}
304
305/*
306 * Finish up one step of a replication transaction.

Callers 7

apply_handle_insertFunction · 0.85
apply_handle_updateFunction · 0.85
apply_handle_deleteFunction · 0.85
apply_handle_truncateFunction · 0.85

Calls 7

IsTransactionStateFunction · 0.85
StartTransactionCommandFunction · 0.85
PushActiveSnapshotFunction · 0.85
GetTransactionSnapshotFunction · 0.85
MemoryContextSwitchToFunction · 0.85

Tested by

no test coverage detected