docs.timescale.com-content icon indicating copy to clipboard operation
docs.timescale.com-content copied to clipboard

Docs: Replication not suitable for Postgres 12

Open alx696 opened this issue 3 years ago • 2 comments

Relevant system information:

  • OS: Ubuntu 18.04
  • PostgreSQL version : 12
  • TimescaleDB version (output of \dx in psql): 1.7
  • Installation method: apt install

Describe the bug Replication Docs not suitable for Postgres 12. Three problem:

  1. PostgreSQL 12 comes with major changes to replication implementation and configuration such as replacement of recovery.conf and the conversion of recovery.conf parameters to normal PostgreSQL configuration parameters, making it much easier to configure cluster replication.
  2. postgresql.conf settings listen_address was wrong, listen_addresses is right.
  3. With the docs, standby server can not start.

To Reproduce Steps to reproduce the behavior:

  1. With Replication Docs
  2. sudo apt install -y timescaledb-postgresql-12
  3. ...

Expected behavior Replication works.

Actual behavior standby server can not start.

Additional context PostgreSQL 12 just need to step:

  1. settings pg_hba.conf.
  2. pg_basebackup master database.

With this docs, I have run a Streaming Replication successful.

Setup Streaming Replication with Docker

alx696 avatar Aug 31 '20 10:08 alx696

Not sure the issue is the same I got, but the tutorial works only if no changes happen between replication_slot creation time and first replica connection.

On a running installation this can be overcome by using a second parameter to the replication slot creation statement.

Suggested solution

SELECT * FROM pg_create_physical_replication_slot('replica_1_slot');

should be changed to:

SELECT * FROM pg_create_physical_replication_slot('replica_1_slot', immediately_reserve => true);

So doing the master will start immediately to collect WAL files and they will be made available to the replica.

Proposed change in docs

I would suggest to change the tutorial at paragraph "Create Replication Slots" (not hyperlinked) to use this more broad approach to setting up replication. The only warning is that the master WAL will start growing since command execution instead of first replica connection.

Hope this helps.

steppo40 avatar Nov 12 '20 08:11 steppo40

cc @ryanbooz

solugebefola avatar Nov 19 '20 02:11 solugebefola