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 1iZeMl-0007pr-Iv for pgsql-bugs@arkaria.postgresql.org; Tue, 26 Nov 2019 17:11: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 1iZeMi-0006QF-V8 for pgsql-bugs@arkaria.postgresql.org; Tue, 26 Nov 2019 17:11:04 +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 1iZeMi-0006Q7-IO for pgsql-bugs@lists.postgresql.org; Tue, 26 Nov 2019 17:11:04 +0000 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iZeMf-0000Xt-8U for pgsql-bugs@lists.postgresql.org; Tue, 26 Nov 2019 17:11:04 +0000 Received: by mail-qk1-x743.google.com with SMTP id i3so16746069qkk.9 for ; Tue, 26 Nov 2019 09:11:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=dTL6WF7WYBhY2tbwjn/VANEvgJcVJjbZQ1E1Gl/76nc=; b=hRXLepa2212GWna3bFyysknK3pnnSzt2bORXF1VbyN4LBKT36CHMYPFh5zP1wRWrAp aUJTZACf0RVGUKlPYlFbSlbguHOPZgNie44I0/zl+5sQ+FSkVWg1cE3bXSv7es5RyhON MkCqeM+eVMsJ/uxN9xOL/kJ3K0bgFoyRndAW2RxVfyLaxyvYWdk6ZYIz8aMEDEjLhRPP pd3+GWfHM5DmhH7+V7yGYPMl7OcaSoxRSsHwvQuYLiFu0IJY6WMs7Jr1c1AwtxXauEqf rkPTnNM0w+49c9vYDiO71fRn2vm5rj6aDRR2oyz9brAg0UA9SZm2A5OxtHskz1YBTVpy eZRw== 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:content-transfer-encoding :in-reply-to:user-agent; bh=dTL6WF7WYBhY2tbwjn/VANEvgJcVJjbZQ1E1Gl/76nc=; b=nmPihn/3hhNj9FtI9mi5PKpa++lvADrPmpsSH5v9Gp/6DLwt4kKAwsv8pPrcQrl5mQ i0gWApUKmxFI9fUDeZ802jI3l3eTToLVVglRFIp6E0WPSnxh88vG3yZ6Id0CGGSRjshk cxEdf3YmUkNnkZi7N0GOhoE4fc84C2eXBPlHqKszoo/9ZfUruMX8/eUf/o0xt+UukG8y v6dgMtFZ0xRg7TSjWL1wXke2/wQpN6wHKAu40/A3CF/J/wcq/tRie4t2SiK9/XX5yBqo uqRqInhd2XaBAFBXIukcX4z05pz1xry9mv/+x0JE/s51WVrc0gWknkKz1gr8oEliUIVO Mb9A== X-Gm-Message-State: APjAAAUMGet2RCwiYcRJR9P48F4/u0CIv6B+sAgmeu9m3i2KNnzDk1uB oeYnWy92p004FWmzweAfh4i/Kg== X-Google-Smtp-Source: APXvYqyMTJ+VmUjSE4PJv2h7JlCOJ8wrDQWxl9DSLQP5FadF5DiRWthJ0EwIgtJ0nZS8vrkZaP79mg== X-Received: by 2002:a05:620a:5f9:: with SMTP id z25mr18909279qkg.225.1574788259151; Tue, 26 Nov 2019 09:10:59 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id f6sm5393566qkk.12.2019.11.26.09.10.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2019 09:10:58 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id E9670300A50; Tue, 26 Nov 2019 14:10:54 -0300 (-03) Date: Tue, 26 Nov 2019 14:10:54 -0300 From: Alvaro Herrera To: Andres Freund Cc: Tomas Vondra , Andrey Salnikov , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16125: Crash of PostgreSQL's wal sender during logical replication Message-ID: <20191126171054.GB4161@alvherre.pgsql> References: <16125-a78dafa032d53f7e@postgresql.org> <20191118205816.5wne6hxedrm7zd5p@development> <20191119221732.pcqtxljac334zgb4@development> <20191119232849.qhtuhq4udrqrz4he@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191119232849.qhtuhq4udrqrz4he@alap3.anarazel.de> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Nov-19, Andres Freund wrote: > > > 2518:rmgr: Heap len (rec/tot): 2063/ 2063, tx: 1667601530, lsn: 25EE/D66F11E8, prev 25EE/D66F0CB0, desc: INSERT off 4, blkref #0: rel 1663/13018/88964795 blk 3125 > > > 2520:rmgr: Btree len (rec/tot): 64/ 64, tx: 1667601530, lsn: 25EE/D66F1A38, prev 25EE/D66F19F8, desc: INSERT_LEAF off 256, blkref #0: rel 1663/13018/88964797 blk 15840 > > > 2522:rmgr: Heap len (rec/tot): 1341/ 9385, tx: 1667601530, lsn: 25EE/D66F2118, prev 25EE/D66F1A78, desc: INSERT off 7, blkref #0: rel 1663/13018/88964795 blk 3139 FPW > > > 2524:rmgr: Btree len (rec/tot): 64/ 64, tx: 1667601530, lsn: 25EE/D66F54C8, prev 25EE/D66F45E0, desc: INSERT_LEAF off 257, blkref #0: rel 1663/13018/88964797 blk 15840 > > > 2525:rmgr: Heap len (rec/tot): 1671/ 1671, tx: 1667601530, lsn: 25EE/D66F5508, prev 25EE/D66F54C8, desc: INSERT off 2, blkref #0: rel 1663/13018/88964792 blk 18475 > > > 2527:rmgr: Btree len (rec/tot): 64/ 64, tx: 1667601530, lsn: 25EE/D66F6738, prev 25EE/D66F5B90, desc: INSERT_LEAF off 140, blkref #0: rel 1663/13018/88964798 blk 2058 > > > 2530:rmgr: Btree len (rec/tot): 96/ 96, tx: 1667601530, lsn: 25EE/D66F7E40, prev 25EE/D66F7E10, desc: INSERT_LEAF off 28, blkref #0: rel 1663/13018/88964799 blk 5076 > > > 2531:rmgr: Btree len (rec/tot): 80/ 80, tx: 1667601530, lsn: 25EE/D66F7EA0, prev 25EE/D66F7E40, desc: INSERT_LEAF off 88, blkref #0: rel 1663/13018/88964800 blk 3412 > > > 2532:rmgr: Heap len (rec/tot): 54/ 54, tx: 1667601530, lsn: 25EE/D66F7EF0, prev 25EE/D66F7EA0, desc: DELETE off 2 , blkref #0: rel 1663/13018/88964792 blk 18475 > > > 2533:rmgr: Heap len (rec/tot): 54/ 54, tx: 1667601530, lsn: 25EE/D66F7F28, prev 25EE/D66F7EF0, desc: DELETE off 4 , blkref #0: rel 1663/13018/88964795 blk 3125 > > > 2534:rmgr: Heap len (rec/tot): 54/ 54, tx: 1667601530, lsn: 25EE/D66F7F60, prev 25EE/D66F7F28, desc: DELETE off 7 , blkref #0: rel 1663/13018/88964795 blk 3139 > > > 56346:rmgr: Heap len (rec/tot): 378/ 8198, tx: 1667601537, lsn: 25EE/D6DE33B0, prev 25EE/D6DE1628, desc: DELETE off 6 KEYS_UPDATED , blkref #0: rel 1663/13018/88964815 blk 1938695 FPW > > > > 56347:rmgr: Heap len (rec/tot): 54/ 54, tx: 1667601538, lsn: 25EE/D6DE53D0, prev 25EE/D6DE33B0, desc: LOCK off 5: xid 1667601538: flags 0 LOCK_ONLY EXCL_LOCK , blkref #0: rel 1663/13018/88964792 blk 18460 > > > 56348:rmgr: Heap len (rec/tot): 6563/ 6563, tx: 1667601538, lsn: 25EE/D6DE5408, prev 25EE/D6DE53D0, desc: UPDATE off 5 xmax 1667601538 ; new off 3 xmax 0, blkref #0: rel 1663/13018/88964792 blk 18499, blkref #1: rel 1663/13018/88964792 blk 18460 > > > 56349:rmgr: Btree len (rec/tot): 64/ 64, tx: 1667601538, lsn: 25EE/D6DE6DC8, prev 25EE/D6DE5408, desc: INSERT_LEAF off 140, blkref #0: rel 1663/13018/88964798 blk 2058 > > > 56350:rmgr: Btree len (rec/tot): 96/ 96, tx: 1667601538, lsn: 25EE/D6DE6E08, prev 25EE/D6DE6DC8, desc: INSERT_LEAF off 28, blkref #0: rel 1663/13018/88964799 blk 5076 > > > 56351:rmgr: Btree len (rec/tot): 80/ 80, tx: 1667601538, lsn: 25EE/D6DE6E68, prev 25EE/D6DE6E08, desc: INSERT_LEAF off 88, blkref #0: rel 1663/13018/88964800 blk 3412 > > > 56352:rmgr: Transaction len (rec/tot): 66/ 66, tx: 1667601527, lsn: 25EE/D6DE6EB8, prev 25EE/D6DE6E68, desc: COMMIT 2019-11-16 03:01:39.326201 UTC; subxacts: 1667601528 1667601530 1667601537 1667601538 > > > So, this DELETE change triggers the issue. If I understand it correctly, > > that means the transaction locked the tuple and then deleted it. But I > > don't see any record about the lock. > > Hm. I don't think it necessarily means that. compute_new_xmax_infomask(), when > called from heap_delete(), will e.g. set HEAP_KEYS_UPDATED when > > if (old_infomask & HEAP_XMAX_INVALID) > > is true. Which is the most common case. I don't understand what you guys are saying. There's a DELETE at 25EE/D6DE33B0 (line 56346) which seems to be the one causing trouble. Right? There's also a LOCK+UPDATE sequence just below that, which is unrelated (different rel). Are you saying that one of them is toast and the other is its main heap? It would be useful to know more about the rels. > I actually find it *more* > curious to *not* see that for a delete. I've not traced fully through > it, yet. > Alvaro, it's not clear to me whether the the multixact codepaths in > compute_new_xmax_infomask() actually work as expected for deletes. Are you saying that the three *prior* deletes (lines 2532-2534) are strange because they lack the KEYS_UPDATED bit? (Note these are all for different rels). I'm not sure what to do about this report at this point. Notwithstanding my general failure to focus on anything too complex given my surrounding social context. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services