Skip to content

Conversation

@mason-sharp
Copy link
Member

  • Refactor apply_worker_get_progress() to return only the timestamp needed. Return value instead of pointer to entire struct.
  • Lock sooner in spock_group_resource_dump() because of getting the number of entries
  • Properly handle progress updates after COPY operations in replication set data sync and avoid potential memory leak
  • Address compiler warnings

Copy link
Contributor

@danolivo danolivo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks correct. Minor fixes should be addressed before the merge.

elog(LOG, "SPOCK: adjust spock.progress %d->%d to "
"remote_commit_ts='%s' "
"remote_commit_lsn=%llX remote_insert_lsn=%llX",
"remote_commit_lsn=%lX remote_insert_lsn=%lX",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both variants are incorrect. Conventional way: use the LSN_FORMAT_ARGS macros instead.

}

adjust_progress_info(origin_conn);
progress_entries_list = adjust_progress_info(origin_conn);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! But call:
progress_entries_list = adjust_progress_info(origin_conn);
should be done right before the ensure_replication_slot_snapshot().

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After fixing this, you may launch the following workflow on your branch: https://github.com/pgEdge/spock/actions/runs/21101567363
It fails now in 100% of cases. With this case, it should pass (about 99% or so).

- Refactor apply_worker_get_progress() to return only the timestamp needed. Return value instead of pointer to entire struct.
- Lock sooner in spock_group_resource_dump() because of getting the number of entries
- Properly handle progress updates after COPY operations in replication set data sync and avoid potential memory leak
- Address compiler warnings
@mason-sharp mason-sharp force-pushed the progress-track-minor-improvements branch from 679df29 to a78e2cf Compare February 3, 2026 02:18
origin_conn_repl = spock_connect_replica(sub->origin_if->dsn,
sub->name, "snap");

adjust_progress_info(origin_conn);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is it supposed to work?
I don't see here following spock_group_progress_update_list() ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants