Re: logical replication of truncate command with trigger causes Assert

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: logical replication of truncate command with trigger causes Assert
Дата
Msg-id 1254157.1623196736@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: logical replication of truncate command with trigger causes Assert  (Mark Dilger <mark.dilger@enterprisedb.com>)
Ответы Re: logical replication of truncate command with trigger causes Assert  (Amit Kapila <amit.kapila16@gmail.com>)
Список pgsql-hackers
Mark Dilger <mark.dilger@enterprisedb.com> writes:
> On Jun 8, 2021, at 3:55 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I suppose that either apply_dispatch or LogicalRepApplyLoop needs to
>> grow some more snapshot management logic, but I've not looked at that
>> code much, so I don't have an opinion on just where to add it.

> I was looking at those for other reasons prior to hitting this bug.

After looking at it a bit, I see a couple of options:

1. Just wrap the call of ExecuteTruncateGuts with
PushActiveSnapshot(GetTransactionSnapshot()) and PopActiveSnapshot().

2. Decide that we ought to ensure that a snapshot exists throughout
most of this code.  It's not entirely obvious to me that there is no
code path reachable from, say, apply_handle_truncate's collection of
relation OIDs that needs a snapshot.  If we went for that, I'd think
the right solution is to do PushActiveSnapshot right after each
ensure_transaction call, and then PopActiveSnapshot on the way out of
the respective subroutine.  We could then drop the snapshot management
calls that are currently associated with the executor state.

> My purpose was to figure out how to get the code to respect
> privileges.  Perhaps the solution to these two issues is related.
> I don't know yet.

Doesn't seem tremendously related.  But yeah, there is Stuff That
Is Missing in these code paths.

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: pg14b1 stuck in lazy_scan_prune/heap_page_prune of pg_statistic
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: array_cat anycompatible change is breaking xversion upgrade tests (v14 release notes)