Azure postgreSQL single server publisher to subscriber replication new slot not getting active.

Veera 240 Reputation points
2024-02-01T02:13:22.54+00:00

max_logical_replication_workers 4 max_replication_slots 30 max_wal_senders from 30 max_worker_processes 8 subscriber(Azure vm with postgreSQL )

max_logical_replication_workers 12 max_replication_slots 30 max_wal_senders from 30 max_worker_processes 30 Below are the error messages we got in subscriber side. 024-01-22 10:54:00.713 +08 [20508] WARNING: out of logical replication worker slots 2024-01-22 10:54:00.713 +08 [20508] HINT: You might need to increase max_logical_replication_workers. Also ERROR: duplicate key value violates unique constraint "insdet_pk" please guide me with more details, how to resolve the issue, Thanks Veera.

Azure Database for PostgreSQL
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Alicja Kucharczyk 180 Reputation points Microsoft Employee
    2024-02-05T12:57:36.35+00:00

    Hi Veera, the errors you are seeing suggest that you have some data on your target server that are in conflict with data on your source, meaning that you probably tried to create the logical replication before. Please do not increase any worker numbers as this will not help, you should stop the replication first, then truncate the data from the target database or remove the database entirely and recreate just schema (without data). Please also make sure that the user you are using for replication on the source server side is able to read all the data you are trying to replicate, if not grant appropriate permissions

    1 person found this answer helpful.
    0 comments No comments

  2. ShaktiSingh-MSFT 13,346 Reputation points Microsoft Employee
    2024-02-01T08:31:30.0733333+00:00

    Hi Veera •,

    Welcome to Microsoft Q&A forum.

    As I understand, Azure postgreSQL single server publisher to subscriber replication new slot not getting active.

    From the error details mentioned in the question, it seems there could be a conflict situation as mentioned in the below link.

    https://www.postgresql.org/docs/current/logical-replication-conflicts.html

    Other related links:

    https://stackoverflow.com/questions/4448340/postgresql-duplicate-key-violates-unique-constraint

    Please check if this helped.

    If not, we will further investigate.

    Thanks

    0 comments No comments

  3. Veera 240 Reputation points
    2024-02-01T08:47:20.92+00:00

    Hi ShaktiSingh, Thank you for your response and time, we also see this below error when configuring the new slot. could you please give some refence link for this error and how to fix it. 2024-01-22 10:54:00.713 +08 [20508] WARNING: out of logical replication worker slots 2024-01-22 10:54:00.713 +08 [20508] HINT: You might need to increase max_logical_replication_workers. 2024-01-22 10:54:01.109 +08 [21892] WARNING: out of logical replication worker slots 2024-01-22 10:54:01.109 +08 [21892] HINT: You might need to increase max_logical_replication_workers. Thanks & Regards, Veera.

    0 comments No comments

  4. ShaktiSingh-MSFT 13,346 Reputation points Microsoft Employee
    2024-02-06T07:23:39.9433333+00:00

    Hi Veera •,

    Please refer to the answer by Alicja Kucharczyk • which states that:

    the errors you are seeing suggest that you have some data on your target server that are in conflict with data on your source, meaning that you probably tried to create the logical replication before. Please do not increase any worker numbers as this will not help, you should stop the replication first, then truncate the data from the target database or remove the database entirely and recreate just schema (without data). Please also make sure that the user you are using for replication on the source server side is able to read all the data you are trying to replicate, if not grant appropriate permissions

    Let us know if you have further queries. Thanks

    0 comments No comments