-hi Lucas,

I faced these locks during adding a new sync to bucardo, too. During this step it helps a lot if no / less traffic is on the database.

Best,
Andreas

Am 17.04.2021 um 13:08 schrieb Lucas Possamai:
Anyone able to help with my previous email, please?

I've just tried the process again, and I got into the same outcome. The steps I followed are below:

---

 1. Created bucardo username on source and target dbs
 2. because I've done this before, I've done some cleanup before
    repeating the process
     1. bucardo remove sync test_sync
     2. bucardo remove dbgroup test_db_group
     3. bucardo remove relgroup test_db_group
     4. bucardo remove all tables
     5. bucardo remove all sequences
     6. bucardo remove db source_db_ec2
     7. bucardo remove target_db_rds
     8. AS POSTGRES
         1. drop schema bucardo cascade;
3.

    bucardo add db source_db_ec2 dbname=test_db
    host=pgsql-source.example.com <http://pgsql-source.example.com>
    user=bucardouser pass=password

4.

    bucardo add db target_db_rds dbname=test_db
    host=pgsql-target-rds.example.com
    <http://pgsql-target-rds.example.com> user=bucardo pass=password

5.

    bucardo add table public.* db=source_db_ec2 relgroup=test_db_group

6.

    bucardo add table junk.* db=source_db_ec2 relgroup=test_db_group

7.

    bucardo add sequence public.* db=source_db_ec2 relgroup=test_db_group

8.

    bucardo add sequence junk.* db=source_db_ec2 relgroup=test_db_group

9.

    bucardo add dbgroup test_db_group source_db_ec2:source
    target_db_rds:target

10.

    bucardo add sync test_sync relgroup=test_db_group
    dbs=test_db_group autokick=1

11.

    bucardo validate test_sync

12.

    bucardo start

When checking the status of the sync

Last good: Apr 17, 2021 10:43:25 (time to run: 1s)

Rows deleted/inserted: 0 / 0

Sync name: test_sync

Current state: Good

Source relgroup/database : test_db_group / source_db_ec2

Tables in sync : 209

Status : Active

Check time : None

Overdue time : 00:00:00

Expired time : 00:00:00

Stayalive/Kidsalive: Yes / Yes

Rebuild index: No

Autokick : Yes

Onetimecopy: No

Post-copy analyze: Yes

Last error::

======================================================================


... everything looks normal

Bucardo logs:
(371540) [Sat Apr 17 10:42:26 2021] MCP Active syncs: 1
(371540) [Sat Apr 17 10:42:26 2021] MCP Entering main loop
(371542) [Sat Apr 17 10:42:26 2021] VAC New VAC daemon. PID=371542
(371542) [Sat Apr 17 10:42:26 2021] VAC Connected to database "source_db_ec2" with backend PID of 81591
(371540) [Sat Apr 17 10:42:26 2021] MCP Created VAC 371542
(371544) [Sat Apr 17 10:42:26 2021] CTL New controller for sync "test_sync". Relgroup is "test_db_group", dbs is "test_db_group". PID=371544 (371544) [Sat Apr 17 10:42:26 2021] CTL   stayalive: 1 checksecs: 0 kicked: 1 (371544) [Sat Apr 17 10:42:26 2021] CTL   kidsalive: 1 onetimecopy: 0 lifetimesecs: 0 (NULL) maxkicks: 0 (371544) [Sat Apr 17 10:42:26 2021] CTL Database "source_db_ec2" backend PID: 81592 (371544) [Sat Apr 17 10:42:26 2021] CTL Database "target_db_rds" backend PID: 15208 (371540) [Sat Apr 17 10:42:26 2021] MCP Created controller 371544 for sync "test_sync". Kick is 1 (371546) [Sat Apr 17 10:42:27 2021] KID (test_sync) New kid, sync "test_sync" alive=1 Parent=371544 PID=371546 kicked=1

Then, my DB servers stop processing queries from the application. I couldn't find anything on the PG logs.

Can someone please tell me if the above steps are correct?

Cheers
---


---
Kind regards,
*
*
*Lucas Possamai*
lpossamai.me <http://lpossamai.me>


On Tue, 13 Apr 2021 at 10:31, Lucas Possamai <[email protected] <mailto:[email protected]>> wrote:

    Hi all,

    When executing the command below, my source db collapsed. Looked
    like lots of locks and waits were happening.

    bucardo add sync test_sync relgroup=test_db_group
    dbs=test_db_group autokick=0


    The steps I'm doing are:

      * PG DUMP the database from source
      * Create roles and apply database permissions to target
      * Import the Database dump to the target DB (RDS)
      * Enable session_replication_role on Target
      * Bucardo add source DB
      * Bucardo add target DB
      * bucardo add tables
          o bucardo add table public.* db=source_db relgroup=test_db_group
      * bucardo add sequences
          o bucardo add sequence public.* db=source_db
            relgroup=test_db_group
      * bucardo add dbgroup
          o bucardo add dbgroup test_db_group source_db:source
            target_db:target
      * bucardo add sync
          o bucardo add sync test_sync relgroup=test_db_group
            dbs=test_db_group autokick=0


    Are those locks expected when adding the sync on the source db?
    Any other recommendations?

    Source DB is PostgreSQL 9.2
    Target DB is PostgreSQL 12.4
    Bucardo version is: 5.6.0

    Cheers,
    ---
    Kind regards,
    *
    *
    *Lucas Possamai*
    lpossamai.me <http://lpossamai.me>


_______________________________________________
Bucardo-general mailing list
[email protected]
https://bucardo.or

_______________________________________________
Bucardo-general mailing list
[email protected]
https://bucardo.org/mailman/listinfo/bucardo-general

Reply via email to