Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZCEGd-00046B-6b for pgsql-bugs@arkaria.postgresql.org; Mon, 06 Jul 2015 21:49:35 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZCEGc-0008J3-AW for pgsql-bugs@arkaria.postgresql.org; Mon, 06 Jul 2015 21:49:34 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZCEFm-0007cW-Bm for pgsql-bugs@postgresql.org; Mon, 06 Jul 2015 21:48:42 +0000 Received: from smtp5-g21.free.fr ([2a01:e0c:1:1599::14]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZCEFf-0001DE-TS for pgsql-bugs@postgresql.org; Mon, 06 Jul 2015 21:48:41 +0000 Received: from zimbra72-e12.priv.proxad.net (unknown [172.20.243.222]) by smtp5-g21.free.fr (Postfix) with ESMTP id AB22BD4805C; Mon, 6 Jul 2015 23:48:33 +0200 (CEST) Date: Mon, 6 Jul 2015 23:48:33 +0200 (CEST) From: olivier.gosseaume@free.fr To: Andres Freund Cc: pgsql-bugs@postgresql.org Message-ID: <1803533379.17196016.1436219313665.JavaMail.root@zimbra72-e12.priv.proxad.net> In-Reply-To: <20150706212332.GG340@alap3.anarazel.de> Subject: Re: BUG #13484: Performance problem with logical decoding MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [82.225.179.15] X-Mailer: Zimbra 7.2.0-GA2598 (ZimbraWebClient - FF3.0 (Win)/7.2.0-GA2598) X-Authenticated-User: olivier.gosseaume@free.fr X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org >> So the problem I'm seing is that there's a typo/bug in >> ReorderBufferSerializeTXN(). It closes the filehandle after each >> individual spilled file instead of keeping it open for up to 16MB of >> WAL. On linux that doesn't hurt particularly much, the file isn't >> flushed to disk. Which presumably is why we haven't noticed. But if >> windows does that differently... >Hrmpf, just sent the last part of this message to a different thread. >The fix is just to change > if (fd == -1 || XLByteInSeg(change->lsn, curOpenSegNo)) >into > if (fd == -1 || !XLByteInSeg(change->lsn, curOpenSegNo)) > >the bug doesn't have any correctness implications afaics, just >performance. We read all the spilled files till the end, so even change >spilled to the wrong segment gets picked up. Great. I will try to rebuild on Windows with this patch and let you know Olivier -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs