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 1r1YMq-00Buvc-AM for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Nov 2023 20:44:40 +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 1r1YMo-005GBW-3V for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Nov 2023 20:44:38 +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 1r1YMn-005GBO-QH for pgsql-hackers@lists.postgresql.org; Fri, 10 Nov 2023 20:44:37 +0000 Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1r1YMg-005myK-Qw for pgsql-hackers@lists.postgresql.org; Fri, 10 Nov 2023 20:44:37 +0000 Received: by mail-io1-xd2c.google.com with SMTP id ca18e2360f4ac-7a93df91813so90005839f.2 for ; Fri, 10 Nov 2023 12:44:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699649069; x=1700253869; darn=lists.postgresql.org; h=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=s1jiQUVZnK7MWOOKrIrwU3RujPiLYcdyoXga8BsCROQ=; b=ZpJuG1imaajrmPQYYj0rFnOnCBm3krj+WULI2D7UgtjqB9977arSqH+NEnxatOIBCK 1vJIpi5XukTRxDPdOe+BUoZGyaR5Qzi3zXkB9WvnomKyUzJDZoy9M5v2/GD6Hb00+h2w 91Mvrcmq2HlpZEce7pkRwXPxhKslU75vli36Ah0aU/prWg4EsbPoUrqUtKV0zadlp0D4 eLb9QKxnkMAVAT6poev0SkegasV5skGp6mdlmhU8uWRZAtdg/OoY0iG+OJyfIr7+ZjP8 NcoCA6Xctgg47aFBMSc6gmsoBKEyLw4nsVoOS80MGA/RM/UFmIfhB4LsJ2d6fbWOkroH /qtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699649069; x=1700253869; h=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=s1jiQUVZnK7MWOOKrIrwU3RujPiLYcdyoXga8BsCROQ=; b=gVB9S1XnKTbc5mUFSOETd4AmgFFeCsxE+jU/pHiRyjGcgedewrHMJq91WBfc0VndHa Frw/lWvjqrPeXl36Br+POfbpifKWzZvfcwz5p7BIPgWiXL74+OQsDYP+sT4XdT+E8J0Q xxLKjUYqNBowrw1D0mMLk9Xe9lNPxo8vtioj6J3V3okkRCz+LAnHD6PdMACeVOEvTw6K Wiesxg3NG2mS34+d1+n9ZJN/eAleQi7dJZQxtyvK+3Crn5UyssxYrFKa2cYcOLeuQ7yR Wcd+xG5KyTEmYWUpWox0XPsHwldv+6/wGqRnF2Y61XnnueXk+j+jPo+STn1vffHRJyEJ uy/g== X-Gm-Message-State: AOJu0Yzw1D04/Dd/ls0WC8R8fsdwohBBPHeTCU2sT/NdKu+Re5hjLKDS NMpI52qygVWovdmYgJnQPI8= X-Google-Smtp-Source: AGHT+IHV+Rij0U11jz0imRn9FPzLvKxJ+KwAjkamofjsMRzd+B9unt/GA2nCkw8RYZfZv+G9nNWyxw== X-Received: by 2002:a05:6602:4185:b0:792:8d16:91ef with SMTP id bx5-20020a056602418500b007928d1691efmr517400iob.18.1699649068652; Fri, 10 Nov 2023 12:44:28 -0800 (PST) Received: from nathanxps13 (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id eq19-20020a0566384e3300b0043d1cbf11d7sm55953jab.26.2023.11.10.12.44.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Nov 2023 12:44:28 -0800 (PST) Date: Fri, 10 Nov 2023 14:44:25 -0600 From: Nathan Bossart To: Michael Paquier Cc: Nazir Bilal Yavuz , Postgres hackers Subject: Re: Adding facility for injection points (or probe points?) for more advanced tests Message-ID: <20231110204425.GA1315705@nathanxps13> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Nov 07, 2023 at 05:01:16PM +0900, Michael Paquier wrote: > On Mon, Nov 06, 2023 at 10:28:14PM +0300, Nazir Bilal Yavuz wrote: >> I liked the idea; thanks for working on this! +1, this seems very useful. > +#ifdef USE_INJECTION_POINTS > +#define INJECTION_POINT_RUN(name) InjectionPointRun(name) > +#else > +#define INJECTION_POINT_RUN(name) ((void) name) > +#endif nitpick: Why is the non-injection-point version "(void) name"? I see "(void) true" used elsewhere for this purpose. > + > + Here is an example of callback for > + InjectionPointCallback: > + > +static void > +custom_injection_callback(const char *name) > +{ > + elog(NOTICE, "%s: executed custom callback", name); > +} > + Why do we provide the name to the callback functions? Overall, the design looks pretty good to me. I think it's a good idea to keep it simple to start with. Since this is really only intended for special tests that run in special builds, it seems like we ought to be able to change it easily in the future as needed. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com