8000 Use our SQLite catalogs for the pgcopydb sentinel table. by dimitri · Pull Request #601 · dimitri/pgcopydb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Use our SQLite catalogs for the pgcopydb sentinel table. #601

8000
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 2, 2024

Conversation

dimitri
Copy link
Owner
@dimitri dimitri commented Dec 27, 2023

The main use-case for the sentinel table is to communicate progress made by
the three independent worker processes for stream, transform, and replay.
It is also needed to communicate new startpos, endpos and apply values with
those processes from another pgcopydb (interactive) command, a process
that's not in the process tree.

This was previously solved by creating and using a pgcopydb.sentinel table
on the source database. Now that we have a SQLite database internal to the
pgcopydb run, we can use that instead.

@dimitri dimitri added the enhancement New feature or request label Dec 27, 2023
@dimitri dimitri added this to the v0.15 milestone Dec 27, 2023
@dimitri dimitri self-assigned this Dec 27, 2023
@dimitri dimitri force-pushed the feature/use-sqlite-for-sentinel branch 3 times, most recently from 9d4f142 to ea8f6f7 Compare December 27, 2023 23:04
The main use-case for the sentinel table is to communicate progress made by
the three independent worker processes for stream, transform, and replay.
It is also needed to communicate new startpos, endpos and apply values with
those processes from another pgcopydb (interactive) command, a process
that's not in the process tree.

This was previously solved by creating and using a pgcopydb.sentinel table
on the source database. Now that we have a SQLite database internal to the
pgcopydb run, we can use that instead.
In particular, we need to share a common directory mount point in the test
and inject containers, because the inject container is setting the endpos
for the test container where the main tests are running.

For that, in my testing the best option is to use a host directory. This
also makes it very easy to then use sqlite3 and inspect what's going on from
the outside.
@dimitri dimitri force-pushed the feature/use-sqlite-for-sentinel branch from 2dc02db to d16ec8b Compare January 1, 2024 18:28
@dimitri dimitri merged commit 97f18bc into main Jan 2, 2024
@dimitri dimitri deleted the feature/use-sqlite-for-sentinel branch January 2, 2024 09:48
arajkumar added a commit to arajkumar/pgcopydb that referenced this pull request May 13, 2024
We used to track last sentinel sync time and update sentinel for every
1 sec. However, the change[1] which adopted sqlite to track sentinel
  removed the last updated time assignment[2] leading to sentinel write
for every commit message causes replay slowness by almost 10 times.

Solution: Track last sentinel update time

[1] dimitri#601
[2] https://github.com/dimitri/pgcopydb/pull/601/files#diff-481cd5fcd15742c022e2a18916c7a508cc7c7d46c264084daab85200e1b10004L477

Signed-off-by: Arunprasad Rajkumar <ar.arunprasad@gmail.com>
dimitri pushed a commit that referenced this pull request May 13, 2024
We used to track last sentinel sync time and update sentinel for every
1 sec. However, the change[1] which adopted sqlite to track sentinel
  removed the last updated time assignment[2] leading to sentinel write
for every commit message causes replay slowness by almost 10 times.

Solution: Track last sentinel update time

[1] #601
[2] https://github.com/dimitri/pgcopydb/pull/601/files#diff-481cd5fcd15742c022e2a18916c7a508cc7c7d46c264084daab85200e1b10004L477

Signed-off-by: Arunprasad Rajkumar <ar.arunprasad@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0