2

Postgres documentation states the following regarding pg_replication_slots.active: True if this slot is currently actively being used.

What does this actually imply for a false value?

For example, will the WAL still stick around if the value is false? Can I then set to true and it will continue to replicate from where it left off?

Awesome-o
  • 2,002
  • 1
  • 26
  • 38

2 Answers2

2

From all of my personal exploration it appears that even with an active=False replication slot:

  • The WAL is still pinned and will stick around even if the replication slot is active=False.
  • It's not possible to explicitly set active to True.
  • Deactivation general occurs because the follower had some issue which made it fail to safely read from the WAL, replicate, and move the LSN pointer.
  • Restarting the follower, assuming it then succeeds in safely replicating, will generally fix the issue, and the slot will automatically change to active=True.
Awesome-o
  • 2,002
  • 1
  • 26
  • 38
1

In my case I was using AWS and because I had automated backups turned off the wal_level was set to minimal and I couldn't bump up the max_replication_slots (even though it looked like I could...). I had to create a new subscriber DB instance and then it worked.

Sabrina Leggett
  • 9,079
  • 7
  • 47
  • 50