Re: [HACKERS] WAL logging problem in 9.4.3?

From: Noah Misch <noah(at)leadboat(dot)com>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: robertmhaas(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org, 9erthalion6(at)gmail(dot)com, andrew(dot)dunstan(at)2ndquadrant(dot)com, hlinnaka(at)iki(dot)fi, michael(at)paquier(dot)xyz
Subject: Re: [HACKERS] WAL logging problem in 9.4.3?
Date: 2019-12-08 18:09:51
Message-ID: 20191208180951.GA1694300@rfd.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I reviewed your latest code, and it's nearly complete. mdimmedsync() syncs
only "active segments" (as defined in md.c), but smgrDoPendingSyncs() must
sync active and inactive segments. This matters when mdtruncate() truncated
the relation after the last checkpoint, causing active segments to become
inactive. In such cases, syncs of the inactive segments will have been queued
for execution during the next checkpoint. Since we skipped the
XLOG_SMGR_TRUNCATE record, we must complete those syncs before commit. Let's
just modify smgrimmedsync() to always sync active and inactive segments;
that's fine to do in other smgrimmedsync() callers, even though they operate
on relations that can't have inactive segments.

On Tue, Dec 03, 2019 at 08:51:46PM +0900, Kyotaro Horiguchi wrote:
> At Thu, 28 Nov 2019 17:23:19 -0500, Noah Misch <noah(at)leadboat(dot)com> wrote in
> > On Thu, Nov 28, 2019 at 09:35:08PM +0900, Kyotaro Horiguchi wrote:
> > > I measured the performance with the latest patch set.
> > >
> > > > 1. Determine $DDL_COUNT, a number of DDL transactions that take about one
> > > > minute when done via syncs.
> > > > 2. Start "pgbench -rP1 --progress-timestamp -T180 -c10 -j10".
> > > > 3. Wait 10s.
> > > > 4. Start one DDL backend that runs $DDL_COUNT transactions.
> > > > 5. Save DDL start timestamp, DDL end timestamp, and pgbench output.

> wal_buffers | 512

This value (4 MiB) is lower than a tuned production system would have. In
future benchmarks (if any) use wal_buffers=2048 (16 MiB).

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Janes 2019-12-08 18:23:57 disable only nonparallel seq scan.
Previous Message Tom Lane 2019-12-08 16:57:46 Re: Windows buildfarm members vs. new async-notify isolation test