diff options
| author | Amit Kapila <akapila@postgresql.org> | 2025-10-16 05:10:50 +0000 |
|---|---|---|
| committer | Amit Kapila <akapila@postgresql.org> | 2025-10-16 05:10:50 +0000 |
| commit | 41c674d2e31e8304a6edbcb5183d326798ba00f6 (patch) | |
| tree | 590620215a2e855f26223558abf8197d05592212 /src/include/replication/worker_internal.h | |
| parent | 905e932f0922a837bb3e4e482089c7c2e98bea67 (diff) | |
Refactor logical worker synchronization code into a separate file.
To support the upcoming addition of a sequence synchronization worker,
this patch extracts common synchronization logic shared by table sync
workers and the new sequence sync worker into a dedicated file. This
modularization improves code reuse, maintainability, and clarity in the
logical workers framework.
Author: vignesh C <vignesh21@gmail.com>
Author: Hou Zhijie <houzj.fnst@fujitsu.com>
Reviewed-by: shveta malik <shveta.malik@gmail.com>
Reviewed-by: Dilip Kumar <dilipbalaut@gmail.com>
Reviewed-by: Peter Smith <smithpb2250@gmail.com>
Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Discussion: https://postgr.es/m/CAA4eK1LC+KJiAkSrpE_NwvNdidw9F2os7GERUeSxSKv71gXysQ@mail.gmail.com
Diffstat (limited to 'src/include/replication/worker_internal.h')
| -rw-r--r-- | src/include/replication/worker_internal.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/include/replication/worker_internal.h b/src/include/replication/worker_internal.h index de003802612..ae352f6e691 100644 --- a/src/include/replication/worker_internal.h +++ b/src/include/replication/worker_internal.h @@ -251,6 +251,8 @@ extern PGDLLIMPORT bool in_remote_transaction; extern PGDLLIMPORT bool InitializingApplyWorker; +extern PGDLLIMPORT List *table_states_not_ready; + extern void logicalrep_worker_attach(int slot); extern LogicalRepWorker *logicalrep_worker_find(Oid subid, Oid relid, bool only_running); @@ -272,12 +274,16 @@ extern void ReplicationOriginNameForLogicalRep(Oid suboid, Oid relid, char *originname, Size szoriginname); extern bool AllTablesyncsReady(void); -extern bool HasSubscriptionRelationsCached(void); +extern bool HasSubscriptionTablesCached(void); extern void UpdateTwoPhaseState(Oid suboid, char new_state); -extern void process_syncing_tables(XLogRecPtr current_lsn); -extern void invalidate_syncing_table_states(Datum arg, int cacheid, - uint32 hashvalue); +extern void ProcessSyncingTablesForSync(XLogRecPtr current_lsn); +extern void ProcessSyncingTablesForApply(XLogRecPtr current_lsn); + +pg_noreturn extern void FinishSyncWorker(void); +extern void InvalidateSyncingRelStates(Datum arg, int cacheid, uint32 hashvalue); +extern void ProcessSyncingRelations(XLogRecPtr current_lsn); +extern bool FetchRelationStates(bool *started_tx); extern void stream_start_internal(TransactionId xid, bool first_segment); extern void stream_stop_internal(TransactionId xid); |
