|
PostgreSQL Source Code git master
|
#include "postgres.h"#include <sys/stat.h>#include <unistd.h>#include "access/commit_ts.h"#include "access/table.h"#include "access/tableam.h"#include "access/twophase.h"#include "access/xact.h"#include "catalog/indexing.h"#include "catalog/pg_inherits.h"#include "catalog/pg_subscription.h"#include "catalog/pg_subscription_rel.h"#include "commands/subscriptioncmds.h"#include "commands/tablecmds.h"#include "commands/trigger.h"#include "executor/executor.h"#include "executor/execPartition.h"#include "libpq/pqformat.h"#include "miscadmin.h"#include "optimizer/optimizer.h"#include "parser/parse_relation.h"#include "pgstat.h"#include "postmaster/bgworker.h"#include "postmaster/interrupt.h"#include "postmaster/walwriter.h"#include "replication/conflict.h"#include "replication/logicallauncher.h"#include "replication/logicalproto.h"#include "replication/logicalrelation.h"#include "replication/logicalworker.h"#include "replication/origin.h"#include "replication/slot.h"#include "replication/walreceiver.h"#include "replication/worker_internal.h"#include "rewrite/rewriteHandler.h"#include "storage/buffile.h"#include "storage/ipc.h"#include "storage/lmgr.h"#include "storage/procarray.h"#include "tcop/tcopprot.h"#include "utils/acl.h"#include "utils/guc.h"#include "utils/inval.h"#include "utils/lsyscache.h"#include "utils/memutils.h"#include "utils/pg_lsn.h"#include "utils/rel.h"#include "utils/rls.h"#include "utils/snapmgr.h"#include "utils/syscache.h"#include "utils/usercontext.h"
Go to the source code of this file.
Data Structures | |
| struct | FlushPosition |
| struct | ApplyExecutionData |
| struct | ApplyErrorCallbackArg |
| struct | RetainDeadTuplesData |
| struct | SubXactInfo |
| struct | ApplySubXactData |
Macros | |
| #define | NAPTIME_PER_CYCLE 1000 /* max sleep time between cycles (1s) */ |
| #define | MIN_XID_ADVANCE_INTERVAL 100 |
| #define | MAX_XID_ADVANCE_INTERVAL 180000 |
| #define | is_skipping_changes() (unlikely(XLogRecPtrIsValid(skip_xact_finish_lsn))) |
Typedefs | |
| typedef struct FlushPosition | FlushPosition |
| typedef struct ApplyExecutionData | ApplyExecutionData |
| typedef struct ApplyErrorCallbackArg | ApplyErrorCallbackArg |
| typedef struct RetainDeadTuplesData | RetainDeadTuplesData |
| typedef struct SubXactInfo | SubXactInfo |
| typedef struct ApplySubXactData | ApplySubXactData |
Variables | |
| static dlist_head | lsn_mapping = DLIST_STATIC_INIT(lsn_mapping) |
| static ApplyErrorCallbackArg | apply_error_callback_arg |
| ErrorContextCallback * | apply_error_context_stack = NULL |
| MemoryContext | ApplyMessageContext = NULL |
| MemoryContext | ApplyContext = NULL |
| static MemoryContext | LogicalStreamingContext = NULL |
| WalReceiverConn * | LogRepWorkerWalRcvConn = NULL |
| Subscription * | MySubscription = NULL |
| static bool | MySubscriptionValid = false |
| static List * | on_commit_wakeup_workers_subids = NIL |
| bool | in_remote_transaction = false |
| static XLogRecPtr | remote_final_lsn = InvalidXLogRecPtr |
| static bool | in_streamed_transaction = false |
| static TransactionId | stream_xid = InvalidTransactionId |
| static uint32 | parallel_stream_nchanges = 0 |
| bool | InitializingApplyWorker = false |
| static XLogRecPtr | skip_xact_finish_lsn = InvalidXLogRecPtr |
| static BufFile * | stream_fd = NULL |
| static XLogRecPtr | last_flushpos = InvalidXLogRecPtr |
| static ApplySubXactData | subxact_data = {0, 0, InvalidTransactionId, NULL} |
| #define is_skipping_changes | ( | ) | (unlikely(XLogRecPtrIsValid(skip_xact_finish_lsn))) |
| #define NAPTIME_PER_CYCLE 1000 /* max sleep time between cycles (1s) */ |
| typedef struct ApplyErrorCallbackArg ApplyErrorCallbackArg |
| typedef struct ApplyExecutionData ApplyExecutionData |
| typedef struct ApplySubXactData ApplySubXactData |
| typedef struct FlushPosition FlushPosition |
| typedef struct RetainDeadTuplesData RetainDeadTuplesData |
| typedef struct SubXactInfo SubXactInfo |
| Enumerator | |
|---|---|
| RDT_GET_CANDIDATE_XID | |
| RDT_REQUEST_PUBLISHER_STATUS | |
| RDT_WAIT_FOR_PUBLISHER_STATUS | |
| RDT_WAIT_FOR_LOCAL_FLUSH | |
| RDT_STOP_CONFLICT_INFO_RETENTION | |
| RDT_RESUME_CONFLICT_INFO_RETENTION | |
Definition at line 387 of file worker.c.
| enum TransApplyAction |
| Enumerator | |
|---|---|
| TRANS_LEADER_APPLY | |
| TRANS_LEADER_SERIALIZE | |
| TRANS_LEADER_SEND_TO_PARALLEL | |
| TRANS_LEADER_PARTIAL_SERIALIZE | |
| TRANS_PARALLEL_APPLY | |
Definition at line 369 of file worker.c.
|
static |
Definition at line 4955 of file worker.c.
References MAX_XID_ADVANCE_INTERVAL, Subscription::maxretention, Min, MIN_XID_ADVANCE_INTERVAL, MySubscription, Subscription::retentionactive, wal_receiver_status_interval, and RetainDeadTuplesData::xid_advance_interval.
Referenced by get_candidate_xid().
| void apply_dispatch | ( | StringInfo | s | ) |
Definition at line 3775 of file worker.c.
References generate_unaccent_rules::action, apply_error_callback_arg, apply_handle_begin(), apply_handle_begin_prepare(), apply_handle_commit(), apply_handle_commit_prepared(), apply_handle_delete(), apply_handle_insert(), apply_handle_origin(), apply_handle_prepare(), apply_handle_relation(), apply_handle_rollback_prepared(), apply_handle_stream_abort(), apply_handle_stream_commit(), apply_handle_stream_prepare(), apply_handle_stream_start(), apply_handle_stream_stop(), apply_handle_truncate(), apply_handle_type(), apply_handle_update(), ApplyErrorCallbackArg::command, ereport, errcode(), errmsg(), ERROR, LOGICAL_REP_MSG_BEGIN, LOGICAL_REP_MSG_BEGIN_PREPARE, LOGICAL_REP_MSG_COMMIT, LOGICAL_REP_MSG_COMMIT_PREPARED, LOGICAL_REP_MSG_DELETE, LOGICAL_REP_MSG_INSERT, LOGICAL_REP_MSG_MESSAGE, LOGICAL_REP_MSG_ORIGIN, LOGICAL_REP_MSG_PREPARE, LOGICAL_REP_MSG_RELATION, LOGICAL_REP_MSG_ROLLBACK_PREPARED, LOGICAL_REP_MSG_STREAM_ABORT, LOGICAL_REP_MSG_STREAM_COMMIT, LOGICAL_REP_MSG_STREAM_PREPARE, LOGICAL_REP_MSG_STREAM_START, LOGICAL_REP_MSG_STREAM_STOP, LOGICAL_REP_MSG_TRUNCATE, LOGICAL_REP_MSG_TYPE, LOGICAL_REP_MSG_UPDATE, and pq_getmsgbyte().
Referenced by apply_spooled_messages(), LogicalParallelApplyLoop(), and LogicalRepApplyLoop().
| void apply_error_callback | ( | void * | arg | ) |
Definition at line 6159 of file worker.c.
References apply_error_callback_arg, Assert(), LogicalRepRelation::attnames, ApplyErrorCallbackArg::command, errcontext, ApplyErrorCallbackArg::finish_lsn, logicalrep_message_type(), LSN_FORMAT_ARGS, LogicalRepRelation::nspname, ApplyErrorCallbackArg::origin_name, ApplyErrorCallbackArg::rel, LogicalRepRelation::relname, ApplyErrorCallbackArg::remote_attnum, ApplyErrorCallbackArg::remote_xid, LogicalRepRelMapEntry::remoterel, TransactionIdIsValid, and XLogRecPtrIsValid.
Referenced by LogicalParallelApplyLoop(), and LogicalRepApplyLoop().
|
static |
Definition at line 1211 of file worker.c.
References Assert(), LogicalRepBeginData::final_lsn, in_remote_transaction, logicalrep_read_begin(), maybe_start_skipping_changes(), pgstat_report_activity(), remote_final_lsn, set_apply_error_context_xact(), STATE_RUNNING, stream_xid, TransactionIdIsValid, and LogicalRepBeginData::xid.
Referenced by apply_dispatch().
|
static |
Definition at line 1265 of file worker.c.
References am_tablesync_worker(), Assert(), ereport, errcode(), errmsg_internal(), ERROR, in_remote_transaction, logicalrep_read_begin_prepare(), maybe_start_skipping_changes(), pgstat_report_activity(), LogicalRepPreparedTxnData::prepare_lsn, remote_final_lsn, set_apply_error_context_xact(), STATE_RUNNING, stream_xid, TransactionIdIsValid, and LogicalRepPreparedTxnData::xid.
Referenced by apply_dispatch().
|
static |
Definition at line 1236 of file worker.c.
References apply_handle_commit_internal(), LogicalRepCommitData::commit_lsn, LogicalRepCommitData::end_lsn, ereport, errcode(), errmsg_internal(), ERROR, logicalrep_read_commit(), LSN_FORMAT_ARGS, pgstat_report_activity(), ProcessSyncingRelations(), remote_final_lsn, reset_apply_error_context_info(), and STATE_IDLE.
Referenced by apply_dispatch().
|
static |
Definition at line 2503 of file worker.c.
References AcceptInvalidationMessages(), clear_subscription_skip_lsn(), LogicalRepCommitData::commit_lsn, LogicalRepCommitData::committime, CommitTransactionCommand(), LogicalRepCommitData::end_lsn, EndTransactionBlock(), in_remote_transaction, is_skipping_changes, IsTransactionBlock(), IsTransactionState(), maybe_reread_subscription(), pgstat_report_stat(), replorigin_session_origin_lsn, replorigin_session_origin_timestamp, StartTransactionCommand(), stop_skipping_changes(), store_flush_position(), and XactLastCommitEnd.
Referenced by apply_handle_commit(), and apply_handle_stream_commit().
|
static |
Definition at line 1405 of file worker.c.
References begin_replication_step(), clear_subscription_skip_lsn(), LogicalRepCommitPreparedTxnData::commit_lsn, LogicalRepCommitPreparedTxnData::commit_time, CommitTransactionCommand(), LogicalRepCommitPreparedTxnData::end_lsn, end_replication_step(), FinishPreparedTransaction(), GIDSIZE, in_remote_transaction, logicalrep_read_commit_prepared(), MySubscription, Subscription::oid, pgstat_report_activity(), pgstat_report_stat(), ProcessSyncingRelations(), replorigin_session_origin_lsn, replorigin_session_origin_timestamp, reset_apply_error_context_info(), set_apply_error_context_xact(), STATE_IDLE, store_flush_position(), TwoPhaseTransactionGid(), XactLastCommitEnd, and LogicalRepCommitPreparedTxnData::xid.
Referenced by apply_dispatch().
|
static |
Definition at line 3012 of file worker.c.
References apply_error_callback_arg, apply_handle_delete_internal(), apply_handle_tuple_routing(), begin_replication_step(), check_relation_updatable(), CMD_DELETE, create_edata_for_relation(), end_replication_step(), ApplyExecutionData::estate, ExecCloseIndices(), ExecInitExtraTupleSlot(), ExecOpenIndices(), finish_edata(), GetPerTupleMemoryContext, handle_streamed_transaction(), is_skipping_changes, LogicalRepRelMapEntry::localindexoid, LogicalRepRelMapEntry::localrel, LOGICAL_REP_MSG_DELETE, logicalrep_read_delete(), logicalrep_rel_close(), logicalrep_rel_open(), MemoryContextSwitchTo(), MySubscription, NoLock, RelationData::rd_rel, ApplyErrorCallbackArg::rel, RelationGetDescr, RestoreUserContext(), RowExclusiveLock, Subscription::runasowner, should_apply_changes_for_rel(), slot_store_data(), SwitchToUntrustedUser(), ApplyExecutionData::targetRelInfo, and TTSOpsVirtual.
Referenced by apply_dispatch().
|
static |
Definition at line 3106 of file worker.c.
References ACL_DELETE, Assert(), CT_DELETE_MISSING, CT_DELETE_ORIGIN_DIFFERS, ApplyExecutionData::estate, EvalPlanQualEnd(), EvalPlanQualInit(), EvalPlanQualSetSlot, ExecSimpleRelationDelete(), FindReplTupleInLocalRel(), GetTupleTransactionInfo(), list_make1, LOG, NIL, ConflictTupleInfo::origin, RelationData::rd_rel, RelationGetIndexList(), LogicalRepRelMapEntry::remoterel, replorigin_session_origin, ReportApplyConflict(), ResultRelInfo::ri_IndexRelationDescs, ResultRelInfo::ri_RelationDesc, ConflictTupleInfo::slot, TargetPrivilegesCheck(), ApplyExecutionData::targetRel, ConflictTupleInfo::ts, and ConflictTupleInfo::xmin.
Referenced by apply_handle_delete(), and apply_handle_tuple_routing().
|
static |
Definition at line 2633 of file worker.c.
References apply_error_callback_arg, apply_handle_insert_internal(), apply_handle_tuple_routing(), begin_replication_step(), CMD_INSERT, create_edata_for_relation(), end_replication_step(), ApplyExecutionData::estate, ExecCloseIndices(), ExecInitExtraTupleSlot(), ExecOpenIndices(), finish_edata(), GetPerTupleMemoryContext, handle_streamed_transaction(), is_skipping_changes, LogicalRepRelMapEntry::localrel, LOGICAL_REP_MSG_INSERT, logicalrep_read_insert(), logicalrep_rel_close(), logicalrep_rel_open(), MemoryContextSwitchTo(), MySubscription, NoLock, RelationData::rd_rel, ApplyErrorCallbackArg::rel, RelationGetDescr, RestoreUserContext(), RowExclusiveLock, Subscription::runasowner, should_apply_changes_for_rel(), slot_fill_defaults(), slot_store_data(), SwitchToUntrustedUser(), ApplyExecutionData::targetRelInfo, and TTSOpsVirtual.
Referenced by apply_dispatch().
|
static |
Definition at line 2724 of file worker.c.
References ACL_INSERT, Assert(), ApplyExecutionData::estate, ExecSimpleRelationInsert(), InitConflictIndexes(), NIL, RelationData::rd_rel, RelationGetIndexList(), ResultRelInfo::ri_IndexRelationDescs, ResultRelInfo::ri_onConflictArbiterIndexes, ResultRelInfo::ri_RelationDesc, and TargetPrivilegesCheck().
Referenced by apply_handle_insert(), and apply_handle_tuple_routing().
|
static |
Definition at line 1666 of file worker.c.
References am_tablesync_worker(), ereport, errcode(), errmsg_internal(), ERROR, in_remote_transaction, in_streamed_transaction, and IsTransactionState().
Referenced by apply_dispatch().
|
static |
Definition at line 1331 of file worker.c.
References apply_handle_prepare_internal(), begin_replication_step(), clear_subscription_skip_lsn(), CommitTransactionCommand(), LogicalRepPreparedTxnData::end_lsn, end_replication_step(), ereport, errcode(), errmsg_internal(), ERROR, in_remote_transaction, InvalidXLogRecPtr, logicalrep_read_prepare(), LSN_FORMAT_ARGS, pgstat_report_activity(), pgstat_report_stat(), LogicalRepPreparedTxnData::prepare_lsn, ProcessSyncingRelations(), remote_final_lsn, reset_apply_error_context_info(), STATE_IDLE, stop_skipping_changes(), and store_flush_position().
Referenced by apply_dispatch().
|
static |
Definition at line 1294 of file worker.c.
References BeginTransactionBlock(), CommitTransactionCommand(), LogicalRepPreparedTxnData::end_lsn, GIDSIZE, IsTransactionBlock(), MySubscription, Subscription::oid, LogicalRepPreparedTxnData::prepare_time, PrepareTransactionBlock(), replorigin_session_origin_lsn, replorigin_session_origin_timestamp, TwoPhaseTransactionGid(), and LogicalRepPreparedTxnData::xid.
Referenced by apply_handle_prepare(), and apply_handle_stream_prepare().
|
static |
Definition at line 2563 of file worker.c.
References handle_streamed_transaction(), LOGICAL_REP_MSG_RELATION, logicalrep_partmap_reset_relmap(), logicalrep_read_rel(), and logicalrep_relmap_update().
Referenced by apply_dispatch().
|
static |
Definition at line 1457 of file worker.c.
References begin_replication_step(), clear_subscription_skip_lsn(), CommitTransactionCommand(), end_replication_step(), FinishPreparedTransaction(), GIDSIZE, in_remote_transaction, InvalidXLogRecPtr, logicalrep_read_rollback_prepared(), LookupGXact(), MySubscription, Subscription::oid, pgstat_report_activity(), pgstat_report_stat(), LogicalRepRollbackPreparedTxnData::prepare_end_lsn, LogicalRepRollbackPreparedTxnData::prepare_time, ProcessSyncingRelations(), replorigin_session_origin_lsn, replorigin_session_origin_timestamp, reset_apply_error_context_info(), LogicalRepRollbackPreparedTxnData::rollback_end_lsn, LogicalRepRollbackPreparedTxnData::rollback_time, set_apply_error_context_xact(), STATE_IDLE, store_flush_position(), TwoPhaseTransactionGid(), and LogicalRepRollbackPreparedTxnData::xid.
Referenced by apply_dispatch().
|
static |
Definition at line 2071 of file worker.c.
References LogicalRepStreamAbortData::abort_lsn, AccessExclusiveLock, Assert(), StringInfoData::data, DEBUG1, elog, ereport, errcode(), errmsg_internal(), ERROR, FS_SERIALIZE_DONE, get_transaction_apply_action(), in_streamed_transaction, InvalidXLogRecPtr, StringInfoData::len, LOGICAL_REP_MSG_STREAM_ABORT, logicalrep_read_stream_abort(), MyLogicalRepWorker, pa_decr_and_wait_stream_block(), pa_lock_stream(), pa_send_data(), pa_set_fileset_state(), pa_stream_abort(), pa_switch_to_partial_serialize(), pa_unlock_stream(), pa_xact_finish(), LogicalRepWorker::parallel_apply, ParallelApplyWorkerShared::pending_stream_count, pg_atomic_add_fetch_u32(), reset_apply_error_context_info(), set_apply_error_context_xact(), ParallelApplyWorkerInfo::shared, stream_abort_internal(), stream_close_file(), stream_fd, stream_open_and_write_change(), LogicalRepStreamAbortData::subxid, TRANS_LEADER_APPLY, TRANS_LEADER_PARTIAL_SERIALIZE, TRANS_LEADER_SEND_TO_PARALLEL, TRANS_PARALLEL_APPLY, and LogicalRepStreamAbortData::xid.
Referenced by apply_dispatch().
|
static |
Definition at line 2390 of file worker.c.
References AccessExclusiveLock, apply_handle_commit_internal(), apply_spooled_messages(), Assert(), LogicalRepCommitData::commit_lsn, StringInfoData::data, DEBUG1, elog, LogicalRepCommitData::end_lsn, ereport, errcode(), errmsg_internal(), ERROR, FS_SERIALIZE_DONE, get_transaction_apply_action(), in_streamed_transaction, ParallelApplyWorkerShared::last_commit_end, StringInfoData::len, LOGICAL_REP_MSG_STREAM_COMMIT, logicalrep_read_stream_commit(), MyLogicalRepWorker, MyParallelShared, pa_reset_subtrans(), pa_send_data(), pa_set_fileset_state(), pa_set_xact_state(), pa_switch_to_partial_serialize(), pa_unlock_transaction(), pa_xact_finish(), PARALLEL_TRANS_FINISHED, pgstat_report_activity(), ProcessSyncingRelations(), reset_apply_error_context_info(), set_apply_error_context_xact(), ParallelApplyWorkerInfo::shared, STATE_IDLE, stream_cleanup_files(), stream_close_file(), stream_fd, LogicalRepWorker::stream_fileset, stream_open_and_write_change(), LogicalRepWorker::subid, TRANS_LEADER_APPLY, TRANS_LEADER_PARTIAL_SERIALIZE, TRANS_LEADER_SEND_TO_PARALLEL, TRANS_PARALLEL_APPLY, and XactLastCommitEnd.
Referenced by apply_dispatch().
|
static |
Definition at line 1518 of file worker.c.
References AccessExclusiveLock, am_tablesync_worker(), apply_handle_prepare_internal(), apply_spooled_messages(), Assert(), begin_replication_step(), clear_subscription_skip_lsn(), CommitTransactionCommand(), StringInfoData::data, DEBUG1, elog, LogicalRepPreparedTxnData::end_lsn, end_replication_step(), ereport, errcode(), errmsg_internal(), ERROR, FS_SERIALIZE_DONE, get_transaction_apply_action(), in_remote_transaction, in_streamed_transaction, InvalidXLogRecPtr, ParallelApplyWorkerShared::last_commit_end, StringInfoData::len, LOGICAL_REP_MSG_STREAM_PREPARE, logicalrep_read_stream_prepare(), MyLogicalRepWorker, MyParallelShared, pa_reset_subtrans(), pa_send_data(), pa_set_fileset_state(), pa_set_xact_state(), pa_switch_to_partial_serialize(), pa_unlock_transaction(), pa_xact_finish(), PARALLEL_TRANS_FINISHED, pgstat_report_activity(), pgstat_report_stat(), LogicalRepPreparedTxnData::prepare_lsn, ProcessSyncingRelations(), reset_apply_error_context_info(), set_apply_error_context_xact(), ParallelApplyWorkerInfo::shared, STATE_IDLE, stop_skipping_changes(), store_flush_position(), stream_cleanup_files(), stream_close_file(), stream_fd, LogicalRepWorker::stream_fileset, stream_open_and_write_change(), LogicalRepWorker::subid, TRANS_LEADER_APPLY, TRANS_LEADER_PARTIAL_SERIALIZE, TRANS_LEADER_SEND_TO_PARALLEL, TRANS_PARALLEL_APPLY, LogicalRepPreparedTxnData::xid, and ParallelApplyWorkerShared::xid.
Referenced by apply_dispatch().
|
static |
Definition at line 1725 of file worker.c.
References AccessExclusiveLock, Assert(), StringInfoData::data, elog, ereport, errcode(), errmsg_internal(), ERROR, get_transaction_apply_action(), in_streamed_transaction, InvalidOid, InvalidXLogRecPtr, StringInfoData::len, LOGICAL_REP_MSG_STREAM_START, logicalrep_read_stream_start(), logicalrep_worker_wakeup(), MyLogicalRepWorker, MyParallelShared, pa_allocate_worker(), pa_lock_transaction(), pa_send_data(), pa_set_stream_apply_worker(), pa_set_xact_state(), pa_switch_to_partial_serialize(), pa_unlock_stream(), parallel_stream_nchanges, PARALLEL_TRANS_STARTED, ParallelApplyWorkerShared::pending_stream_count, pg_atomic_add_fetch_u32(), pgstat_report_activity(), set_apply_error_context_xact(), ParallelApplyWorkerInfo::shared, STATE_RUNNING, stream_start_internal(), stream_write_change(), stream_xid, LogicalRepWorker::subid, TRANS_LEADER_PARTIAL_SERIALIZE, TRANS_LEADER_SEND_TO_PARALLEL, TRANS_LEADER_SERIALIZE, TRANS_PARALLEL_APPLY, TransactionIdIsValid, WORKERTYPE_APPLY, and ParallelApplyWorkerShared::xid.
Referenced by apply_dispatch().
|
static |
Definition at line 1885 of file worker.c.
References AccessExclusiveLock, Assert(), StringInfoData::data, DEBUG1, elog, ereport, errcode(), errmsg_internal(), ERROR, get_transaction_apply_action(), in_streamed_transaction, InvalidTransactionId, IsTransactionOrTransactionBlock(), StringInfoData::len, LOGICAL_REP_MSG_STREAM_STOP, pa_decr_and_wait_stream_block(), pa_lock_stream(), pa_send_data(), pa_set_stream_apply_worker(), pa_switch_to_partial_serialize(), parallel_stream_nchanges, pgstat_report_activity(), reset_apply_error_context_info(), ParallelApplyWorkerInfo::shared, STATE_IDLE, STATE_IDLEINTRANSACTION, stream_stop_internal(), stream_write_change(), stream_xid, TRANS_LEADER_PARTIAL_SERIALIZE, TRANS_LEADER_SEND_TO_PARALLEL, TRANS_LEADER_SERIALIZE, TRANS_PARALLEL_APPLY, and ParallelApplyWorkerShared::xid.
Referenced by apply_dispatch().
|
static |
Definition at line 3647 of file worker.c.
References AccessExclusiveLock, ACL_TRUNCATE, begin_replication_step(), DROP_RESTRICT, end_replication_step(), ExecuteTruncateGuts(), find_all_inheritors(), handle_streamed_transaction(), is_skipping_changes, lappend(), lappend_oid(), lfirst, lfirst_oid, list_member_oid(), LogicalRepRelMapEntry::localrel, LogicalRepRelMapEntry::localreloid, LOGICAL_REP_MSG_TRUNCATE, logicalrep_read_truncate(), logicalrep_rel_close(), logicalrep_rel_open(), MySubscription, NIL, NoLock, RelationData::rd_rel, RELATION_IS_OTHER_TEMP, RelationIsLogicallyLogged, Subscription::runasowner, should_apply_changes_for_rel(), table_close(), table_open(), and TargetPrivilegesCheck().
Referenced by apply_dispatch().
|
static |
Definition at line 3351 of file worker.c.
References ACL_DELETE, ACL_UPDATE, apply_handle_delete_internal(), apply_handle_insert_internal(), Assert(), TupleConversionMap::attrMap, check_relation_updatable(), CheckSubscriptionRelkind(), CMD_DELETE, CMD_INSERT, CMD_UPDATE, convert_tuples_by_name(), CT_UPDATE_DELETED, CT_UPDATE_MISSING, CT_UPDATE_ORIGIN_DIFFERS, elog, ERROR, EState::es_tupleTable, ApplyExecutionData::estate, EvalPlanQualEnd(), EvalPlanQualInit(), EvalPlanQualSetSlot, ExecCopySlot(), ExecFindPartition(), ExecGetRootToChildMap(), ExecPartitionCheck(), ExecSetupPartitionTupleRouting(), ExecSimpleRelationDelete(), ExecSimpleRelationUpdate(), execute_attr_map_slot(), FindDeletedTupleInLocalRel(), FindReplTupleInLocalRel(), get_namespace_name(), GetPerTupleMemoryContext, GetTupleTransactionInfo(), InitConflictIndexes(), list_make1, LogicalRepRelMapEntry::localindexoid, LOG, logicalrep_partition_open(), makeNode, MemoryContextSwitchTo(), ApplyExecutionData::mtstate, NIL, ModifyTableState::operation, ConflictTupleInfo::origin, PlanState::plan, ApplyExecutionData::proute, ModifyTableState::ps, RelationData::rd_rel, RelationGetDescr, RelationGetNamespace, RelationGetRelationName, LogicalRepRelation::relkind, LogicalRepRelMapEntry::remoterel, replorigin_session_origin, ReportApplyConflict(), ModifyTableState::resultRelInfo, ResultRelInfo::ri_PartitionTupleSlot, ResultRelInfo::ri_RelationDesc, ConflictTupleInfo::slot, slot_getallattrs(), slot_modify_data(), slot_store_data(), PlanState::state, table_slot_create(), TargetPrivilegesCheck(), ApplyExecutionData::targetRel, ApplyExecutionData::targetRelInfo, ConflictTupleInfo::ts, type, and ConflictTupleInfo::xmin.
Referenced by apply_handle_delete(), apply_handle_insert(), and apply_handle_update().
|
static |
Definition at line 2586 of file worker.c.
References handle_streamed_transaction(), LOGICAL_REP_MSG_TYPE, and logicalrep_read_typ().
Referenced by apply_dispatch().
|
static |
Definition at line 2790 of file worker.c.
References apply_error_callback_arg, apply_handle_tuple_routing(), apply_handle_update_internal(), Assert(), CompactAttribute::attisdropped, AttrMap::attnums, LogicalRepRelMapEntry::attrmap, begin_replication_step(), bms_add_member(), check_relation_updatable(), CMD_UPDATE, LogicalRepTupleData::colstatus, create_edata_for_relation(), end_replication_step(), EState::es_rteperminfos, ApplyExecutionData::estate, ExecInitExtraTupleSlot(), finish_edata(), FirstLowInvalidHeapAttributeNumber, GetPerTupleMemoryContext, handle_streamed_transaction(), i, is_skipping_changes, list_nth(), LogicalRepRelMapEntry::localindexoid, LogicalRepRelMapEntry::localrel, LOGICAL_REP_MSG_UPDATE, LOGICALREP_COLUMN_UNCHANGED, logicalrep_read_update(), logicalrep_rel_close(), logicalrep_rel_open(), MemoryContextSwitchTo(), MySubscription, TupleDescData::natts, LogicalRepTupleData::ncols, NoLock, RelationData::rd_rel, ApplyErrorCallbackArg::rel, RelationGetDescr, RestoreUserContext(), RowExclusiveLock, Subscription::runasowner, should_apply_changes_for_rel(), slot_store_data(), SwitchToUntrustedUser(), ApplyExecutionData::targetRelInfo, TupleTableSlot::tts_tupleDescriptor, TTSOpsVirtual, TupleDescCompactAttr(), and RTEPermissionInfo::updatedCols.
Referenced by apply_dispatch().
|
static |
Definition at line 2907 of file worker.c.
References ACL_UPDATE, CT_UPDATE_DELETED, CT_UPDATE_MISSING, CT_UPDATE_ORIGIN_DIFFERS, EState::es_tupleTable, ApplyExecutionData::estate, EvalPlanQualEnd(), EvalPlanQualInit(), EvalPlanQualSetSlot, ExecCloseIndices(), ExecOpenIndices(), ExecSimpleRelationUpdate(), FindDeletedTupleInLocalRel(), FindReplTupleInLocalRel(), GetPerTupleMemoryContext, GetTupleTransactionInfo(), InitConflictIndexes(), list_make1, LOG, MemoryContextSwitchTo(), NIL, ConflictTupleInfo::origin, LogicalRepRelMapEntry::remoterel, replorigin_session_origin, ReportApplyConflict(), ResultRelInfo::ri_RelationDesc, ConflictTupleInfo::slot, slot_modify_data(), slot_store_data(), table_slot_create(), TargetPrivilegesCheck(), ApplyExecutionData::targetRel, ConflictTupleInfo::ts, type, and ConflictTupleInfo::xmin.
Referenced by apply_handle_update().
| void apply_spooled_messages | ( | FileSet * | stream_fileset, |
| TransactionId | xid, | ||
| XLogRecPtr | lsn | ||
| ) |
Definition at line 2260 of file worker.c.
References am_parallel_apply_worker(), apply_dispatch(), ApplyMessageContext, begin_replication_step(), BufFileOpenFileSet(), BufFileReadExact(), BufFileReadMaybeEOF(), BufFileTell(), changes_filename(), CHECK_FOR_INTERRUPTS, CurrentResourceOwner, DEBUG1, elog, end_replication_step(), ensure_last_message(), ERROR, in_remote_transaction, initReadOnlyStringInfo(), len, MAXPGPATH, maybe_start_skipping_changes(), MemoryContextReset(), MemoryContextSwitchTo(), MyLogicalRepWorker, palloc(), pgstat_report_activity(), remote_final_lsn, repalloc(), s2, STATE_RUNNING, stream_close_file(), stream_fd, LogicalRepWorker::subid, TopTransactionContext, and TopTransactionResourceOwner.
Referenced by apply_handle_stream_commit(), apply_handle_stream_prepare(), and pa_process_spooled_messages_if_required().
|
static |
Definition at line 5004 of file worker.c.
References am_leader_apply_worker(), am_parallel_apply_worker(), ApplyLauncherForgetWorkerStartTime(), MyLogicalRepWorker, proc_exit(), and LogicalRepWorker::subid.
Referenced by InitializeLogRepWorker(), maybe_reread_subscription(), and resume_conflict_info_retention().
| void ApplyWorkerMain | ( | Datum | main_arg | ) |
Definition at line 5923 of file worker.c.
References DatumGetInt32(), InitializingApplyWorker, proc_exit(), run_apply_worker(), and SetupApplyOrSyncWorker().
| void AtEOXact_LogicalRepWorkers | ( | bool | isCommit | ) |
Definition at line 6269 of file worker.c.
References lfirst, lfirst_oid, logicalrep_worker_wakeup_ptr(), logicalrep_workers_find(), LW_SHARED, LWLockAcquire(), LWLockRelease(), NIL, and on_commit_wakeup_workers_subids.
Referenced by AbortTransaction(), CommitTransaction(), and PrepareTransaction().
|
static |
Definition at line 726 of file worker.c.
References ApplyMessageContext, GetTransactionSnapshot(), IsTransactionState(), maybe_reread_subscription(), MemoryContextSwitchTo(), PushActiveSnapshot(), SetCurrentStatementStartTimestamp(), and StartTransactionCommand().
Referenced by apply_handle_commit_prepared(), apply_handle_delete(), apply_handle_insert(), apply_handle_prepare(), apply_handle_rollback_prepared(), apply_handle_stream_prepare(), apply_handle_truncate(), apply_handle_update(), apply_spooled_messages(), ensure_last_message(), stream_abort_internal(), and stream_start_internal().
|
static |
Definition at line 4401 of file worker.c.
References am_leader_apply_worker(), MySubscription, and Subscription::retaindeadtuples.
Referenced by maybe_advance_nonremovable_xid().
|
inlinestatic |
Definition at line 5367 of file worker.c.
References MAXPGPATH, and snprintf.
Referenced by apply_spooled_messages(), ensure_last_message(), stream_abort_internal(), stream_cleanup_files(), and stream_open_file().
|
static |
Definition at line 2749 of file worker.c.
References ereport, errcode(), errmsg(), ERROR, GetRelationIdentityOrPK(), LogicalRepRelMapEntry::localrel, LogicalRepRelation::nspname, OidIsValid, RelationData::rd_rel, LogicalRepRelation::relname, LogicalRepRelMapEntry::remoterel, and LogicalRepRelMapEntry::updatable.
Referenced by apply_handle_delete(), apply_handle_tuple_routing(), and apply_handle_update().
|
inlinestatic |
Definition at line 5564 of file worker.c.
References InvalidTransactionId, ApplySubXactData::nsubxacts, ApplySubXactData::nsubxacts_max, pfree(), subxact_data, ApplySubXactData::subxact_last, and ApplySubXactData::subxacts.
Referenced by stream_abort_internal(), and subxact_info_write().
|
static |
Definition at line 6070 of file worker.c.
References AccessShareLock, am_parallel_apply_worker(), CatalogTupleUpdate(), CommitTransactionCommand(), elog, ereport, errdetail(), errmsg(), ERROR, GETSTRUCT(), GetTransactionSnapshot(), heap_freetuple(), heap_modify_tuple(), HeapTupleIsValid, InvalidXLogRecPtr, IsTransactionState(), likely, LockSharedObject(), LSN_FORMAT_ARGS, LSNGetDatum(), MySubscription, Subscription::name, NoLock, ObjectIdGetDatum(), Subscription::oid, PopActiveSnapshot(), PushActiveSnapshot(), RelationGetDescr, RowExclusiveLock, SearchSysCacheCopy1, Subscription::skiplsn, StartTransactionCommand(), HeapTupleData::t_self, table_close(), table_open(), values, WARNING, and XLogRecPtrIsValid.
Referenced by apply_handle_commit_internal(), apply_handle_commit_prepared(), apply_handle_prepare(), apply_handle_rollback_prepared(), and apply_handle_stream_prepare().
|
static |
Definition at line 870 of file worker.c.
References AccessShareLock, addRTEPermissionInfo(), AfterTriggerBeginQuery(), bms_make_singleton(), CreateExecutorState(), EState::es_opened_result_relations, EState::es_output_cid, ApplyExecutionData::estate, ExecInitRangeTable(), GetCurrentCommandId(), InitResultRelInfo(), lappend(), list_make1, LogicalRepRelMapEntry::localrel, makeNode, NIL, palloc0(), RelationData::rd_rel, RelationGetRelid, RTE_RELATION, RangeTblEntry::rtekind, ApplyExecutionData::targetRel, and ApplyExecutionData::targetRelInfo.
Referenced by apply_handle_delete(), apply_handle_insert(), and apply_handle_update().
| void DisableSubscriptionAndExit | ( | void | ) |
Definition at line 5943 of file worker.c.
References AbortOutOfAnyTransaction(), am_leader_apply_worker(), ApplyLauncherForgetWorkerStartTime(), CheckSubDeadTupleRetention(), CommitTransactionCommand(), DisableSubscription(), EmitErrorReport(), ereport, errmsg(), FlushErrorState(), GetTransactionSnapshot(), HOLD_INTERRUPTS, LOG, MyLogicalRepWorker, MySubscription, Subscription::name, Subscription::oid, pgstat_report_subscription_error(), PopActiveSnapshot(), proc_exit(), PushActiveSnapshot(), RESUME_INTERRUPTS, Subscription::retaindeadtuples, Subscription::retentionactive, StartTransactionCommand(), LogicalRepWorker::subid, LogicalRepWorker::type, and WARNING.
Referenced by start_apply(), start_sequence_sync(), and start_table_sync().
|
static |
Definition at line 749 of file worker.c.
References CommandCounterIncrement(), and PopActiveSnapshot().
Referenced by apply_handle_commit_prepared(), apply_handle_delete(), apply_handle_insert(), apply_handle_prepare(), apply_handle_rollback_prepared(), apply_handle_stream_prepare(), apply_handle_truncate(), apply_handle_update(), apply_spooled_messages(), ensure_last_message(), stream_abort_internal(), and stream_start_internal().
|
static |
Definition at line 2228 of file worker.c.
References Assert(), begin_replication_step(), BufFileClose(), BufFileOpenFileSet(), BufFileSeek(), BufFileTell(), changes_filename(), elog, end_replication_step(), ERROR, fd(), IsTransactionState(), MAXPGPATH, MyLogicalRepWorker, and LogicalRepWorker::subid.
Referenced by apply_spooled_messages().
|
static |
Definition at line 3269 of file worker.c.
References am_leader_apply_worker(), ereport, errcode(), errmsg(), ERROR, InvalidOid, IsIndexUsableForFindingDeletedTuple(), logicalrep_worker_find(), LW_SHARED, LWLockAcquire(), LWLockRelease(), MyLogicalRepWorker, MySubscription, OidIsValid, LogicalRepWorker::oldest_nonremovable_xid, RelationFindDeletedTupleInfoByIndex(), RelationFindDeletedTupleInfoSeq(), LogicalRepWorker::relmutex, Subscription::retaindeadtuples, SpinLockAcquire, SpinLockRelease, LogicalRepWorker::subid, track_commit_timestamp, TransactionIdIsValid, and WORKERTYPE_APPLY.
Referenced by apply_handle_tuple_routing(), and apply_handle_update_internal().
|
static |
Definition at line 3174 of file worker.c.
References AccessShareLock, ACL_SELECT, Assert(), LogicalRepRelMapEntry::attrmap, EState::es_tupleTable, ApplyExecutionData::estate, GetRelationIdentityOrPK(), index_close(), index_open(), IsIndexUsableForReplicaIdentityFull(), LockTupleExclusive, OidIsValid, RelationFindReplTupleByIndex(), RelationFindReplTupleSeq(), LogicalRepRelation::replident, table_slot_create(), TargetPrivilegesCheck(), and ApplyExecutionData::targetRel.
Referenced by apply_handle_delete_internal(), apply_handle_tuple_routing(), and apply_handle_update_internal().
|
static |
Definition at line 928 of file worker.c.
References AfterTriggerEndQuery(), EState::es_tupleTable, ApplyExecutionData::estate, ExecCleanupTupleRouting(), ExecResetTupleTable(), FreeExecutorState(), ApplyExecutionData::mtstate, pfree(), and ApplyExecutionData::proute.
Referenced by apply_handle_delete(), apply_handle_insert(), and apply_handle_update().
|
static |
Definition at line 4453 of file worker.c.
References adjust_xid_advance_interval(), Assert(), RetainDeadTuplesData::candidate_xid, RetainDeadTuplesData::candidate_xid_time, GetCurrentTimestamp(), GetOldestActiveTransactionId(), RetainDeadTuplesData::last_recv_time, MyLogicalRepWorker, now(), LogicalRepWorker::oldest_nonremovable_xid, RetainDeadTuplesData::phase, process_rdt_phase_transition(), RDT_REQUEST_PUBLISHER_STATUS, TimestampDifferenceExceeds(), TransactionIdEquals, TransactionIdPrecedesOrEquals(), and RetainDeadTuplesData::xid_advance_interval.
Referenced by process_rdt_phase_transition().
|
static |
Definition at line 3895 of file worker.c.
References dlist_mutable_iter::cur, dlist_container, dlist_delete(), dlist_foreach_modify, dlist_is_empty(), dlist_tail_element, GetFlushRecPtr(), InvalidXLogRecPtr, FlushPosition::local_end, lsn_mapping, pfree(), FlushPosition::remote_end, and write.
Referenced by send_feedback(), and wait_for_local_flush().
|
static |
Definition at line 6316 of file worker.c.
References am_parallel_apply_worker(), in_streamed_transaction, pa_find_worker(), ParallelApplyWorkerInfo::serialize_changes, TRANS_LEADER_APPLY, TRANS_LEADER_PARTIAL_SERIALIZE, TRANS_LEADER_SEND_TO_PARALLEL, TRANS_LEADER_SERIALIZE, and TRANS_PARALLEL_APPLY.
Referenced by apply_handle_stream_abort(), apply_handle_stream_commit(), apply_handle_stream_prepare(), apply_handle_stream_start(), apply_handle_stream_stop(), and handle_streamed_transaction().
|
static |
Definition at line 777 of file worker.c.
References generate_unaccent_rules::action, Assert(), StringInfoData::data, elog, ereport, errcode(), errmsg_internal(), ERROR, get_transaction_apply_action(), StringInfoData::len, LOGICAL_REP_MSG_RELATION, LOGICAL_REP_MSG_TYPE, pa_send_data(), pa_start_subtrans(), pa_switch_to_partial_serialize(), parallel_stream_nchanges, pq_getmsgint(), stream_fd, stream_write_change(), stream_xid, subxact_info_add(), TRANS_LEADER_APPLY, TRANS_LEADER_PARTIAL_SERIALIZE, TRANS_LEADER_SEND_TO_PARALLEL, TRANS_LEADER_SERIALIZE, TRANS_PARALLEL_APPLY, and TransactionIdIsValid.
Referenced by apply_handle_delete(), apply_handle_insert(), apply_handle_relation(), apply_handle_truncate(), apply_handle_type(), and apply_handle_update().
| void InitializeLogRepWorker | ( | void | ) |
Definition at line 5737 of file worker.c.
References AccessShareLock, ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, am_leader_apply_worker(), am_sequencesync_worker(), am_tablesync_worker(), apply_worker_exit(), ApplyContext, ApplyLauncherForgetWorkerStartTime(), BackgroundWorkerInitializeConnectionByOid(), CacheRegisterSyscacheCallback(), CommitTransactionCommand(), LogicalRepWorker::dbid, Subscription::enabled, ereport, errmsg(), get_rel_name(), GetSubscription(), LockSharedObject(), LOG, MemoryContextSwitchTo(), MyLogicalRepWorker, MySubscription, MySubscriptionValid, Subscription::name, LogicalRepWorker::oldest_nonremovable_xid, PGC_BACKEND, PGC_S_OVERRIDE, PGC_SUSET, proc_exit(), LogicalRepWorker::relid, Subscription::retaindeadtuples, Subscription::retentionactive, SetConfigOption(), StartTransactionCommand(), LogicalRepWorker::subid, subscription_change_cb(), Subscription::synccommit, TopMemoryContext, TransactionIdIsValid, and LogicalRepWorker::userid.
Referenced by ParallelApplyWorkerMain(), and SetupApplyOrSyncWorker().
|
static |
Definition at line 3235 of file worker.c.
References elog, ERROR, HeapTupleHeaderGetXmin(), HeapTupleIsValid, ObjectIdGetDatum(), ReleaseSysCache(), SearchSysCache1(), HeapTupleData::t_data, and TransactionIdPrecedes().
Referenced by FindDeletedTupleInLocalRel().
| bool IsLogicalParallelApplyWorker | ( | void | ) |
Definition at line 6011 of file worker.c.
References am_parallel_apply_worker(), and IsLogicalWorker().
Referenced by mq_putmessage().
| bool IsLogicalWorker | ( | void | ) |
Definition at line 6002 of file worker.c.
References MyLogicalRepWorker.
Referenced by IsLogicalParallelApplyWorker(), and ProcessInterrupts().
|
static |
Definition at line 3981 of file worker.c.
References AcceptInvalidationMessages(), ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, apply_dispatch(), apply_error_callback(), apply_error_context_stack, ApplyContext, ApplyMessageContext, buf, ErrorContextCallback::callback, CHECK_FOR_INTERRUPTS, ConfigReloadPending, dlist_is_empty(), elog, ereport, errcode(), errmsg(), ERROR, error_context_stack, fd(), FullTransactionIdFromU64(), GetCurrentTimestamp(), in_remote_transaction, in_streamed_transaction, initReadOnlyStringInfo(), IsTransactionState(), RetainDeadTuplesData::last_recv_time, len, LOG, LogicalStreamingContext, LogRepWorkerWalRcvConn, lsn_mapping, Subscription::maxretention, maybe_advance_nonremovable_xid(), maybe_reread_subscription(), MemoryContextReset(), MemoryContextSwitchTo(), Min, MyLatch, MySubscription, NAPTIME_PER_CYCLE, now(), PGC_SIGHUP, PGINVALID_SOCKET, pgstat_report_activity(), pgstat_report_stat(), RetainDeadTuplesData::phase, pq_getmsgbyte(), pq_getmsgint64(), PqReplMsg_Keepalive, PqReplMsg_PrimaryStatusUpdate, PqReplMsg_WALData, ErrorContextCallback::previous, ProcessConfigFile(), ProcessSyncingRelations(), RDT_GET_CANDIDATE_XID, RetainDeadTuplesData::remote_lsn, RetainDeadTuplesData::remote_nextxid, RetainDeadTuplesData::remote_oldestxid, RetainDeadTuplesData::reply_time, ResetLatch(), Subscription::retentionactive, send_feedback(), STATE_IDLE, TimestampTzPlusMilliseconds, TopMemoryContext, UpdateWorkerStats(), WaitLatchOrSocket(), wal_receiver_timeout, walrcv_endstreaming, walrcv_receive, WalWriterDelay, WL_EXIT_ON_PM_DEATH, WL_LATCH_SET, WL_SOCKET_READABLE, WL_TIMEOUT, RetainDeadTuplesData::xid_advance_interval, and XLogRecPtrIsValid.
Referenced by start_apply().
| void LogicalRepWorkersWakeupAtCommit | ( | Oid | subid | ) |
Definition at line 6255 of file worker.c.
References list_append_unique_oid(), MemoryContextSwitchTo(), on_commit_wakeup_workers_subids, and TopTransactionContext.
Referenced by AlterObjectRename_internal(), AlterSubscription(), and AlterSubscriptionOwner_internal().
|
static |
Definition at line 4387 of file worker.c.
References can_advance_nonremovable_xid(), and process_rdt_phase_transition().
Referenced by LogicalRepApplyLoop().
| void maybe_reread_subscription | ( | void | ) |
Definition at line 5038 of file worker.c.
References am_leader_apply_worker(), am_parallel_apply_worker(), apply_worker_exit(), ApplyContext, ApplyLauncherForgetWorkerStartTime(), Assert(), Subscription::binary, CommitTransactionCommand(), Subscription::conninfo, Subscription::dbid, elog, equal(), ereport, errmsg(), ERROR, FreeSubscription(), GetSubscription(), IsTransactionState(), LOG, MemoryContextSwitchTo(), MyLogicalRepWorker, MySubscription, MySubscriptionValid, Subscription::name, newsub(), Subscription::origin, Subscription::owner, Subscription::ownersuperuser, Subscription::passwordrequired, PGC_BACKEND, PGC_S_OVERRIDE, proc_exit(), Subscription::publications, SetConfigOption(), Subscription::slotname, StartTransactionCommand(), Subscription::stream, LogicalRepWorker::subid, Subscription::synccommit, and Subscription::twophasestate.
Referenced by apply_handle_commit_internal(), begin_replication_step(), LogicalRepApplyLoop(), and pa_can_start().
|
static |
Definition at line 6021 of file worker.c.
References Assert(), ereport, errmsg(), in_remote_transaction, in_streamed_transaction, is_skipping_changes, likely, LOG, LSN_FORMAT_ARGS, MySubscription, skip_xact_finish_lsn, Subscription::skiplsn, and XLogRecPtrIsValid.
Referenced by apply_handle_begin(), apply_handle_begin_prepare(), and apply_spooled_messages().
|
static |
Definition at line 4423 of file worker.c.
References get_candidate_xid(), RetainDeadTuplesData::phase, RDT_GET_CANDIDATE_XID, RDT_REQUEST_PUBLISHER_STATUS, RDT_RESUME_CONFLICT_INFO_RETENTION, RDT_STOP_CONFLICT_INFO_RETENTION, RDT_WAIT_FOR_LOCAL_FLUSH, RDT_WAIT_FOR_PUBLISHER_STATUS, request_publisher_status(), resume_conflict_info_retention(), stop_conflict_info_retention(), wait_for_local_flush(), and wait_for_publisher_status().
Referenced by get_candidate_xid(), maybe_advance_nonremovable_xid(), wait_for_local_flush(), and wait_for_publisher_status().
| void ReplicationOriginNameForLogicalRep | ( | Oid | suboid, |
| Oid | relid, | ||
| char * | originname, | ||
| Size | szoriginname | ||
| ) |
Definition at line 641 of file worker.c.
References OidIsValid, and snprintf.
Referenced by AlterSubscription(), AlterSubscription_refresh(), binary_upgrade_replorigin_advance(), CreateSubscription(), DropSubscription(), LogicalRepSyncTableStart(), ParallelApplyWorkerMain(), ProcessSyncingTablesForApply(), ProcessSyncingTablesForSync(), run_apply_worker(), and run_tablesync_worker().
|
static |
Definition at line 5858 of file worker.c.
References InvalidRepOriginId, InvalidXLogRecPtr, replorigin_session_origin, replorigin_session_origin_lsn, and replorigin_session_origin_timestamp.
Referenced by SetupApplyOrSyncWorker(), and start_apply().
|
static |
Definition at line 4516 of file worker.c.
References ApplyContext, StringInfoData::data, DEBUG2, elog, GetCurrentTimestamp(), StringInfoData::len, LogRepWorkerWalRcvConn, makeStringInfo(), MemoryContextSwitchTo(), RetainDeadTuplesData::phase, pq_sendbyte(), pq_sendint64(), PqReplMsg_PrimaryStatusRequest, RDT_WAIT_FOR_PUBLISHER_STATUS, resetStringInfo(), and walrcv_send.
Referenced by process_rdt_phase_transition().
|
inlinestatic |
Definition at line 6239 of file worker.c.
References apply_error_callback_arg, ApplyErrorCallbackArg::command, InvalidTransactionId, InvalidXLogRecPtr, ApplyErrorCallbackArg::rel, ApplyErrorCallbackArg::remote_attnum, and set_apply_error_context_xact().
Referenced by apply_handle_commit(), apply_handle_commit_prepared(), apply_handle_prepare(), apply_handle_rollback_prepared(), apply_handle_stream_abort(), apply_handle_stream_commit(), apply_handle_stream_prepare(), and apply_handle_stream_stop().
|
static |
Definition at line 4921 of file worker.c.
References RetainDeadTuplesData::candidate_xid, InvalidFullTransactionId, InvalidTransactionId, InvalidXLogRecPtr, RetainDeadTuplesData::phase, RDT_GET_CANDIDATE_XID, RetainDeadTuplesData::remote_lsn, RetainDeadTuplesData::remote_nextxid, RetainDeadTuplesData::remote_oldestxid, RetainDeadTuplesData::remote_wait_for, RetainDeadTuplesData::reply_time, and RetainDeadTuplesData::table_sync_wait_time.
Referenced by stop_conflict_info_retention(), and wait_for_local_flush().
|
static |
Definition at line 4842 of file worker.c.
References apply_worker_exit(), ereport, errdetail(), errmsg(), LOG, Subscription::maxretention, MySubscription, Subscription::name, and update_retention_status().
Referenced by process_rdt_phase_transition().
|
static |
Definition at line 5624 of file worker.c.
References AllTablesyncsReady(), CommitTransactionCommand(), Subscription::conninfo, DEBUG1, ereport, err(), errcode(), errmsg(), errmsg_internal(), ERROR, GetTransactionSnapshot(), InvalidOid, InvalidXLogRecPtr, LogRepWorkerWalRcvConn, MySubscription, Subscription::name, NAMEDATALEN, Subscription::oid, OidIsValid, options, Subscription::ownersuperuser, Subscription::passwordrequired, PopActiveSnapshot(), PushActiveSnapshot(), ReplicationOriginNameForLogicalRep(), replorigin_by_name(), replorigin_create(), replorigin_session_get_progress(), replorigin_session_origin, replorigin_session_setup(), set_apply_error_context_origin(), set_stream_options(), Subscription::slotname, start_apply(), StartTransactionCommand(), Subscription::twophasestate, UpdateTwoPhaseState(), walrcv_connect, walrcv_identify_system, and walrcv_startstreaming.
Referenced by ApplyWorkerMain().
|
static |
Definition at line 4297 of file worker.c.
References ApplyContext, StringInfoData::data, DEBUG2, elog, get_flush_position(), GetCurrentTimestamp(), InvalidXLogRecPtr, last_flushpos, StringInfoData::len, LogRepWorkerWalRcvConn, LSN_FORMAT_ARGS, makeStringInfo(), MemoryContextSwitchTo(), now(), pq_sendbyte(), pq_sendint64(), PqReplMsg_StandbyStatusUpdate, reply_message, resetStringInfo(), TimestampDifferenceExceeds(), wal_receiver_status_interval, and walrcv_send.
Referenced by LogicalRepApplyLoop().
| void set_apply_error_context_origin | ( | char * | originname | ) |
Definition at line 6301 of file worker.c.
References apply_error_callback_arg, ApplyContext, MemoryContextStrdup(), and ApplyErrorCallbackArg::origin_name.
Referenced by ParallelApplyWorkerMain(), run_apply_worker(), and run_tablesync_worker().
|
inlinestatic |
Definition at line 6231 of file worker.c.
References apply_error_callback_arg, ApplyErrorCallbackArg::finish_lsn, and ApplyErrorCallbackArg::remote_xid.
Referenced by apply_handle_begin(), apply_handle_begin_prepare(), apply_handle_commit_prepared(), apply_handle_rollback_prepared(), apply_handle_stream_abort(), apply_handle_stream_commit(), apply_handle_stream_prepare(), apply_handle_stream_start(), and reset_apply_error_context_info().
| void set_stream_options | ( | WalRcvStreamOptions * | options, |
| char * | slotname, | ||
| XLogRecPtr * | origin_startpos | ||
| ) |
Definition at line 5514 of file worker.c.
References Subscription::binary, LOGICALREP_PROTO_STREAM_PARALLEL_VERSION_NUM, LOGICALREP_PROTO_STREAM_VERSION_NUM, LOGICALREP_PROTO_TWOPHASE_VERSION_NUM, LOGICALREP_PROTO_VERSION_NUM, LogRepWorkerWalRcvConn, MyLogicalRepWorker, MySubscription, Subscription::origin, LogicalRepWorker::parallel_apply, pstrdup(), Subscription::publications, server_version, Subscription::stream, and walrcv_server_version.
Referenced by run_apply_worker(), and run_tablesync_worker().
| void SetupApplyOrSyncWorker | ( | int | worker_slot | ) |
Definition at line 5869 of file worker.c.
References am_leader_apply_worker(), am_sequencesync_worker(), am_tablesync_worker(), Assert(), BackgroundWorkerUnblockSignals(), before_shmem_exit(), CacheRegisterSyscacheCallback(), Subscription::conninfo, DEBUG1, die, elog, GetCurrentTimestamp(), InitializeLogRepWorker(), InvalidateSyncingRelStates(), LogicalRepWorker::last_recv_time, LogicalRepWorker::last_send_time, load_file(), logicalrep_worker_attach(), MyLogicalRepWorker, MySubscription, pqsignal, replorigin_reset(), LogicalRepWorker::reply_time, SIGHUP, and SignalHandlerForConfigReload().
Referenced by ApplyWorkerMain(), SequenceSyncWorkerMain(), and TableSyncWorkerMain().
|
static |
Definition at line 681 of file worker.c.
References elog, ereport, errcode(), errdetail(), errmsg(), ERROR, LogicalRepRelMapEntry::localreloid, MyLogicalRepWorker, MySubscription, Subscription::name, LogicalRepWorker::relid, remote_final_lsn, LogicalRepRelMapEntry::state, LogicalRepRelMapEntry::statelsn, LogicalRepWorker::type, WORKERTYPE_APPLY, WORKERTYPE_PARALLEL_APPLY, WORKERTYPE_SEQUENCESYNC, WORKERTYPE_TABLESYNC, and WORKERTYPE_UNKNOWN.
Referenced by apply_handle_delete(), apply_handle_insert(), apply_handle_truncate(), and apply_handle_update().
|
static |
Definition at line 4769 of file worker.c.
References Assert(), RetainDeadTuplesData::candidate_xid, RetainDeadTuplesData::candidate_xid_time, GetCurrentTimestamp(), RetainDeadTuplesData::last_recv_time, Subscription::maxretention, MySubscription, now(), RetainDeadTuplesData::phase, RDT_WAIT_FOR_LOCAL_FLUSH, RDT_WAIT_FOR_PUBLISHER_STATUS, RetainDeadTuplesData::table_sync_wait_time, TimestampDifferenceExceeds(), and TransactionIdIsValid.
Referenced by wait_for_local_flush(), and wait_for_publisher_status().
|
static |
Definition at line 959 of file worker.c.
References Assert(), CompactAttribute::attgenerated, CompactAttribute::attisdropped, attnum, AttrMap::attnums, LogicalRepRelMapEntry::attrmap, build_column_default(), ExecEvalExpr(), ExecInitExpr(), expression_planner(), GetPerTupleExprContext, i, LogicalRepRelMapEntry::localrel, AttrMap::maplen, TupleDescData::natts, LogicalRepRelation::natts, palloc(), RelationGetDescr, LogicalRepRelMapEntry::remoterel, TupleTableSlot::tts_isnull, TupleTableSlot::tts_values, and TupleDescCompactAttr().
Referenced by apply_handle_insert().
|
static |
Definition at line 1118 of file worker.c.
References apply_error_callback_arg, Assert(), AttrMap::attnums, LogicalRepRelMapEntry::attrmap, LogicalRepTupleData::colstatus, LogicalRepTupleData::colvalues, StringInfoData::cursor, StringInfoData::data, ereport, errcode(), errmsg(), ERROR, ExecClearTuple(), ExecStoreVirtualTuple(), getTypeBinaryInputInfo(), getTypeInputInfo(), i, StringInfoData::len, LOGICALREP_COLUMN_BINARY, LOGICALREP_COLUMN_TEXT, LOGICALREP_COLUMN_UNCHANGED, AttrMap::maplen, TupleDescData::natts, OidInputFunctionCall(), OidReceiveFunctionCall(), ApplyErrorCallbackArg::remote_attnum, slot_getallattrs(), TupleTableSlot::tts_isnull, TupleTableSlot::tts_tupleDescriptor, TupleTableSlot::tts_values, and TupleDescAttr().
Referenced by apply_handle_tuple_routing(), and apply_handle_update_internal().
|
static |
Definition at line 1017 of file worker.c.
References apply_error_callback_arg, Assert(), AttrMap::attnums, LogicalRepRelMapEntry::attrmap, LogicalRepTupleData::colstatus, LogicalRepTupleData::colvalues, StringInfoData::cursor, StringInfoData::data, ereport, errcode(), errmsg(), ERROR, ExecClearTuple(), ExecStoreVirtualTuple(), getTypeBinaryInputInfo(), getTypeInputInfo(), i, StringInfoData::len, LOGICALREP_COLUMN_BINARY, LOGICALREP_COLUMN_TEXT, AttrMap::maplen, TupleDescData::natts, OidInputFunctionCall(), OidReceiveFunctionCall(), ApplyErrorCallbackArg::remote_attnum, TupleTableSlot::tts_isnull, TupleTableSlot::tts_tupleDescriptor, TupleTableSlot::tts_values, and TupleDescAttr().
Referenced by apply_handle_delete(), apply_handle_insert(), apply_handle_tuple_routing(), apply_handle_update(), and apply_handle_update_internal().
| void start_apply | ( | XLogRecPtr | origin_startpos | ) |
Definition at line 5583 of file worker.c.
References AbortOutOfAnyTransaction(), Subscription::disableonerr, DisableSubscriptionAndExit(), LogicalRepApplyLoop(), MyLogicalRepWorker, MySubscription, Subscription::oid, PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, pgstat_report_subscription_error(), replorigin_reset(), and LogicalRepWorker::type.
Referenced by run_apply_worker(), and run_tablesync_worker().
|
static |
Definition at line 4804 of file worker.c.
References Assert(), ereport, errdetail(), errmsg(), InvalidTransactionId, LOG, MyLogicalRepWorker, MySubscription, Subscription::name, LogicalRepWorker::oldest_nonremovable_xid, LogicalRepWorker::relmutex, reset_retention_data_fields(), Subscription::retentionactive, SpinLockAcquire, SpinLockRelease, TransactionIdIsValid, and update_retention_status().
Referenced by process_rdt_phase_transition().
|
static |
Definition at line 6048 of file worker.c.
References ereport, errmsg(), InvalidXLogRecPtr, is_skipping_changes, LOG, LSN_FORMAT_ARGS, and skip_xact_finish_lsn.
Referenced by apply_handle_commit_internal(), apply_handle_prepare(), and apply_handle_stream_prepare().
| void store_flush_position | ( | XLogRecPtr | remote_lsn, |
| XLogRecPtr | local_lsn | ||
| ) |
Definition at line 3939 of file worker.c.
References am_parallel_apply_worker(), ApplyContext, ApplyMessageContext, dlist_push_tail(), FlushPosition::local_end, lsn_mapping, MemoryContextSwitchTo(), FlushPosition::node, palloc(), and FlushPosition::remote_end.
Referenced by apply_handle_commit_internal(), apply_handle_commit_prepared(), apply_handle_prepare(), apply_handle_rollback_prepared(), apply_handle_stream_prepare(), and pa_xact_finish().
|
static |
Definition at line 1988 of file worker.c.
References begin_replication_step(), BufFileClose(), BufFileOpenFileSet(), BufFileTruncateFileSet(), changes_filename(), cleanup_subxact_info(), CommitTransactionCommand(), end_replication_step(), fd(), SubXactInfo::fileno, i, MAXPGPATH, MyLogicalRepWorker, ApplySubXactData::nsubxacts, SubXactInfo::offset, stream_cleanup_files(), LogicalRepWorker::stream_fileset, LogicalRepWorker::subid, subxact_data, subxact_info_read(), subxact_info_write(), ApplySubXactData::subxacts, and SubXactInfo::xid.
Referenced by apply_handle_stream_abort().
| void stream_cleanup_files | ( | Oid | subid, |
| TransactionId | xid | ||
| ) |
Definition at line 5381 of file worker.c.
References BufFileDeleteFileSet(), changes_filename(), MAXPGPATH, MyLogicalRepWorker, LogicalRepWorker::stream_fileset, and subxact_filename().
Referenced by apply_handle_stream_commit(), apply_handle_stream_prepare(), pa_free_worker_info(), and stream_abort_internal().
|
static |
Definition at line 5450 of file worker.c.
References Assert(), BufFileClose(), and stream_fd.
Referenced by apply_handle_stream_abort(), apply_handle_stream_commit(), apply_handle_stream_prepare(), apply_spooled_messages(), and stream_stop_internal().
|
static |
Definition at line 5498 of file worker.c.
References generate_unaccent_rules::action, Assert(), in_streamed_transaction, stream_fd, stream_start_internal(), stream_stop_internal(), and stream_write_change().
Referenced by apply_handle_stream_abort(), apply_handle_stream_commit(), and apply_handle_stream_prepare().
|
static |
Definition at line 5405 of file worker.c.
References Assert(), BufFileCreateFileSet(), BufFileOpenFileSet(), BufFileSeek(), changes_filename(), DEBUG1, elog, LogicalStreamingContext, MAXPGPATH, MemoryContextSwitchTo(), MyLogicalRepWorker, OidIsValid, stream_fd, LogicalRepWorker::stream_fileset, and TransactionIdIsValid.
Referenced by stream_start_internal().
| void stream_start_internal | ( | TransactionId | xid, |
| bool | first_segment | ||
| ) |
Definition at line 1687 of file worker.c.
References ApplyContext, begin_replication_step(), end_replication_step(), FileSetInit(), MemoryContextSwitchTo(), MyLogicalRepWorker, palloc(), LogicalRepWorker::stream_fileset, stream_open_file(), LogicalRepWorker::subid, and subxact_info_read().
Referenced by apply_handle_stream_start(), pa_switch_to_partial_serialize(), and stream_open_and_write_change().
| void stream_stop_internal | ( | TransactionId | xid | ) |
Definition at line 1862 of file worker.c.
References Assert(), CommitTransactionCommand(), IsTransactionState(), LogicalStreamingContext, MemoryContextReset(), MyLogicalRepWorker, stream_close_file(), LogicalRepWorker::subid, and subxact_info_write().
Referenced by apply_handle_stream_stop(), and stream_open_and_write_change().
|
static |
Definition at line 5468 of file worker.c.
References generate_unaccent_rules::action, Assert(), BufFileWrite(), StringInfoData::cursor, StringInfoData::data, StringInfoData::len, len, and stream_fd.
Referenced by apply_handle_stream_start(), apply_handle_stream_stop(), handle_streamed_transaction(), and stream_open_and_write_change().
Definition at line 5167 of file worker.c.
References MySubscriptionValid.
Referenced by InitializeLogRepWorker().
|
inlinestatic |
Definition at line 5360 of file worker.c.
References MAXPGPATH, and snprintf.
Referenced by stream_cleanup_files(), subxact_info_read(), and subxact_info_write().
|
static |
Definition at line 5282 of file worker.c.
References Assert(), BufFileTell(), SubXactInfo::fileno, i, LogicalStreamingContext, MemoryContextSwitchTo(), ApplySubXactData::nsubxacts, ApplySubXactData::nsubxacts_max, SubXactInfo::offset, palloc(), repalloc(), stream_fd, stream_xid, subxact_data, ApplySubXactData::subxact_last, ApplySubXactData::subxacts, TransactionIdIsValid, and SubXactInfo::xid.
Referenced by handle_streamed_transaction().
|
static |
Definition at line 5231 of file worker.c.
References Assert(), BufFileClose(), BufFileOpenFileSet(), BufFileReadExact(), fd(), len, LogicalStreamingContext, MAXPGPATH, MemoryContextSwitchTo(), MyLogicalRepWorker, ApplySubXactData::nsubxacts, ApplySubXactData::nsubxacts_max, palloc(), pg_ceil_log2_32(), LogicalRepWorker::stream_fileset, subxact_data, subxact_filename(), and ApplySubXactData::subxacts.
Referenced by stream_abort_internal(), and stream_start_internal().
|
static |
Definition at line 5182 of file worker.c.
References Assert(), BufFileClose(), BufFileCreateFileSet(), BufFileDeleteFileSet(), BufFileOpenFileSet(), BufFileWrite(), cleanup_subxact_info(), fd(), len, MAXPGPATH, MyLogicalRepWorker, ApplySubXactData::nsubxacts, LogicalRepWorker::stream_fileset, subxact_data, subxact_filename(), ApplySubXactData::subxacts, and TransactionIdIsValid.
Referenced by stream_abort_internal(), and stream_stop_internal().
Definition at line 2601 of file worker.c.
References aclcheck_error(), ACLCHECK_OK, check_enable_rls(), ereport, errcode(), errmsg(), ERROR, get_rel_name(), get_relkind_objtype(), GetUserId(), GetUserNameFromId(), InvalidOid, mode, pg_class_aclcheck(), RelationData::rd_rel, RelationGetRelationName, RelationGetRelid, and RLS_ENABLED.
Referenced by apply_handle_delete_internal(), apply_handle_insert_internal(), apply_handle_truncate(), apply_handle_tuple_routing(), apply_handle_update_internal(), and FindReplTupleInLocalRel().
|
static |
Definition at line 4882 of file worker.c.
References ApplyLauncherWakeup(), CommitTransactionCommand(), GetTransactionSnapshot(), IsTransactionState(), MySubscription, Subscription::oid, PopActiveSnapshot(), PushActiveSnapshot(), Subscription::retentionactive, StartTransactionCommand(), and UpdateDeadTupleRetentionStatus().
Referenced by resume_conflict_info_retention(), and stop_conflict_info_retention().
|
static |
Definition at line 3965 of file worker.c.
References GetCurrentTimestamp(), LogicalRepWorker::last_lsn, LogicalRepWorker::last_recv_time, LogicalRepWorker::last_send_time, MyLogicalRepWorker, LogicalRepWorker::reply_lsn, and LogicalRepWorker::reply_time.
Referenced by LogicalRepApplyLoop().
|
static |
Definition at line 4614 of file worker.c.
References AllTablesyncsReady(), ApplyLauncherWakeup(), Assert(), RetainDeadTuplesData::candidate_xid, RetainDeadTuplesData::candidate_xid_time, DEBUG2, elog, ereport, errdetail_internal(), errmsg_internal(), ERROR, RetainDeadTuplesData::flushpos_update_time, get_flush_position(), GetCurrentTimestamp(), HasSubscriptionTablesCached(), last_flushpos, RetainDeadTuplesData::last_recv_time, LSN_FORMAT_ARGS, MyLogicalRepWorker, MySubscription, now(), LogicalRepWorker::oldest_nonremovable_xid, RetainDeadTuplesData::phase, process_rdt_phase_transition(), RDT_RESUME_CONFLICT_INFO_RETENTION, RDT_STOP_CONFLICT_INFO_RETENTION, LogicalRepWorker::relmutex, RetainDeadTuplesData::remote_lsn, RetainDeadTuplesData::reply_time, reset_retention_data_fields(), Subscription::retentionactive, should_stop_conflict_info_retention(), SpinLockAcquire, SpinLockRelease, RetainDeadTuplesData::table_sync_wait_time, TimestampDifferenceExceeds(), TimestampDifferenceMilliseconds(), TransactionIdIsValid, WalWriterDelay, and XLogRecPtrIsValid.
Referenced by process_rdt_phase_transition().
|
static |
Definition at line 4555 of file worker.c.
References FullTransactionIdIsValid, FullTransactionIdPrecedesOrEquals, RetainDeadTuplesData::phase, process_rdt_phase_transition(), RDT_REQUEST_PUBLISHER_STATUS, RDT_STOP_CONFLICT_INFO_RETENTION, RDT_WAIT_FOR_LOCAL_FLUSH, RetainDeadTuplesData::remote_nextxid, RetainDeadTuplesData::remote_oldestxid, RetainDeadTuplesData::remote_wait_for, and should_stop_conflict_info_retention().
Referenced by process_rdt_phase_transition().
|
static |
Definition at line 459 of file worker.c.
Referenced by apply_dispatch(), apply_error_callback(), apply_handle_delete(), apply_handle_insert(), apply_handle_update(), reset_apply_error_context_info(), set_apply_error_context_origin(), set_apply_error_context_xact(), slot_modify_data(), and slot_store_data().
| ErrorContextCallback* apply_error_context_stack = NULL |
Definition at line 469 of file worker.c.
Referenced by LogicalRepApplyLoop(), and ProcessParallelApplyMessage().
| MemoryContext ApplyContext = NULL |
Definition at line 472 of file worker.c.
Referenced by copy_sequences(), InitializeLogRepWorker(), LogicalParallelApplyLoop(), LogicalRepApplyLoop(), LogicalRepSyncSequences(), maybe_reread_subscription(), pa_allocate_worker(), pa_launch_parallel_worker(), request_publisher_status(), send_feedback(), set_apply_error_context_origin(), start_table_sync(), store_flush_position(), and stream_start_internal().
| MemoryContext ApplyMessageContext = NULL |
Definition at line 471 of file worker.c.
Referenced by apply_spooled_messages(), begin_replication_step(), LogicalParallelApplyLoop(), LogicalRepApplyLoop(), and store_flush_position().
| bool in_remote_transaction = false |
Definition at line 484 of file worker.c.
Referenced by apply_handle_begin(), apply_handle_begin_prepare(), apply_handle_commit_internal(), apply_handle_commit_prepared(), apply_handle_origin(), apply_handle_prepare(), apply_handle_rollback_prepared(), apply_handle_stream_prepare(), apply_spooled_messages(), LogicalRepApplyLoop(), and maybe_start_skipping_changes().
|
static |
Definition at line 488 of file worker.c.
Referenced by apply_handle_origin(), apply_handle_stream_abort(), apply_handle_stream_commit(), apply_handle_stream_prepare(), apply_handle_stream_start(), apply_handle_stream_stop(), get_transaction_apply_action(), LogicalRepApplyLoop(), maybe_start_skipping_changes(), and stream_open_and_write_change().
| bool InitializingApplyWorker = false |
Definition at line 499 of file worker.c.
Referenced by ApplyWorkerMain(), logicalrep_worker_onexit(), and ParallelApplyWorkerMain().
|
static |
Definition at line 527 of file worker.c.
Referenced by send_feedback(), and wait_for_local_flush().
|
static |
Definition at line 475 of file worker.c.
Referenced by LogicalRepApplyLoop(), stream_open_file(), stream_stop_internal(), subxact_info_add(), and subxact_info_read().
| WalReceiverConn* LogRepWorkerWalRcvConn = NULL |
Definition at line 477 of file worker.c.
Referenced by copy_read_data(), copy_table(), fetch_remote_table_info(), logicalrep_worker_onexit(), LogicalRepApplyLoop(), LogicalRepSyncSequences(), LogicalRepSyncTableStart(), ProcessSyncingTablesForSync(), request_publisher_status(), run_apply_worker(), run_tablesync_worker(), send_feedback(), and set_stream_options().
|
static |
Definition at line 308 of file worker.c.
Referenced by get_flush_position(), LogicalRepApplyLoop(), and store_flush_position().
| Subscription* MySubscription = NULL |
Definition at line 479 of file worker.c.
Referenced by adjust_xid_advance_interval(), apply_handle_commit_prepared(), apply_handle_delete(), apply_handle_insert(), apply_handle_prepare_internal(), apply_handle_rollback_prepared(), apply_handle_truncate(), apply_handle_update(), can_advance_nonremovable_xid(), clear_subscription_skip_lsn(), copy_sequence(), copy_sequences(), copy_table(), DisableSubscriptionAndExit(), fetch_remote_table_info(), FetchRelationStates(), FindDeletedTupleInLocalRel(), FinishSyncWorker(), InitializeLogRepWorker(), launch_sync_worker(), logicalrep_rel_open(), LogicalRepApplyLoop(), LogicalRepSyncSequences(), LogicalRepSyncTableStart(), maybe_reread_subscription(), maybe_start_skipping_changes(), pa_can_start(), pa_launch_parallel_worker(), pa_start_subtrans(), pa_stream_abort(), ParallelApplyWorkerMain(), ProcessParallelApplyInterrupts(), ProcessSyncingTablesForApply(), report_sequence_errors(), ReportApplyConflict(), resume_conflict_info_retention(), run_apply_worker(), run_tablesync_worker(), set_stream_options(), SetupApplyOrSyncWorker(), should_apply_changes_for_rel(), should_stop_conflict_info_retention(), start_apply(), start_sequence_sync(), start_table_sync(), stop_conflict_info_retention(), update_retention_status(), and wait_for_local_flush().
|
static |
Definition at line 480 of file worker.c.
Referenced by InitializeLogRepWorker(), maybe_reread_subscription(), and subscription_change_cb().
Definition at line 482 of file worker.c.
Referenced by AtEOXact_LogicalRepWorkers(), and LogicalRepWorkersWakeupAtCommit().
|
static |
Definition at line 496 of file worker.c.
Referenced by apply_handle_stream_start(), apply_handle_stream_stop(), and handle_streamed_transaction().
|
static |
Definition at line 485 of file worker.c.
Referenced by apply_handle_begin(), apply_handle_begin_prepare(), apply_handle_commit(), apply_handle_prepare(), apply_spooled_messages(), and should_apply_changes_for_rel().
|
static |
Definition at line 516 of file worker.c.
Referenced by maybe_start_skipping_changes(), and stop_skipping_changes().
|
static |
Definition at line 520 of file worker.c.
Referenced by apply_handle_stream_abort(), apply_handle_stream_commit(), apply_handle_stream_prepare(), apply_spooled_messages(), handle_streamed_transaction(), stream_close_file(), stream_open_and_write_change(), stream_open_file(), stream_write_change(), and subxact_info_add().
|
static |
Definition at line 490 of file worker.c.
Referenced by apply_handle_begin(), apply_handle_begin_prepare(), apply_handle_stream_start(), apply_handle_stream_stop(), handle_streamed_transaction(), and subxact_info_add().
|
static |
Definition at line 545 of file worker.c.
Referenced by cleanup_subxact_info(), stream_abort_internal(), subxact_info_add(), subxact_info_read(), and subxact_info_write().