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

Function apply_handle_commit_internal

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

* Helper function for apply_handle_commit and apply_handle_stream_commit. */

Source from the content-addressed store, hash-verified

1147 * Helper function for apply_handle_commit and apply_handle_stream_commit.
1148 */
1149static void
1150apply_handle_commit_internal(LogicalRepCommitData *commit_data)
1151{
1152 if (IsTransactionState())
1153 {
1154 /*
1155 * Update origin state so we can restart streaming from correct
1156 * position in case of crash.
1157 */
1158 replorigin_session_origin_lsn = commit_data->end_lsn;
1159 replorigin_session_origin_timestamp = commit_data->committime;
1160
1161 CommitTransactionCommand();
1162 pgstat_report_stat(false);
1163
1164 store_flush_position(commit_data->end_lsn);
1165 }
1166 else
1167 {
1168 /* Process any invalidation messages that might have accumulated. */
1169 AcceptInvalidationMessages();
1170 maybe_reread_subscription();
1171 }
1172
1173 in_remote_transaction = false;
1174}
1175
1176/*
1177 * Handle RELATION message.

Callers 2

apply_handle_commitFunction · 0.85

Calls 6

IsTransactionStateFunction · 0.85
CommitTransactionCommandFunction · 0.85
pgstat_report_statFunction · 0.85
store_flush_positionFunction · 0.85

Tested by

no test coverage detected