Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ie10S-00017Q-IO for pgsql-hackers@arkaria.postgresql.org; Sun, 08 Dec 2019 18:10:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ie10P-0005Js-8s for pgsql-hackers@arkaria.postgresql.org; Sun, 08 Dec 2019 18:10:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ie10O-0005Jk-O7 for pgsql-hackers@lists.postgresql.org; Sun, 08 Dec 2019 18:10:05 +0000 Received: from mail-pj1-x1042.google.com ([2607:f8b0:4864:20::1042]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ie10H-000263-N3 for pgsql-hackers@postgresql.org; Sun, 08 Dec 2019 18:10:04 +0000 Received: by mail-pj1-x1042.google.com with SMTP id l4so4825280pjt.5 for ; Sun, 08 Dec 2019 10:09:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=6udOMU0hC3eczbIZeuzTUYViHOgIC93T1btPyxtU5uA=; b=Ri9Y5YGOLN/zYZLbIf7In65B8+451E5lg88g9Jd1aB9JnwO08ACy/l6xbw4OK8O4GQ vMuRkAlibj15wyhHnBmaoGmDeKfioLzLZxlRGMonwPyx7qh2JUv8X6lvbW5VtagzlQri xzWqdyqTh/+pYcloWHksO4enI4MRTgCsf0rss= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=6udOMU0hC3eczbIZeuzTUYViHOgIC93T1btPyxtU5uA=; b=TYP31OUtElYfqLgIsLHxr3AqMoBZhnNRDimyUDr/omz1J6MrJBvxTSPauKWY/aTPoC U0oyNBvtuJpMxyBRJfNtqddwA9Eb9MUez+OFCJQDBT3fwlI338FCB3mjCRjTRf1tWLjL IxODSEouFepMYBA5E+JgW8uWy9gznqpyboXcBVNL9D/ps6B1JI7RefEyrnpj0ih1b3Ht dxYcy+pk3GhUg8lSHgEUpOGN6lh71zT4ky38Gd/o4MFnDF+H4KMCA/rF5J04CYCgRJZa WpjfShjY/DAVyIWnu7aBHxFIJ1skA2iOQa/YhO/utkc+zeu1gUBRWB+deoO2SXDKQFo1 Sg7g== X-Gm-Message-State: APjAAAXUb79Ev49npanQQHqzjEtMczK5NTccB+hLMt7yiCo9M+Cl0Pw1 PKiif7BErgVHo54v/VF2ZES21Q== X-Google-Smtp-Source: APXvYqwYXQG1A7KHibOpgi1zafOrxX5LE+1GOZA0d4vw6fkpPfcOTxeXbSPmP072GJiL8CpVCi3JEg== X-Received: by 2002:a17:902:b609:: with SMTP id b9mr25100882pls.70.1575828595098; Sun, 08 Dec 2019 10:09:55 -0800 (PST) Received: from rfd.leadboat.com (108-233-125-46.lightspeed.sntcca.sbcglobal.net. [108.233.125.46]) by smtp.gmail.com with ESMTPSA id b65sm23218330pgc.18.2019.12.08.10.09.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Dec 2019 10:09:54 -0800 (PST) Date: Sun, 8 Dec 2019 10:09:51 -0800 From: Noah Misch To: Kyotaro Horiguchi Cc: robertmhaas@gmail.com, pgsql-hackers@postgresql.org, 9erthalion6@gmail.com, andrew.dunstan@2ndquadrant.com, hlinnaka@iki.fi, michael@paquier.xyz Subject: Re: [HACKERS] WAL logging problem in 9.4.3? Message-ID: <20191208180951.GA1694300@rfd.leadboat.com> References: <20191128.205620.2015649987051831334.horikyota.ntt@gmail.com> <20191128.213508.1108483203561250557.horikyota.ntt@gmail.com> <20191128222319.GA89611@gust.leadboat.com> <20191203.205146.1521643852457054060.horikyota.ntt@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191203.205146.1521643852457054060.horikyota.ntt@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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 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).