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

Function apply_handle_commit

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

* Handle COMMIT message. * * TODO, support tracking of multiple origins */

Source from the content-addressed store, hash-verified

761 * TODO, support tracking of multiple origins
762 */
763static void
764apply_handle_commit(StringInfo s)
765{
766 LogicalRepCommitData commit_data;
767
768 logicalrep_read_commit(s, &commit_data);
769
770 if (commit_data.commit_lsn != remote_final_lsn)
771 ereport(ERROR,
772 (errcode(ERRCODE_PROTOCOL_VIOLATION),
773 errmsg_internal("incorrect commit LSN %X/%X in commit message (expected %X/%X)",
774 LSN_FORMAT_ARGS(commit_data.commit_lsn),
775 LSN_FORMAT_ARGS(remote_final_lsn))));
776
777 apply_handle_commit_internal(&commit_data);
778
779 /* Process any tables that are being synchronized in parallel. */
780 process_syncing_tables(commit_data.end_lsn);
781
782 pgstat_report_activity(STATE_IDLE, NULL);
783}
784
785/*
786 * Handle ORIGIN message.

Callers 1

apply_dispatchFunction · 0.85

Calls 6

logicalrep_read_commitFunction · 0.85
process_syncing_tablesFunction · 0.85
pgstat_report_activityFunction · 0.85
errcodeFunction · 0.50
errmsg_internalFunction · 0.50

Tested by

no test coverage detected