Pglogical 复制集未按预期工作

Pglogical replication sets not working as expected

我正在尝试设置 pglogical 复制。我有一个 table,它在提供商服务器中有大约 4 行。

=========
employee_id |     visitor_email     | vistor_id |        date         |             message          
-------------+-----------------------+-----------+---------------------+--------------------------
       1 | roshan@gmail.com      |         1 | 2016-08-24 00:00:00 | This is the first test.
       2 | roshan@myrepublic.net |         2 | 2016-08-24 00:00:00 | This is the second test.
       3 | roshan@myrepublic.net |         3 | 2016-08-24 00:00:00 | This is the third test.
       4 | roshan@myrepublic.net |         4 | 2016-08-24 00:00:00 | This is the fourth test.
  ===============================

在创建上面提到的 table 之后。我在提供程序中创建了一个复制集。然后我配置了订阅者节点和订阅。理想情况下,我应该在我的订阅者中看到来自提供者 table 的 4 行,但我在订阅者中只看到 table 结构,而不是数据。如果我在提供程序 table 中添加一个新行,如下所示

INSERT INTO employees (employee_id, visitor_email, date, message) VALUES (5, 'roshan@myrepublic.net', current_date, 'This is the fifth test.'); 

现在,我可以在订阅者中看到最后添加的行 table。开头添加的所有其他 4 行仍然缺失。我在这里做错了什么?

是否意味着只考虑replication_sets创建后创建的数据?如何将 table 的全部内容添加到复制集。?

如有任何帮助,我们将不胜感激。?

此致, 穆罕默德·罗斯汉

您可以发出 resynchronise_table 命令来拉动所有内容。如您所见,所有后续插入都可以。

使用这个函数来做到这一点:

pglogical.alter_subscription_resynchronize_table(subscription_name name, relation regclass)

您也可以在初始同步期间通过 "synchronize_data":

有关详细信息,请参阅以下文档中的 2.3:

https://2ndquadrant.com/en/resources/pglogical/pglogical-docs/