RFC: Deadlock detector hooks for victim selection and edge injection

From: Craig Ringer <craig(dot)ringer(at)enterprisedb(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: RFC: Deadlock detector hooks for victim selection and edge injection
Date: 2020-12-07 03:54:56
Message-ID: CAGRY4nxb9m03t8yjg-n41ki8fZ8yW-gSCVVEhqNZ6=6=77HxNg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi folks

Now that we're well on track for streaming logical decoding, it's becoming
more practical to look at parallel logical apply.

The support for this in pglogical3 benefits from a deadlock detector hook.
It was added in the optional patched postgres pglogical can use to enable
various extra features that weren't possible without core changes, but
isn't present in community postgres yet.

I'd like to add it.

The main benefit is that it lets the logical replication support tell the
deadlock detector that it should prefer to kill the victim whose txn has a
higher upstream commit lsn. That helps encourage parallel logical apply to
make progress in the face of deadlocks between concurrent txns.

Any in-principle objections?

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2020-12-07 04:13:02 RFC: Deadlock detector hooks for edge injection
Previous Message Amit Kapila 2020-12-07 03:51:29 Re: Single transaction in the tablesync worker?