matrix-org / synapse

Synapse: Matrix homeserver written in Python/Twisted.
https://matrix-org.github.io/synapse
Apache License 2.0
11.82k stars 2.13k forks source link

Add a Postgres `REPLICA IDENTITY` to tables that do not have an implicit one. This should allow use of Postgres logical replication. (take 2, now with no added deadlocks!) #16658

Closed reivilibre closed 11 months ago

reivilibre commented 11 months ago

Fixes: #16224 Supersedes: #16456, #16647

Base: develop

Original commit schedule, with full messages:

  1. Add `ALTER TABLE ... REPLICA IDENTITY ...` for individual tables \ We can't combine them into one file as it makes it likely to hit a deadlock if Synapse is running, as it only takes one other transaction to access two tables in a different order to the schema delta.
  2. Add notes
thinkwelltwd commented 11 months ago

Is there some background on why this commit got reverted? I've been waiting with bated breath for weeks on getting it committed.

DMRobertson commented 11 months ago

Sorry, I should have written something in https://github.com/matrix-org/synapse/commit/44377f5ac05ff4e95f440f5704805b87a37e3327. The answer is that this didn't cleanly apply in a staging deployment. I will add context to #16224 and reopen it.