Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tBiWc-005cgI-IP for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Nov 2024 22:41:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tBiWZ-0070qq-NI for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Nov 2024 22:41:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tBiWZ-0070qi-66 for pgsql-hackers@lists.postgresql.org; Thu, 14 Nov 2024 22:41:15 +0000 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tBiWW-001u8z-KR for pgsql-hackers@postgresql.org; Thu, 14 Nov 2024 22:41:14 +0000 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-7245a9d0e92so149025b3a.0 for ; Thu, 14 Nov 2024 14:41:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1731624071; x=1732228871; darn=postgresql.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=28xymf1ajK4MTeOVOr9gaab9bkrhGsDOMA9Trezre3s=; b=HSpLM/QwiNZm6a40aY0V1jic4eki8jMyG/4PALziXuMyiOVBVTV0k/0MnhYXgW7vKe 4qZjab9PrCYCr+62m6jGTIBo7VdiLa4xKiOFH2UnVw8pCwLffB72hbCvVrQqTpX95AtG ApYW1bZAAi0ficnLNiUr65YR4sWQAkX8bSgvU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731624071; x=1732228871; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=28xymf1ajK4MTeOVOr9gaab9bkrhGsDOMA9Trezre3s=; b=vG3yq3oSAQVH/yrCUPN0fvA44sglVf6JuOJ7chWuWl2IBJBW8NAG9gLbtYttDrGIRd bhF91AUtuPksoO0M0SU+vbUeGXv4BZDnTMJYzjdyPSZAh8MeMgQYI0KETqo1YreF7LLv FKJXZ9Fwdwdmg6MEe9L4aaUA9ARsWDdp9Nt7vVWhQq1F2wRqJ+zhZz8z1KSKogqPQGsm DgIuCZchme1qE+G6jWK6NNYRcZnERDPbNx3Dv0E3UaRhAeOu41pUlQGZCN/IgR7xpupF SfAQz0la6CgzecslEcjv4tk6B10mBPm8tDS1ipxO7RssuUyEVWgMfIR7TN60qzGKJ/cq Gqeg== X-Forwarded-Encrypted: i=1; AJvYcCVrUJJRN9s9+3t/8NO4bqrNcWaWSst1dZ+LXUpPubtF+mmhRebxRELzUW2HIz3DMPNiUmJs9/5InFnMc5Si@postgresql.org X-Gm-Message-State: AOJu0Yx88vJP1KjvUFJcgVX6HJSoR8VZ4SM+lvkIUHRVUSditLIfBgeY R4BakebO4Syiz4oMa1WuCnkHAkmHU1iqEoHHfUpxhw59uV0eGBtVDH7D0Xtp3w== X-Google-Smtp-Source: AGHT+IEeaAr0bPygpBB3NaVyGJUvcUIFRUMc3m0rydM6JmV3LaXDungCgGX7Qtdbn1Y4HL4y83mwqw== X-Received: by 2002:a05:6a00:a89:b0:71e:5d1d:1aaf with SMTP id d2e1a72fcca58-72476cefa61mr583587b3a.23.1731624071396; Thu, 14 Nov 2024 14:41:11 -0800 (PST) Received: from google.com ([2600:1702:a20:5750::48]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72477202671sm147272b3a.190.2024.11.14.14.41.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Nov 2024 14:41:10 -0800 (PST) Date: Thu, 14 Nov 2024 14:41:08 -0800 From: Noah Misch To: Alvaro Herrera Cc: Tom Lane , Christoph Berg , Pavan Deolasee , pgsql-hackers Subject: Re: Potential ABI breakage in upcoming minor releases Message-ID: <20241114224108.d0.nmisch@google.com> References: <1976928.1731614974@sss.pgh.pa.us> <202411142033.u6za5a6ylj2k@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202411142033.u6za5a6ylj2k@alvherre.pgsql> User-Agent: Mutt/2.2.12 (2023-09-09) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Nov 14, 2024 at 09:33:32PM +0100, Alvaro Herrera wrote: > On 2024-Nov-14, Tom Lane wrote: > > Alvaro Herrera writes: > > > But timescale did crash: > > > > So what is timescale doing differently? > src/ts_catalog/catalog.c-extern TSDLLEXPORT ResultRelInfo * > src/ts_catalog/catalog.c-ts_catalog_open_indexes(Relation heapRel) > src/ts_catalog/catalog.c-{ > src/ts_catalog/catalog.c- ResultRelInfo *resultRelInfo; > src/ts_catalog/catalog.c- > src/ts_catalog/catalog.c: resultRelInfo = makeNode(ResultRelInfo); > src/ts_catalog/catalog.c- resultRelInfo->ri_RangeTableIndex = 0; /* dummy */ > src/ts_catalog/catalog.c- resultRelInfo->ri_RelationDesc = heapRel; > src/ts_catalog/catalog.c- resultRelInfo->ri_TrigDesc = NULL; /* we don't fire triggers */ > src/ts_catalog/catalog.c- > src/ts_catalog/catalog.c- ExecOpenIndices(resultRelInfo, false); This is a copy of PostgreSQL's CatalogOpenIndexes(). Assuming timescaledb uses it like PostgreSQL uses CatalogOpenIndexes(), it's fine. Specifically, CatalogOpenIndexes() is fine since PostgreSQL does not pass the ResultRelInfo to ModifyTable. > Oh, hmm, there's this bit which uses struct assignment into a stack > element: Yes, stack allocation of a ResultRelInfo sounds relevant to the crash. It qualifies as a "very unusual code pattern" in the postgr.es/c/e54a42a sense. I'm hearing the only confirmed impact on non-assert builds is the need to recompile timescaledb. (It's unknown whether recompiling will suffice for timescaledb. For assert builds, six PGXN extensions need recompilation.) I don't see us issuing another set of back branch releases for the purpose of making a v16.4-built timescaledb avoid a rebuild. The target audience would be someone who can get a new PostgreSQL build but can't get a new timescaledb build. That feels like a small audience. What's missing in that analysis? Going forward, for struct field additions, I plan to make my own patches more ABI-breakage-averse than the postgr.es/c/e54a42a standard.