Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

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

Merged
reivilibre merged 4 commits into
developfrom
rei/replica_identities_individual
Dec 4, 2023
Merged

Conversation

@reivilibre
Copy link
Copy Markdown
Contributor

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

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.
Signed-off-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org>
@reivilibre reivilibre changed the title Add a Postgres REPLICA IDENTITY to tables that do not have an implicit one. This should allow use of Postgres logical replication. 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!) Nov 17, 2023
@reivilibre reivilibre marked this pull request as ready for review November 17, 2023 11:59
@reivilibre reivilibre requested a review from a team as a code owner November 17, 2023 11:59
Copy link
Copy Markdown
Member

@clokep clokep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you split some stuff into separate files. 😄

@reivilibre reivilibre merged commit 51e4e35 into develop Dec 4, 2023
@reivilibre reivilibre deleted the rei/replica_identities_individual branch December 4, 2023 14:57
DMRobertson pushed a commit that referenced this pull request Dec 5, 2023
This resolves a conflict between
#16658 and
#16652
and should unsad CI.
DMRobertson pushed a commit that referenced this pull request Dec 5, 2023
This reverts two commits:

    0bb8e41
    "Fix postgres schema after dropping old tables (#16730)"

and

    51e4e35
    "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)"

and also amends the changelog.
@thinkwelltwd
Copy link
Copy Markdown

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

@DMRobertson
Copy link
Copy Markdown
Contributor

Sorry, I should have written something in 44377f5. The answer is that this didn't cleanly apply in a staging deployment. I will add context to #16224 and reopen it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

All tables in Postgres should have a REPLICA IDENTITY available so that Postgres logical replication can be used

4 participants