Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k37r9-0002P5-Sb for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Aug 2020 01:04:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k37r8-00057o-QY for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Aug 2020 01:04:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k37r8-00057h-An for pgsql-hackers@lists.postgresql.org; Wed, 05 Aug 2020 01:04:34 +0000 Received: from mail-il1-x142.google.com ([2607:f8b0:4864:20::142]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1k37r5-0003d9-Iz for pgsql-hackers@postgresql.org; Wed, 05 Aug 2020 01:04:33 +0000 Received: by mail-il1-x142.google.com with SMTP id e16so1247427ilc.12 for ; Tue, 04 Aug 2020 18:04:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=CamBME/NLjJXEQFsLpQHKd0pYyiPeaA1wiQNMXbgk9E=; b=OiKiF+a6nisLJNdiP9HgS/mZnvCztdwcB5vpm1doyZJSRzsD2fLb8t/IcM35+iVDGH Mp/9fHAEFsGVeysuCrs3X78+7Q6Svgi8jx5WgLktXXWhvyM3DI86NzjN/7eXnW2PnPzZ asM5MMERa+5yBMccBKJk/pSTXnrHv+KFkOtG3kRJI/8XwRJcLOUQF+/192igtDa+YC89 5TmapEFG1ds9E27TjHddU0E7FftOvVcTjt4N572I8svLPDMk0r+/FxtO7AHk3rEVAlLl ETePMRx3r+orbEEFFfkm+oeMrNRMEtpmhHkpc1Z1+Cgn3RnEBc2iefpud4VxF9wrwJSS TOVg== 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=CamBME/NLjJXEQFsLpQHKd0pYyiPeaA1wiQNMXbgk9E=; b=n5uHwkZvac202xYz0VNqO9AqlZRxPV7MnaKfARsM7smMD08+2WpTiSlra3t2lRANfV MMViZIPpvw9kuKhnu6xZ4AXaOlz9U4uQggG4RbXveq3HR4yieqGg44kyO7IyvjgNvfM+ YASI1AJwG7eYuWgvLCf+tFxQatE0qXeiC9vD8MPfAV19wD4c3r30drMmRh/6+Eb/sNdY yz3pTEuuVTU+ZXaxjhfAXmLznUdZAG6mS2k4En1d+OneH6RTCWEJpRiGev4mK7RvA9r5 W9m58EC7RNa/HgucpfBhR0qFipo6fABgqb30CSpYXbX+xCL1sU1GhbO+Q4R6Ag+fcBtn Z8jw== X-Gm-Message-State: AOAM532pS6YKvtZmJGr4GMAnVqhcyWECx7L4b9kcVDXIpq16KlvZDenz iUtZKGPrhvm4UfdQGSp0yS5P6A== X-Google-Smtp-Source: ABdhPJxuOJ7WQAmvJv8/CvEff/P8IaZiCKX217QatGrYMWQrf3y9T81WfPgq+vkQNYYibohJqc6AFA== X-Received: by 2002:a92:790d:: with SMTP id u13mr1400112ilc.26.1596589470702; Tue, 04 Aug 2020 18:04:30 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id m74sm361192ill.3.2020.08.04.18.04.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Aug 2020 18:04:29 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id C125980015E; Tue, 4 Aug 2020 20:04:28 -0500 (CDT) Date: Tue, 4 Aug 2020 20:04:28 -0500 From: Justin Pryzby To: Amit Langote Cc: pgsql-hackers@postgresql.org, Robert Haas Subject: Re: FailedAssertion("pd_idx == pinfo->nparts", File: "execPartition.c", Line: 1689) Message-ID: <20200805010428.GY28072@telsasoft.com> References: <20200802181131.GA27754@telsasoft.com> <20200803161133.GA21372@telsasoft.com> <20200804151116.GP28072@telsasoft.com> <20200805003218.GX28072@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, Aug 05, 2020 at 09:53:44AM +0900, Amit Langote wrote: > On Wed, Aug 5, 2020 at 9:52 AM Amit Langote wrote: > > On Wed, Aug 5, 2020 at 9:32 AM Justin Pryzby wrote: > > > On Wed, Aug 05, 2020 at 09:26:20AM +0900, Amit Langote wrote: > > > > On Wed, Aug 5, 2020 at 12:11 AM Justin Pryzby wrote: > > > > > > > > > > On Tue, Aug 04, 2020 at 08:12:10PM +0900, Amit Langote wrote: > > > > > > It may be this commit that went into PG 12 that is causing the problem: > > > > > > > > > > Thanks for digging into this. > > > > > > > > > > > to account for partitions that were pruned by the planner for which we > > > > > > decided to put 0 into relid_map, but it only considered the case where > > > > > > the number of partitions doesn't change since the plan was created. > > > > > > The crash reported here is in the other case where the concurrently > > > > > > added partitions cause the execution-time PartitionDesc to have more > > > > > > partitions than the one that PartitionedRelPruneInfo is based on. > > > > > > > > > > Is there anything else needed to check that my crash matches your analysis ? > > > > > > > > If you can spot a 0 in the output of the following, then yes. > > > > > > > > (gdb) p *pinfo->relid_map@pinfo->nparts > > > > > > I guess you knew that an earlier message has just that. Thanks. > > > https://www.postgresql.org/message-id/20200803161133.GA21372@telsasoft.com > > > > Yeah, you showed: > > > > (gdb) p *pinfo->relid_map@414 > > > > And there is indeed a 0 in there, but I wasn't sure if it was actually > > in the array or a stray zero due to forcing gdb to show beyond the > > array bound. Does pinfo->nparts match 414? Yes. I typed 414 manually since the the array lengths were suspect. (gdb) p pinfo->nparts $1 = 414 (gdb) set print elements 0 (gdb) p *pinfo->relid_map@pinfo->nparts $3 = {22652203, 22652104, 22651920, 22651654, 22647359, 22645269, 22644012, 22639600, 22638852, 22621975, 22615355, 22615256, 22615069, 22610573, 22606503, 22606404, 22600237, 22600131, 22596610, 22595013, 22594914, 22594725, 22594464, 22589317, 22589216, 22587504, 22582570, 22580264, 22577047, 22576948, 22576763, 22576656, 22574077, 22570911, 22570812, 22564524, 22564113, 22558519, 22557080, 22556981, 22556793, 22555205, 22550680, 22550579, 22548884, 22543899, 22540822, 22536665, 22536566, 22536377, 22535133, 22528876, 22527780, 22526065, 22521131, 22517878, 22513674, 22513575, 22513405, 22513288, 22507520, 22504728, 22504629, 22493699, 22466016, 22458641, 22457551, 22457421, 22457264, 22452879, 22449864, 22449765, 22443560, 22442952, 22436193, 22434644, 22434469, 22434352, 22430792, 22426903, 22426804, 22420732, 22420025, 22413050, 22411963, 22411864, 22411675, 22407652, 22404156, 22404049, 22397550, 22394622, 22390035, 22389936, 22389752, 22388386, 22383211, 22382115, 22381934, 22375210, 22370297, 22367878, 22367779, 22367586, 22362556, 22359928, 22358236, 22353374, 22348704, 22345692, 22345593, 22345399, 22341347, 22336809, 22336709, 22325812, 22292836, 22287756, 22287657, 22287466, 22283194, 22278659, 22278560, 22272041, 22269121, 22264424, 22264325, 22264135, 22260102, 22255418, 22254818, 22248841, 22245824, 22241490, 22241391, 22241210, 22240354, 22236224, 22235123, 22234060, 22228744, 22228345, 22228033, 22222528, 22222429, 22222330, 22222144, 22222045, 22218408, 22215986, 22215887, 22209311, 22209212, 22207919, 22205203, 22203385, 22203298, 22203211, 22203124, 22202954, 22202859, 22202772, 22201869, 22200438, 22197706, 22195027, 22194932, 22194834, 22191208, 22188412, 22187029, 22182238, 22182134, 22182030, 22181849, 22181737, 22181107, 22175811, 22175710, 22169859, 22169604, 22159266, 22158131, 22158021, 22157824, 22153348, 22153236, 22147308, 22146736, 22143778, 22143599, 22143471, 22138702, 22138590, 22132612, 22132513, 22132271, 22132172, 22131987, 21935599, 21932664, 21927997, 21925823, 21885889, 21862973, 21859854, 21859671, 21858869, 21853440, 21851884, 21845405, 21842901, 21837523, 21837413, 21837209, 21832347, 21829359, 21827652, 21822602, 21816150, 21805995, 21805812, 21805235, 21798914, 21798026, 21791895, 21791124, 21783854, 21783744, 21783540, 21780568, 21774797, 21774687, 21768326, 21764063, 21759627, 21759517, 21759311, 21755697, 21751690, 21751156, 21744906, 21738543, 21736176, 21735992, 21735769, 21727603, 21725956, 21716432, 21678682, 21670968, 21670858, 21670665, 21669342, 21661932, 21661822, 21655311, 21650838, 21646721, 21646611, 21646409, 21640984, 21637816, 21637706, 21631061, 21622723, 21621459, 21621320, 21621148, 21612902, 21612790, 21606170, 21602265, 21597910, 21597800, 21597605, 21592489, 21589415, 21589305, 21582910, 21578017, 21576758, 21576648, 21572692, 21566633, 21566521, 21560127, 21560017, 21553910, 21553800, 21553613, 21553495, 21549102, 21548992, 21542759, 21540922, 21532093, 21531983, 21531786, 21531676, 21531264, 21531154, 21525290, 21524817, 21519470, 21519360, 21519165, 21516571, 21514269, 21514159, 21508389, 21508138, 21508028, 21507830, 21503457, 21502484, 21496897, 21494287, 21493722, 21493527, 21491807, 21488530, 21486122, 21485766, 21485603, 21485383, 21481969, 21481672, 21476245, 21472576, 21468851, 21468741, 21468546, 21467832, 21460086, 21425406, 21420632, 21420506, 21419974, 21417830, 21417365, 21408677, 21401314, 21400808, 21399725, 21399113, 21393312, 21393202, 21387393, 21384625, 21384361, 21384172, 21384054, 21379960, 21374013, 21365760, 21361813, 21361703, 21361504, 21358333, 21358220, 21352848, 21348896, 21348484, 21343591, 21337675, 21337472, 21331017, 21330907, 21325895, 21325785, 21325675, 21325565, 21325370, 21319929, 21316068, 21315958, 21312609, 21284187, 21262186, 21258549, 21258439, 21258279, 21258131, 21254759, 21251782, 21251094, 21250984, 21250874, 21250764, 21244302, 21239067, 21238951, 21238831, 21236783, 21235605, 21230205, 21166173, 21151836, 21151726, 21151608, 21151498, 21151388, 21151278, 21151168, 21151055, 2576248, 2576255, 2576262, 2576269, 2576276, 21456497, 22064128, 0} -- Justin