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.96) (envelope-from ) id 1w3Q05-001COj-0C for pgpool-hackers@arkaria.postgresql.org; Fri, 20 Mar 2026 02:54:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w3Q02-003zxM-1o for pgpool-hackers@arkaria.postgresql.org; Fri, 20 Mar 2026 02:54:10 +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.96) (envelope-from ) id 1w3Q02-003zxE-16 for pgpool-hackers@lists.postgresql.org; Fri, 20 Mar 2026 02:54:10 +0000 Received: from meldrar.postgresql.org ([2a02:c0:301:0:ffff::31]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w3Pzy-000000006JT-3FT8 for pgpool-hackers@lists.postgresql.org; Fri, 20 Mar 2026 02:54:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Content-Transfer-Encoding:Content-Type: Mime-Version:From:Subject:To:Message-Id:Date:Sender:Reply-To:Cc:Content-ID: Content-Description:In-Reply-To:References; bh=63FycrJHp7qWTQ0pZIdZHctIPYqX1Og1DWFLEUdBOaM=; b=Ak3Pe+yQWVvykHT6ZWB6VVVjxD JDl5kyxjI2aTuDtzVncYNcXLoh31NPO3y0fCmHff/joWuasg1fW+Vmgn7xiaVkJv8yiE8SEGkdvCb WbTX7lvZsVAecceq9t2e3MBSavN6ZaZADzK80gDoW/R0yD/k/AbURU4Qu0RTEyYR4dlFR8eQj+prc 3fn3hxW2ECZPvw+63tFvepEnAmcrjL+IDmqS8ZTfqA9xTOGX59iitAe/bIlFwtRwz1h1dTvIW5xyC fK6u/VrfBsTXH7H3XP8gXxzzMd/LmEpJnjc3jiHBr110Br0u/P7N8FD16P5x+aStESz/MfF0fij1A 6PL4UoaA==; Received: from [2409:11:4120:300:6482:65f7:e8a2:bbb0] (helo=localhost) by meldrar.postgresql.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w3Pzv-003fQV-06 for pgpool-hackers@lists.postgresql.org; Fri, 20 Mar 2026 02:54:05 +0000 Date: Fri, 20 Mar 2026 11:53:54 +0900 (JST) Message-Id: <20260320.115354.1808938375091443061.ishii@postgresql.org> To: pgpool-hackers@lists.postgresql.org Subject: pool_search_relcach does not consider session local cache case From: Tatsuo Ishii X-Mailer: Mew version 6.8 on Emacs 29.3 Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Fri_Mar_20_11_53_54_2026_042)--" Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2409:11:4120:300:6482:65f7:e8a2:bbb0 (failed) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ----Next_Part(Fri_Mar_20_11_53_54_2026_042)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit While looking into https://github.com/pgpool/pgpool2/issues/154 I found a bug with pool_search_relcach. pool_search_relcache does not consider the session local cache case such as temp table search. It creates the search result in shared relation cache even if the relation cache is session local. As a result subsequent query against the session local cache is returned from the shared relation cache. This could cause wrong result. Example: create table t1(i int); select * from t1; -- info "t1 is not a temp table" is registered in shared cache drop table t1; create temp table t1(i int); select * from t1; -- shared cache tells that t1 is not temp table and it could be load balanced, -- it could access non existent table from standby nodes. Fix is, to not register a temp table to shared relation cache if it's a session local cache. Patch attached. Best regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ----Next_Part(Fri_Mar_20_11_53_54_2026_042)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="v1-0001-Fix-session-local-relation-cache-case-bug.patch"