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 1rd34S-003Yo0-AS for pgsql-bugs@arkaria.postgresql.org; Thu, 22 Feb 2024 07:00:40 +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 1rd34Q-008kul-Qe for pgsql-bugs@arkaria.postgresql.org; Thu, 22 Feb 2024 07:00:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rd34Q-008kud-IV for pgsql-bugs@lists.postgresql.org; Thu, 22 Feb 2024 07:00:39 +0000 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rd34K-000IRT-0B for pgsql-bugs@lists.postgresql.org; Thu, 22 Feb 2024 07:00:38 +0000 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1d51ba18e1bso15514475ad.0 for ; Wed, 21 Feb 2024 23:00:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708585230; x=1709190030; darn=lists.postgresql.org; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:from:subject:cc:to:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=8StySagwFK71+LydazmFFr35I37gx+UerLMxj/3BxMw=; b=mEDHO/IzdFjvT+Vq3i1XcJndmmkh0xnf8aCiVJTQ/mBComzwf+PGRlwfZ5e6l2yxI4 liEDgRRDnRPmSoPkGvFdxqo9BzZRKdqeeaNaevwGBA6ivuEjhISY0WCI8ievVeLMcwWK /+/Rz/CoXwwoWIeCJmOASfJsjaRN7hPgxG4APXeLWJ2PWX0SLFc+8C3NHY4VmjUubxxo 3kQ/Zhymzam9HS+nbn9Md6O3sklgXS/X28Rz1snt/s2IJeU69MyK8OHuQWmdz1jh4lhi Ry+bygnISbAhqEFDnoHIR0mOJd+s6sfugi5gpFOBkV0AO44PkrlsHOSQknAJFmOUoNFW iYcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708585230; x=1709190030; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:from:subject:cc:to:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=8StySagwFK71+LydazmFFr35I37gx+UerLMxj/3BxMw=; b=MWnYGUaGgNcyMG17StxRPj6Hl4WU5OXZFMsEt4JjSyYp1rR4H7Pta62vqnfA+1FAFI w5IXbbE2YmNJRXuiEMzZOru2ew2YvjKuakv1Zjq1R1KqaJWgu25CmwleUqeDTszsUvfF r+dq/SfDp+CbjgxwKKG+xpVtYShhUCXkebBax7FMdXlDdmNG3anQ+CJCn6sOhuO807cB OAuk05HS/egFDl9oR0zg9KalMnqNoIp+ppzxZJTosC/hJSbXYzwgzSCMapB7Mcq0GwLG 8dz+O0KfB/31aRZbduLaG+E3JlUUR5MwThGpsuFpOvuehytkXTwiEAn7MoI1grT7Y5iH wzjA== X-Forwarded-Encrypted: i=1; AJvYcCVOa+ujtBqpJgCYy/pzUN5NDLksxdabMLalQnSHMsLmJXrVeUD5EVoCTmOVftWoGnAkJXVdwaGaUzbDLsZc6/UEU1ge9by1rPKokH1QRwun X-Gm-Message-State: AOJu0Yy43dmFxO6cNiduDGFWwiD3GvGYXz8pEcgmqltgAP+2Qr0bFsnU 0gmNSBeRCyg+2V43gS7A3Qaklrj0mZOgNfLAOqVSAUBFz7C9Cv8r X-Google-Smtp-Source: AGHT+IHQZO3bCW6G+LgL4fEXWLtiTdJPvIL43tMJwvVb3dV8fY3NUxMptBHU4Er4qgpK8ttW7+F4jQ== X-Received: by 2002:a17:902:cec2:b0:1da:eed:f25b with SMTP id d2-20020a170902cec200b001da0eedf25bmr26912241plg.46.1708585229659; Wed, 21 Feb 2024 23:00:29 -0800 (PST) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id mi11-20020a170902fccb00b001db608107ecsm9235504plb.167.2024.02.21.23.00.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 23:00:29 -0800 (PST) Date: Thu, 22 Feb 2024 16:00:27 +0900 (JST) Message-Id: <20240222.160027.62383325429446607.horikyota.ntt@gmail.com> To: tndrwang@gmail.com Cc: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18354: Aborted transaction aborted during cleanup when temp_file_limit exceeded From: Kyotaro Horiguchi In-Reply-To: <20240222.143815.1856873109774774353.horikyota.ntt@gmail.com> References: <20240222.114600.1019580904613326727.horikyota.ntt@gmail.com> <20240222.143815.1856873109774774353.horikyota.ntt@gmail.com> User-Agent: Mew version 6.8 on Emacs 27.2 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk At Thu, 22 Feb 2024 14:38:15 +0900 (JST), Kyotaro Horiguchi wrote in > At Thu, 22 Feb 2024 11:49:29 +0800, Tender Wang wrote in > > Changing the behavior of tuplestore can work for this issue, but I'm not > > sure if this change will affect other components which depend on > > BufFile(like nodeMaterial) In the case of nodeMaterial, tuplestore is simply discarded and underlying files are removed without flushing by the resource owner mechanism. On the other hand, in the case of this bug report, the files in the problem tuplestore are not managed by a resource owner. As a result, PortalDrop have to explicitly call tuplestore_end to release resources used by the tuplestore. > /* > * Delete tuplestore if present. We should do this even under error > * conditions; since the tuplestore would have been using cross- > * transaction storage, its temp files need to be explicitly deleted. > */ > if (portal->holdStore) > { > MemoryContext oldcontext; > > oldcontext = MemoryContextSwitchTo(portal->holdContext); > tuplestore_end(portal->holdStore); As far as I can see, there are no caller sites to tuplestore_end in the abort path or any error handling path. regards. -- Kyotaro Horiguchi NTT Open Source Software Center