Re: Proposal: "Causal reads" mode for load balancing reads without stale data

Поиск
Список
Период
Сортировка
От Thomas Munro
Тема Re: Proposal: "Causal reads" mode for load balancing reads without stale data
Дата
Msg-id CAEepm=2x4iF=ZuZdVmFtTs83gZzYpyjFd_X4ZFrjQiz4hxQqiQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Proposal: "Causal reads" mode for load balancing reads without stale data  (Thomas Munro <thomas.munro@enterprisedb.com>)
Ответы Re: Proposal: "Causal reads" mode for load balancing reads without stale data  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Thu, Mar 10, 2016 at 8:35 PM, Thomas Munro
<thomas.munro@enterprisedb.com> wrote:
> On Thu, Mar 10, 2016 at 12:35 PM, Thomas Munro
> <thomas.munro@enterprisedb.com> wrote:
>> I looked into COMMIT PREPARED replay feedback and realised that it
>> doesn't need any special handling beyond what is already in
>> xact_redo_commit. However, I see now that I *do* need to do something
>> when replaying PREPARE TRANSACTION, as you said.  Not for causal reads
>> though -- it doesn't care about an operation with no visible effect --
>> but for synchronous_commit = remote_apply.  I am thinking about how to
>> fix that.
>
> Ok, here is a new version with the following changes:
>
> 1.  If you PREPARE TRANSACTION with synchronous_commit = remote_apply,
> it just waits for remote WAL flush.  When you eventually
> COMMIT/ROLLBACK PREPARED, it waits for remote apply.  Also, the
> XACT_COMPLETION_SYNC_APPLY_FEEDBACK bit is now set in appropriate
> abort records, and then handled in recovery, just as for commits, so
> that ROLLBACK and ROLLBACK PREPARED return at the right time in
> remote_apply.
>
> 2.  I fixed a recently introduced stupid bug that caused causal reads
> to be broken when sync rep wasn't also configured (I had lost a change
> to stop SyncRepReleaseWaiters from leaving early, when I split up the
> patch... oops).
>
> 3.  I switched the pg_stat_replication.replay_lag accounting from
> milliseconds to microseconds.  The measured lag with fast machines on
> local networks can sometimes be sub-millisecond or very low numbers of
> milliseconds, so it's interesting to see more detail (depending on the
> primary's clock resolution).

The last patches I posted don't apply today due to changes in master,
so here's a freshly merged patch series.

--
Thomas Munro
http://www.enterprisedb.com

Вложения

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

Предыдущее
От: James Sewell
Дата:
Сообщение: Re: Parallel Aggregate
Следующее
От: Kouhei Kaigai
Дата:
Сообщение: Re: WIP: Upper planner pathification