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 1wAyR4-000cKp-22 for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Apr 2026 23:05:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wAyR2-0089mO-1z for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Apr 2026 23:05:17 +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 1wAyR2-0089mF-11 for pgsql-hackers@lists.postgresql.org; Thu, 09 Apr 2026 23:05:17 +0000 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wAyR1-00000000EnS-0Kdc for pgsql-hackers@postgresql.org; Thu, 09 Apr 2026 23:05:16 +0000 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-67011a751d2so2625001a12.2 for ; Thu, 09 Apr 2026 16:05:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775775914; cv=none; d=google.com; s=arc-20240605; b=fdXU5nNt5sY4ZGPYUBchxjao3cv3AvaDUKStXTmVZ3/8x9oJYdIQgFvRZth7c1lGtP BwRQELS8KzXxYxkqpmdmAPHjQBdRJsHnj7pNTVFCcGkhaOg0V7QwktbZSlJBV6epED1L UbwmpXUDc8Zb9iMDDzCFRJ/nWoC+H4dk4+GI0ZjJHMBWLz3gZoDJwwac9QJ3oTPCmn3p yZJ5ZzwEvT4H2my0RY/gscDenn9aDLttR3fGts/XlWYQtzfWf8Okm2Z/aTNxWqZ1xpAJ +fAU9aEEP0vXvTfEKtdMsv7gonEYOrPip/P+79+1UdsPZsDpbVc7qoztwYMW4hA8o+Fw HFjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=Qyom9XGJAMv3TT8AhUYVuC+se8OD0tIm1JveZWKQRdc=; fh=oc+X41flQzTh5HmC6iVx/BpvrPFy/OE7/UjGEvH8Pdo=; b=FHv4TldgVt0r+NTLGx8S99G661/wPMed3eT7XXXFqInj8yhAKPzpFT7Htg500rw7N3 3K4I7fZX6ljKjix5nXkNQ/4wuK3VXRa0761obF8WIjWzE2Pc30msjXPZeiqJm0fT3xx3 Fssx7JHugrxfdzrMrmOyaFEKnKVgsJfMOWOdAnghoJ76U87snL2wn6Jkd76QMF9kY5WF csFJHRrHt9AExxINPXc9SZSc7MzMZtjXqFwshOMtklq21mlqHVEbHhm71oLY8O5Y+gfE u/rMFlPro4vX7M5z5peuGYHm6s3PdMqt2ndoH4el2TLMN70pzCrEPyApUPBx3wsi16nG tQeA==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775775914; x=1776380714; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Qyom9XGJAMv3TT8AhUYVuC+se8OD0tIm1JveZWKQRdc=; b=UhCg53Vqu2pYfyKJQYeczG/WdDDINXlTJXDWr0KeNBywmgtCjfC8qWsUmmIi44rPEa N0lEpz7d72NRv4wXtEnXdkd0kGDbyZCzxtaa6/qB9cR1F0RO39ECUm/HdduvwPoxQO/Y xb+dfSpEcpqERSV34H2+djjP08y6zTE7FdC3b/aZf6b/fTkBbSmwW3eOkj2fSl1J2wo8 2cXZFtwRE8pt1o0h/E0bARN7JzVHZ2iX0v0Sp+gOW4OtUu0gbq0IMWU2Rqs6VN4mii2Q OgVlxJhfG391i+qZXue86W1PdoSVHTW7u3oZldKNw7Zv5v2T5uBfY7JqNq36aDL/urQk 47mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775775914; x=1776380714; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Qyom9XGJAMv3TT8AhUYVuC+se8OD0tIm1JveZWKQRdc=; b=oeY2pC0gbi2Q2Ev43RwF7L4ueT2agzjVhXVG6u/NF14ctFIIL3dsoGwV05vatWPNah FgcqO4hTMKFnNnxAvIABUiqq/uaDRo7UcjHTJNk8ASxBwBS1HBKJZoylA7Q6AzCxEoHy O0XonSXN43iHBRdG1glQL3PFiYoZ2wFnlJAqkH8+LQ4cm+Tr9oU5tyTrerTAzt0vs4Rl T2eMRtBz9NfwuBvnP2QXLME383tC0J9pJgcO8oi9/ynGlzPCnRYiTViL1qIp1XeQ+dsG iw4JXhoIIn+M8KK2HWe5ddPu3gbq+RxIKZ/u4lJNio21HZimYckedrYN+qARy5OwOEP5 WJtg== X-Gm-Message-State: AOJu0YxbsKyXLQO7vwECGBhmeVSoFRaGLoVvwufB89gzUW8c9mFp4em/ P/I9dxM8T9r6Kiq/jY3ObSZkTvUlFCC0uHV5x9NAyvy49SLAcBGZnkIj7k9ncYWasFUQPOhT+Vh 3ZYsfRmBgRsUHbt7Ggp4+eQbbcIUokcb52J2YfDg= X-Gm-Gg: AeBDiev3nhz47WKWtKR64OHNgmosysgG1D1IiXxK6Wx3OJzLHMZCZhU8qHy/572QtPI F3WeyIclSDyLx1F4ODBzKQpJs2h7WB2EvquNgbhDxCjPHOeBaTGrzN+IRPMIeKkk8+M27+i8Sdt oCLAAXSFTQ/VGlo8AgMRduMDh6VQ2K2qkR4djEV09jxn7JILijxDWwSRo8F3Ra7o50tzZdi+DAP N890W64CKTCtZ7rh6YCewfj1Gj9SKB0+Wfs31ct+DfGm6XkSnizwlPDA8sZr+QSQ/r1PSEc9j1X vGVnzw== X-Received: by 2002:a05:6402:24cc:b0:66d:eb3c:e33a with SMTP id 4fb4d7f45d1cf-670786a999amr225833a12.1.1775775913827; Thu, 09 Apr 2026 16:05:13 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Sami Imseih Date: Thu, 9 Apr 2026 18:05:02 -0500 X-Gm-Features: AQROBzCGT1ApbKNZuhK14qOiQ09mJYXUC5nWSKrU0XHtNO4RQHA_OFWJTjKj-G8 Message-ID: Subject: Re: Allow a condition string in an injection point To: Michael Paquier Cc: pgsql-hackers , Masahiko Sawada , Daniil Davydov <3danissimo@gmail.com> Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > > A follow-up to the discussion here [0], here is a patch that allows > > for an arbitrary string in injection points to be able to apply more > > granular filters for running an injection point. This will be useful > > for autovacuum testing as discussed in the referenced thread, > > and perhaps in some other places. > > Are the patches under discussion required for v19 or is that something > that can wait before v20 opens for business? We have always required > a use-case in core before adding a new API in this module, to justify > its existence. This is v20. One of the use-case is discussed here [1]. When testing of autovacuum for a specific table, we need a way to run the injection point for that table only, else we end up running the point it for all tables. This is especially true for check-world where other non-related tables are being autovacuumed. So this gives more granular control. > > Worth noting, the condition types were changed to bit flags since > > we may need to combine conditions such as local injection point > > and string. > > It's definitely more useful to allow combinations of them in an AND > fashion (if two conditions are defined then check both, and allow the > point to run if both conditions pass). Just to say that what you are > doing looks sensible for me. And I find that pretty cool for its > simplicity and what it could provide for future tests. yes, I did test with some other new hypothetical condition in the future and it was simple to plug it in to the code at that point. > @@ -322,6 +322,7 @@ InjectionPointAttach(const char *name, > strlcpy(entry->name, name, sizeof(entry->name)); > strlcpy(entry->library, library, sizeof(entry->library)); > strlcpy(entry->function, function, sizeof(entry->function)); > + memset(entry->private_data, 0, INJ_PRIVATE_MAXLEN); > if (private_data != NULL) > memcpy(entry->private_data, private_data, private_data_size); > > Hmm, this could be qualified as a bug, and surely it's a good practice > to clean things on attach. I'll go backpatch that. It did not matter before this new condition type since the private_data was never NULL. Not the case with this patch, as it caused inection_points test regressions with this change. So, yeah, it's a latent bug. -- Sami [1] [https://www.postgresql.org/message-id/CAA5RZ0tExiffcu7qvrUbpq_qqz%3DzCD2aJ5_Qigo6eP2kgTx3eQ%40mail.gmail.com]