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 1sHSBa-007fKS-0R for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Jun 2024 17:55:02 +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 1sHSBX-003zPW-Po for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Jun 2024 17:55:00 +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 1sHSBX-003zN5-7i for pgsql-hackers@lists.postgresql.org; Wed, 12 Jun 2024 17:55:00 +0000 Received: from mail-yb1-xb30.google.com ([2607:f8b0:4864:20::b30]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sHSBV-001JtO-Fq for pgsql-hackers@postgresql.org; Wed, 12 Jun 2024 17:54:59 +0000 Received: by mail-yb1-xb30.google.com with SMTP id 3f1490d57ef6-dfea5f628e9so148821276.3 for ; Wed, 12 Jun 2024 10:54:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1718214896; x=1718819696; 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=DB/xdEuVUSRxmunysAaHtpw8KFU9zG+EJnp2mRdLido=; b=auwDVsRpSu9b18zRAz/PTFJyPYn/V7adFFCStv82XnVGo776ecVkIjPKuabaoo6Xys nfVIfPEANAIOnsHrkT7l0PnXUvstCKCwSpYtdCxrA+d0zq45eisM1TEi+/KlH0YloMUV zZdbpHapT/9BW+I3hYFrAYu3TLd1147IeZy2Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718214896; x=1718819696; 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=DB/xdEuVUSRxmunysAaHtpw8KFU9zG+EJnp2mRdLido=; b=leFM/GQFFYYjNfoZoI4nHa9KJzP+M18w6bLHQJ9XG59XOXgqOruKrPUL8st7eqCdmT DPE0p/OacUbLzcimSynBj8Mf5ec/HLmIg6LYsxiJ4T0Oj53+oLIEuTa33k8UQbg6wV3Y VWw+oRwYuitytpAivl6IfgGzT/0VVtQHjZWLuCfLAs4S2X1P0y6rhN9y6a22k4pZ7+Vp WB/HTyHlKg9ZUpYRJKlHmKSl5l6gpBiX5wKBiYAhB79eWgG24O+VL4a1Wps8HzrmfX1w hx2gcOm7zz2EQ6T+KFMbVgXIGDJ9l/b1raIcP+1ZwPjRjwcqlfCQ0o8hfQStfdDdqXTY 9QYA== X-Gm-Message-State: AOJu0YxJX0vyM1NnxNaonXj3VaSD+8JHyRpuoUtC5Th2xdEp+yIJvSQs wL+TLFsJ8yB4Wc//3Sik9JtkLnTwOrrQ2eUgkD9b3fBOM6MF08u1xHIPvI3CAw== X-Google-Smtp-Source: AGHT+IFTSniJgVUdyD6Iuq/0pv4B0XKm2dH4NCtbGeQNefWJqG0yNwgiKTtuo5tHFcQDQPsr5BJq6w== X-Received: by 2002:a05:6902:307:b0:de6:1057:c85f with SMTP id 3f1490d57ef6-dfe66b601a0mr2530827276.22.1718214895596; Wed, 12 Jun 2024 10:54:55 -0700 (PDT) Received: from google.com ([2600:1702:a20:5750::48]) by smtp.gmail.com with ESMTPSA id 3f1490d57ef6-dfb135edda0sm1562583276.3.2024.06.12.10.54.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Jun 2024 10:54:54 -0700 (PDT) Date: Wed, 12 Jun 2024 10:54:52 -0700 From: Noah Misch To: Robert Haas , Michael Paquier Cc: pgsql-hackers@postgresql.org, Tom Lane , Smolkin Grigory Subject: Re: race condition in pg_class Message-ID: <20240612175452.de.nmisch@google.com> References: <1617596.1698446455@sss.pgh.pa.us> <20231027232612.99.nmisch@google.com> <20231102030915.d3.nmisch@google.com> <20240512232923.aa.nmisch@google.com> <20240605181706.fe.nmisch@google.com> <20240611021927.30.nmisch@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Tue, Jun 11, 2024 at 01:37:21PM +0900, Michael Paquier wrote: > On Mon, Jun 10, 2024 at 07:19:27PM -0700, Noah Misch wrote: > > On Fri, Jun 07, 2024 at 09:08:03AM -0400, Robert Haas wrote: > >> I think the core code should provide an "Injection Point" wait event > >> type and let extensions add specific wait events there, just like you > >> did for "Extension". > > > > Michael, could you accept the core code offering that, or not? If so, I am > > content to implement that. If not, for injection point wait events, I have > > just one priority. The isolation tester already detects lmgr locks without > > the test writer teaching it about each lock individually. I want it to have > > that same capability for injection points. Do you think we can find something > > everyone can accept, having that property? These wait events show up in tests > > only, and I'm happy to make the cosmetics be anything compatible with that > > detection ability. > > Adding a wait event class for injection point is an interesting > suggestion that would simplify the detection in the isolation function > quite a bit. Are you sure that this is something that would be fit > for v17 material? TBH, I am not sure. If I were making a list of changes always welcome post-beta, it wouldn't include adding wait event types. But I don't hesitate to add one if it unblocks a necessary test for a bug present in all versions. > At the end, the test coverage has the highest priority and the bugs > you are addressing are complex enough that isolation tests of this > level are a necessity, so I don't object to what > inplace050-tests-inj-v2.patch introduces with the naming dependency > for the time being on HEAD. I'll just adapt and live with that > depending on what I deal with, while trying to improve HEAD later on. Here's what I'm reading for each person's willingness to tolerate each option: STRATEGY | Paquier | Misch | Haas -------------------------------------------------------- new "Injection Point" wait type | maybe | yes | yes INJECTION_POINT(...) naming | yes | yes | unknown isolation spec says event names | yes | no | unknown Corrections and additional strategy lines welcome. Robert, how do you judge the lines where I've listed you as "unknown"? > I'm still wondering if there is something that could be more elegant > than a dedicated class for injection points, but I cannot think about > something that would be better for isolation tests on top of my head. > If there is something I can think of, I'll just go and implement it :) I once considered changing them to use advisory lock waits instead of ConditionVariableSleep(), but I recall that was worse from the perspective of injection points in critical sections.