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 1ux88a-00B7y8-2C for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Sep 2025 18:04:44 +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 1ux87Y-003CNg-OD for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Sep 2025 18:03:41 +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 1ux87Y-003CNY-Da for pgsql-hackers@lists.postgresql.org; Fri, 12 Sep 2025 18:03:41 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1ux87U-000Sd6-2O for pgsql-hackers@lists.postgresql.org; Fri, 12 Sep 2025 18:03:40 +0000 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-b04ba58a84fso308893966b.2 for ; Fri, 12 Sep 2025 11:03:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1757700217; x=1758305017; darn=lists.postgresql.org; h=message-id:date:content-transfer-encoding:mime-version:comments :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1CYbaWwbraypb3zKC/PZve14INHi/nuilPed9GJjn1Q=; b=oqBRzaeWaQk1KwaQl3Qntv/JnHYaEMXhtd4ADs+4TqgBv+KpZ05xa/RlRVVp3COFrP ri4VqS5SMsgnkiiO285d+3liha8Bhp/z64W/bNHhngm03gTCRTmmX6OtHQIDzLxQlcFr Cgsgsb21DBUdyQEN6EeVu45QePDBewnLLot0grHMkXJ0lKtUK0/k+VzPMvDMHkd0uO7J hc9uv/OzBhgdd4uTh/jnTW02jISTcLZ3oxr4tfZICpjRkPcEZqJu5g4RQkeopx++5/VT z8YaC/DwWV2hkJ+Z4TcKbD81ILQqCLV9Onfvl7VF/pIvSQHc1nFu1YWw4NFBXw08VtSo VZ8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757700217; x=1758305017; h=message-id:date:content-transfer-encoding:mime-version:comments :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=1CYbaWwbraypb3zKC/PZve14INHi/nuilPed9GJjn1Q=; b=aXndYPktoxspxOp5VpEsU7xIiViajrZJBySXq8l7xgh+LAQXvSpPmIpmP0nE09VgwQ 6PWbgAytMgJhL4gVZPHKSnVcEMYWulEfM9stJNEEWW/9irKqbG4j00wyBFW25/hMVvS5 I0GK3SEfVBBTDa0SlFVwY7ZgjiWXXThFzK6tsEO8aowLFukmf267yFkLdgWSkiAwICSt g880dSmlrM83mU+epReAD/Itw89JU7peuHQ+ZJSBJSS0t1rj1QdekkkU1FKm/jy/kdee 8GyXgZhs7JLrAg0g9jB3zd8npmQgqWs7cGr1PEKLAJSEsgP6HdXa9ELffl8nrn+2BCVf oN1w== X-Forwarded-Encrypted: i=1; AJvYcCVOK3yMCYCoiv82Gz8HbGtKA1ZpmSAzXqkZCvEu8+wCXkJOXtmVl5syRySszMGsMPGosWb2I4uKSEke0UM2@lists.postgresql.org X-Gm-Message-State: AOJu0YziLEM0Yi4pUbnNzU8We6rQP5XgGrwWSqgT7BnFFE5mUSwqY47V p0wLI8AL/fnMSnPQlTacgKLLILbHa99+E8Rq7sAfEbbVw4t250jQk6svdKjf1ZzJ278= X-Gm-Gg: ASbGncuYpAhDJDalIyJL6Waqo3fg7qixwOITNnbEeAKgSpWtc3AchRT92ttjBnCoPm3 uwKLR99x60BQWxDqw04wlkQyTH1DDZ8ivwJd+DGMir/hSEoqDrzfOV5UdPcZ/qu2IhDsg7PTAaR dKbcfQgTX31OR2th4zrHnn9oPZ9ROxVUQ41t6Vcx2AbJY4BmC22hbQuLlPPW14USFzLp5/nj3cS pUmly3O/lKjJk5fcsO1kVPuT76A4/k3lDH9SnB3mtzR8svAnnEEqelK8s9cYq+zfCbQqPs0wuhe iraqsN529ukrEimalEDGSZfFPdqUednBgDe6nU9kDFqT9dGMLqyscFsRC638g8LI55kYtFBj33O Z2bx8VQY7sI05Tp7rdCqB26rKeR5FtUVfYWNS X-Google-Smtp-Source: AGHT+IFcyD08Ld/EZMz2dDNo3+y8+gT/iQ9+Zd6JN40txgAqO8rLy+twV21P0nJD+qT4ht9HJ56NJA== X-Received: by 2002:a17:907:2d2c:b0:b07:9c13:153e with SMTP id a640c23a62f3a-b07c353e3f8mr385076466b.2.1757700217135; Fri, 12 Sep 2025 11:03:37 -0700 (PDT) Received: from localhost (109-81-168-144.rct.o2.cz. [109.81.168.144]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b07b3129199sm410500366b.36.2025.09.12.11.03.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Sep 2025 11:03:36 -0700 (PDT) From: Antonin Houska To: alvherre@kurilemu.de cc: Euler Taveira , pgsql-hackers@lists.postgresql.org Subject: Re: Unexpected changes of CurrentResourceOwner and CurrentMemoryContext In-reply-to: <202509121703.y7nfmqwotmfv@alvherre.pgsql> References: <202509121703.y7nfmqwotmfv@alvherre.pgsql> Comments: In-reply-to =?us-ascii?Q?=3D=3Futf-8=3FQ=3F=3DC3=3D81lvaro=3F=3D?= Herrera message dated "Fri, 12 Sep 2025 19:10:55 +0200." X-Mailer: MH-E 8.6+git; nmh 1.8; GNU Emacs 28.3 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 12 Sep 2025 20:03:36 +0200 Message-ID: <39892.1757700216@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk =C3=81lvaro Herrera wrote: > On 2025-Sep-12, Antonin Houska wrote: >=20 > > Euler Taveira wrote: > >=20 > > > Interesting. I'm wondering that if this patch is applied we could rem= ove the > > > following code [...] from pg_logical_slot_get_changes_guts and > > > LogicalSlotAdvanceAndCheckSnapState functions too. IIUC the referred > > > code is a band-aid that will be improved someday. > >=20 > > Even though we're fixing the likely reason of this problem, we cannot b= e 100% > > sure that no other problem like this still exists. So I'd not remove th= is > > assignment. Maybe add Assert(CurrentResourceOwner =3D=3D old_resowner) = in front of > > that, and adjust the comment? >=20 > Yeah, I'm going to risk removing it, because if we don't do it now, > we're never going to do it. We can mitigate the risk of missing > remaining bugs by having that assertion you suggest, so that if anyone > actually hits a problem here, we'll know soon enough. >=20 > I have pushed it with that change. I'll also add an open item for pg19 > so that we remember to come back to remove the assertions, if we feel we > no longer need them. I was worried about removing those workarounds because it was not trivial to diagnose the issue. But it should be ok for the master branch. Thanks. --=20 Antonin Houska Web: https://www.cybertec-postgresql.com