* 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. */
| 287 | * Also provide a global snapshot and ensure we run in ApplyMessageContext. |
| 288 | */ |
| 289 | static void |
| 290 | begin_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. |
no test coverage detected