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 1s6aoQ-000ZP6-EV for pgsql-hackers@arkaria.postgresql.org; Mon, 13 May 2024 18:54:15 +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 1s6aoO-004QIl-P5 for pgsql-hackers@arkaria.postgresql.org; Mon, 13 May 2024 18:54:12 +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 1s6aoO-004QId-6a for pgsql-hackers@lists.postgresql.org; Mon, 13 May 2024 18:54:12 +0000 Received: from mail-yw1-x1133.google.com ([2607:f8b0:4864:20::1133]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1s6aoK-0003Zq-4E for pgsql-hackers@postgresql.org; Mon, 13 May 2024 18:54:11 +0000 Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-61be674f5d1so51596627b3.2 for ; Mon, 13 May 2024 11:54:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1715626447; x=1716231247; 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=v2twLTsevQ329J9u3pAeSocejlTVfGeQFKOIqkz10hw=; b=FtIx1Xr8QLynsUSdwOzBoIowLeKqhFf5s+TnlI9Ji6zq7kfDdE8zXVwkBwZUDMiB3d UBjLpnxCPB1hGzH7Lz/R2tMpcTfPm6gcM27EsCHk7f7BSHyt4UpERTLHqLTUcBoeFTg5 exaOZsAygPelE9TNyJhUvjta3W5C6lltGgx1U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715626447; x=1716231247; 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=v2twLTsevQ329J9u3pAeSocejlTVfGeQFKOIqkz10hw=; b=pOhq/3dY+g5rUSoIxFXblRUoll+albkor5gaZQ62b00eO0XggSS9Lq/Yke0mnpRj71 baH/HabTTx+L723JjYPCO4LLeqadboxZIDxfy0+LUao1068A8b1jZhweYqN0TZUtpysH 8SZPDVVNBSYjp6LIFk3JGg8gSrC7W5kUmqnT8r2efYNYGyuuH0+A6KOcxlt0vR8D3i7K 06ncJMFHjJwS5Rop22CWR2UnVV6X1EjzDschhwq9+oxGy4JJU7ayjoSKNCC3kuRWXpNs tC13i1wh3Kg538aHJBPMW6i8NF6F0gQ7ZQfIaCbWNfDXkTCbAleLwwBmMKnER9mwQiuo cwTQ== X-Forwarded-Encrypted: i=1; AJvYcCUbULM0tixtNipNqk227hX3OmgR10xijlZwn978soBTul6SkociHac1Ml2Se7qAC+DFv1xSPldytM5dLnRPo8FZt4kTpLblRF0tAf7x X-Gm-Message-State: AOJu0YyCvT3yTd5RnyU8Sf//PJmSjYI4lEqzoW8WxpaU4JsSqavbpfIX uiK8LNAbkSyTy1n5LPDsMR7F9xqhfAQxs/KhgzhUx5+SKesEzprw/D3Dku9TUw== X-Google-Smtp-Source: AGHT+IEze0v2M1FngDMJGx0osMKmFicsiMi9W8nHzCJ5GWwdopTbtYU9rPZdRxDKQ9bZWQhdyHWXQw== X-Received: by 2002:a05:690c:f0f:b0:61a:db67:b84f with SMTP id 00721157ae682-622affabbedmr166955277b3.27.1715626446769; Mon, 13 May 2024 11:54:06 -0700 (PDT) Received: from rfd.leadboat.com ([2600:1702:a20:5750::48]) by smtp.gmail.com with ESMTPSA id 00721157ae682-6209e25bf87sm21899457b3.35.2024.05.13.11.54.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 May 2024 11:54:06 -0700 (PDT) Date: Mon, 13 May 2024 11:54:03 -0700 From: Noah Misch To: Michael Paquier Cc: Tom Lane , Smolkin Grigory , pgsql-hackers@postgresql.org Subject: Re: race condition in pg_class Message-ID: <20240513185403.d7@rfd.leadboat.com> References: <20231027044404.7e.nmisch@google.com> <20231027184832.9b.nmisch@google.com> <1596629.1698435146@sss.pgh.pa.us> <20231027214946.79.nmisch@google.com> <1617596.1698446455@sss.pgh.pa.us> <20231027232612.99.nmisch@google.com> <20231102030915.d3.nmisch@google.com> <20240512232923.aa.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 Mon, May 13, 2024 at 04:59:59PM +0900, Michael Paquier wrote: > About inplace050-tests-inj-v1.patch. > > + /* Check if blocked_pid is in injection_wait(). */ > + proc = BackendPidGetProc(blocked_pid); > + if (proc == NULL) > + PG_RETURN_BOOL(false); /* session gone: definitely unblocked */ > + wait_event = > + pgstat_get_wait_event(UINT32_ACCESS_ONCE(proc->wait_event_info)); > + if (wait_event && strncmp("INJECTION_POINT(", > + wait_event, > + strlen("INJECTION_POINT(")) == 0) > + PG_RETURN_BOOL(true); > > Hmm. I am not sure that this is the right interface for the job > because this is not only related to injection points but to the > monitoring of a one or more wait events when running a permutation > step. Could you say more about that? Permutation steps don't monitor wait events today. This patch would be the first instance of that. > Perhaps this is something that should be linked to the spec > files with some property area listing the wait events we're expected > to wait on instead when running a step that we know will wait? The spec syntax doesn't distinguish contention types at all. The isolation tester's needs are limited to distinguishing: (a) process is waiting on another test session (b) process is waiting on automatic background activity (autovacuum, mainly) Automatic background activity doesn't make a process enter or leave injection_wait(), so all injection point wait events fall in (a). (The tester ignores (b), since those clear up without intervention. Failing to ignore them, as the tester did long ago, made output unstable.)