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 1k3tsu-0000Tu-KT for pgsql-hackers@arkaria.postgresql.org; Fri, 07 Aug 2020 04:21: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 1k3tst-0000lj-8a for pgsql-hackers@arkaria.postgresql.org; Fri, 07 Aug 2020 04:21:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k3tst-0000lS-1l for pgsql-hackers@lists.postgresql.org; Fri, 07 Aug 2020 04:21:35 +0000 Received: from mail-il1-x141.google.com ([2607:f8b0:4864:20::141]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1k3tsm-0001Bm-I3 for pgsql-hackers@postgresql.org; Fri, 07 Aug 2020 04:21:34 +0000 Received: by mail-il1-x141.google.com with SMTP id c16so713208ils.8 for ; Thu, 06 Aug 2020 21:21:28 -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=ZXfkq+xA6C3WnM9N4loU138zx+XBTD7l1V9xxCTfDt4=; b=Xa2fD90Bk6UhS0eBusMCFVDUmQQ3rr/qFqLOKHDAEjja0ka/Kv1Cvd3W8G2DjXAi27 voOWxa+AZuSzyEuTaUGMqnSKI2Mm5sr2qjXWPMeXjVjCvRAAVnHQgogu7L8GrP01YEw5 7frYkoGT7693ezqUhxHD/OwDdrjQyeA1+UAXRMBemGQisYS9fplABkJOdo80CDohk9lG oytGdXRmpGkSdDb9ghit+BMP5HjyCoR+sXihTstYtG6sYqyJjx0T3/3pxB8OuuGPAkZy q8yK3/DDe1UOKbKAJzn9mkigurNBhf/s6kNtcSd8oZQOd4iMfiDpXyLvNbzjBIWVgEwX a6cg== 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=ZXfkq+xA6C3WnM9N4loU138zx+XBTD7l1V9xxCTfDt4=; b=cGwUmBcQzRxavAxfrQCHkUs49ufO5Rg+BDZ5HsFJ4ZTsc7Q4CIwWIX8aTVHNyXcs/v LbqAU++baPpVEmXIDAaSzeHxlA+JollBpwd1G2hpXS/aZA6EBq9i0NfhQB4PGppMsDah JARJvrgsUa6P964yFESSh8r6ceKIk7vGhmiO5eLPscodzz1XY4w1ySxrm2QjSSHpfrtz ClS+xkkyaq44qCfg9z9wQABh6OneH33FU+b7oJtN95akUHgh9wYfGcZLmZxMarqyY/7G fGjsbsu1sEKR414UVfYtkwKtPPG1iv7i5DeTyaCnl4XcUQyoPskL1vDFwZfX5VnchodW 17Gw== X-Gm-Message-State: AOAM530zWkHMCopACCxv6bT5UZFnTRhTt2sMKGYp9CvBKMOITwRKzmuL FuxMA99HACEn8Ve5CfZKHWzJiw== X-Google-Smtp-Source: ABdhPJxk1o/ua4tJdOlFqadmOc9z+0Y3d36L7GtUVI5gncDmPumO2nrOuZ5YHxvmwEaAiCWjlUpe5g== X-Received: by 2002:a92:849b:: with SMTP id y27mr2524843ilk.173.1596774086536; Thu, 06 Aug 2020 21:21:26 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id g1sm5697236ilj.62.2020.08.06.21.21.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Aug 2020 21:21:25 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 85ACA800864; Thu, 6 Aug 2020 23:21:24 -0500 (CDT) Date: Thu, 6 Aug 2020 23:21:24 -0500 From: Justin Pryzby To: Amit Langote Cc: Tom Lane , Andy Fan , Robert Haas , "pgsql-hackers@postgresql.org" Subject: Re: FailedAssertion("pd_idx == pinfo->nparts", File: "execPartition.c", Line: 1689) Message-ID: <20200807042124.GE20473@telsasoft.com> References: <2550497.1596651719@sss.pgh.pa.us> <2598266.1596686548@sss.pgh.pa.us> <2626504.1596724930@sss.pgh.pa.us> <2685059.1596760353@sss.pgh.pa.us> <20200807040555.GD20473@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 Fri, Aug 07, 2020 at 01:13:51PM +0900, Amit Langote wrote: > On Fri, Aug 7, 2020 at 1:05 PM Justin Pryzby wrote: > > On Fri, Aug 07, 2020 at 12:16:11PM +0900, Amit Langote wrote: > > > Curiously, Justin mentioned upthread that the crash occurred during > > > BIND of a prepared query, so it better had been that a custom plan was > > > being executed, because a generic one based on fewer partitions would > > > be thrown away due to A.I.M. invoked during AcquireExecutorLocks(). > > > > Well this statement should only be executed once, and should be using > > PQexecParams and not PQexecPrepared (pygresql: pg.DB().query_prepared()). > > > > (gdb) p portal->name > > $30 = 0xf03238 "" > > > > (gdb) p portal->prepStmtName > > $31 = 0x0 > > > > (gdb) p *portal->cplan > > $24 = {magic = 953717834, stmt_list = 0x682ec38, is_oneshot = false, is_saved = true, is_valid = true, planRoleId = 16554, dependsOnRole = false, saved_xmin = 0, generation = 1, refcount = 1, context = 0x682dfd0} > > > > I'm not sure why is_oneshot=false, though... > > Perhaps printing *unnamed_stmt_psrc (CachedPlanSource for an unnamed > statement) would put out more information. (gdb) p *unnamed_stmt_psrc $49 = {magic = 195726186, raw_parse_tree = 0xfae788, query_string = 0xfaddc0 "\n", ' ' , "SELECT $3::timestamp as start_time, $2::int as interval_seconds,\n", ' ' , "first_cgi as cgi, gsm_carr_mcc||gsm_carr_mnc as home_plmn,\n", ' ' , "SUM(chargeable_"..., commandTag = CMDTAG_SELECT, param_types = 0x1254400, num_params = 3, parserSetup = 0x0, parserSetupArg = 0x0, cursor_options = 256, fixed_result = true, resultDesc = 0x1376670, context = 0xfae550, query_list = 0x103c9a8, relationOids = 0x11aa580, invalItems = 0x11aa600, search_path = 0x11aa878, query_context = 0xf85790, rewriteRoleId = 16554, rewriteRowSecurity = true, dependsOnRLS = false, gplan = 0x0, is_oneshot = false, is_complete = true, is_saved = true, is_valid = false, generation = 1, node = {prev = 0x12fcf28, next = 0xdf2c80 }, generic_cost = -1, total_custom_cost = 12187136.696805555, num_custom_plans = 1} -- Justin