Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/bin/pgcopydb/cli_clone_follow.c
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,21 @@ cli_follow(int argc, char **argv)
exit(EXIT_CODE_SOURCE);
}

/*
* The snapshot connection is only needed for the catalog read above;
* nothing in the follow phase uses it. Close it now so a follow-only run
* doesn't hold it idle-in-transaction for the whole run. Gate on the live
* connection, not sourceSnapshot.state, which the catalog read leaves stale.
*/
if (copySpecs.sourceSnapshot.pgsql.connection != NULL)
{
if (!copydb_close_snapshot(&copySpecs))
{
/* errors have already been logged */
exit(EXIT_CODE_SOURCE);
}
}

if (!follow_main_loop(&copySpecs, &specs))
{
/* errors have already been logged */
Expand Down
Loading