Bucardo is unfortunately not very good at reporting its progress. This guide details the most important parts.
Note: This mostly assumes you're using Bucardo with onetimecopy=1
There are three major states of Bucardo we care about:
- Truncating a table on the new database
- Doing the initial copy from old to new database
- Live replication mode from old to new (aka “delta mode”)
Note that Bucardo does truncate-then-copy for each table during the initial copy (ie it will truncate one table and copy to it before moving to the next).
There are two ways to check Bucardo’s progress after starting the sync with bucardo start:
bucardo status <sync_name>
: This will print out some details, including a field called “Current state”. Some example values of "Current state":
- "No records found" - This happens when the sync is just starting up
- "DELETE xxxx" - This could mean either state 1 (truncating table xxxx) or state 2 (copying into table xxxx). Bucardo does not distinguish between the two, so if the table is large, it might show this
DELETE
for a long time. - "Good" - Copy is done! Now in delta mode (live replication)
- “Bad” - An error was encountered.
tail /var/log/bucardo/log.bucardo
- This is Bucardo’s main log file, which can be quite helpful if verbose logging is on (make sure to addloglevel=verbose
andverbose=1
to your/etc/bucardorc
. The log file will write a message when Bucardo starts and finishes the initial copy, and when it starts and finishes copying each table.
If things are unexpectedly taking too long, you can also check what’s currently happening on the Postgres side (new or old databases). Some useful queries:
select query, query_start from pg_stat_activity where usename = 'your_bucardo_username';
select * from pg_stat_progress_copy;
- check progress of the current COPY