12 #ifndef WORKER_INTERNAL_H
13 #define WORKER_INTERNAL_H
257 char *originname,
Size szoriginname);
329 #define isParallelApplyWorker(worker) ((worker)->in_use && \
330 (worker)->type == WORKERTYPE_PARALLEL_APPLY)
331 #define isTablesyncWorker(worker) ((worker)->in_use && \
332 (worker)->type == WORKERTYPE_TABLESYNC)
#define Assert(condition)
TimestampTz last_recv_time
LogicalRepWorkerType type
TimestampTz last_send_time
shm_mq_handle * error_mq_handle
shm_mq_handle * mq_handle
ParallelApplyWorkerShared * shared
int logicalrep_worker_slot_no
pg_atomic_uint32 pending_stream_count
PartialFileSetState fileset_state
uint16 logicalrep_worker_generation
ParallelTransState xact_state
XLogRecPtr last_commit_end
bool AllTablesyncsReady(void)
@ PARALLEL_TRANS_FINISHED
#define isParallelApplyWorker(worker)
void set_stream_options(WalRcvStreamOptions *options, char *slotname, XLogRecPtr *origin_startpos)
bool logicalrep_worker_launch(LogicalRepWorkerType wtype, Oid dbid, Oid subid, const char *subname, Oid userid, Oid relid, dsm_handle subworker_dsm)
LogicalRepWorker * logicalrep_worker_find(Oid subid, Oid relid, bool only_running)
void pa_set_xact_state(ParallelApplyWorkerShared *wshared, ParallelTransState xact_state)
void stream_cleanup_files(Oid subid, TransactionId xid)
void pa_unlock_stream(TransactionId xid, LOCKMODE lockmode)
PGDLLIMPORT ErrorContextCallback * apply_error_context_stack
PGDLLIMPORT bool in_remote_transaction
void logicalrep_worker_wakeup_ptr(LogicalRepWorker *worker)
List * logicalrep_workers_find(Oid subid, bool only_running, bool acquire_lock)
PGDLLIMPORT MemoryContext ApplyMessageContext
void invalidate_syncing_table_states(Datum arg, int cacheid, uint32 hashvalue)
static bool am_parallel_apply_worker(void)
PGDLLIMPORT LogicalRepWorker * MyLogicalRepWorker
struct ParallelApplyWorkerShared ParallelApplyWorkerShared
void logicalrep_worker_attach(int slot)
ParallelApplyWorkerInfo * pa_find_worker(TransactionId xid)
void stream_stop_internal(TransactionId xid)
void start_apply(XLogRecPtr origin_startpos)
void pa_stream_abort(LogicalRepStreamAbortData *abort_data)
struct ParallelApplyWorkerInfo ParallelApplyWorkerInfo
void pa_lock_stream(TransactionId xid, LOCKMODE lockmode)
void apply_dispatch(StringInfo s)
void pa_set_fileset_state(ParallelApplyWorkerShared *wshared, PartialFileSetState fileset_state)
void pa_reset_subtrans(void)
void logicalrep_pa_worker_stop(ParallelApplyWorkerInfo *winfo)
void DisableSubscriptionAndExit(void)
void process_syncing_tables(XLogRecPtr current_lsn)
void pa_lock_transaction(TransactionId xid, LOCKMODE lockmode)
void ReplicationOriginNameForLogicalRep(Oid suboid, Oid relid, char *originname, Size szoriginname)
void pa_detach_all_error_mq(void)
PGDLLIMPORT struct WalReceiverConn * LogRepWorkerWalRcvConn
PGDLLIMPORT bool InitializingApplyWorker
void stream_start_internal(TransactionId xid, bool first_segment)
void pa_start_subtrans(TransactionId current_xid, TransactionId top_xid)
void pa_switch_to_partial_serialize(ParallelApplyWorkerInfo *winfo, bool stream_locked)
void logicalrep_worker_wakeup(Oid subid, Oid relid)
void logicalrep_worker_stop(Oid subid, Oid relid)
void set_apply_error_context_origin(char *originname)
@ WORKERTYPE_PARALLEL_APPLY
struct LogicalRepWorker LogicalRepWorker
void pa_xact_finish(ParallelApplyWorkerInfo *winfo, XLogRecPtr remote_lsn)
@ FS_SERIALIZE_IN_PROGRESS
#define isTablesyncWorker(worker)
void SetupApplyOrSyncWorker(int worker_slot)
static bool am_tablesync_worker(void)
static bool am_leader_apply_worker(void)
PGDLLIMPORT Subscription * MySubscription
void apply_error_callback(void *arg)
void store_flush_position(XLogRecPtr remote_lsn, XLogRecPtr local_lsn)
int logicalrep_sync_worker_count(Oid subid)
void maybe_reread_subscription(void)
void InitializeLogRepWorker(void)
bool pa_send_data(ParallelApplyWorkerInfo *winfo, Size nbytes, const void *data)
void pa_allocate_worker(TransactionId xid)
PGDLLIMPORT ParallelApplyWorkerShared * MyParallelShared
void apply_spooled_messages(FileSet *stream_fileset, TransactionId xid, XLogRecPtr lsn)
void UpdateTwoPhaseState(Oid suboid, char new_state)
void pa_set_stream_apply_worker(ParallelApplyWorkerInfo *winfo)
void pa_unlock_transaction(TransactionId xid, LOCKMODE lockmode)
void pa_decr_and_wait_stream_block(void)
PGDLLIMPORT MemoryContext ApplyContext