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 1rlvI5-004vw6-9L for pgsql-hackers@arkaria.postgresql.org; Sun, 17 Mar 2024 18:31:25 +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 1rlvI2-00CDZX-R4 for pgsql-hackers@arkaria.postgresql.org; Sun, 17 Mar 2024 18:31:23 +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 1rlvI2-00CDWR-A3 for pgsql-hackers@lists.postgresql.org; Sun, 17 Mar 2024 18:31:23 +0000 Received: from mail-yw1-x1134.google.com ([2607:f8b0:4864:20::1134]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rlvHz-0053Kv-7l for pgsql-hackers@lists.postgresql.org; Sun, 17 Mar 2024 18:31:21 +0000 Received: by mail-yw1-x1134.google.com with SMTP id 00721157ae682-609fd5fbe50so38831217b3.0 for ; Sun, 17 Mar 2024 11:31:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1710700277; x=1711305077; darn=lists.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=FzqCrQnHwX8UXBNjdVrrvDJ5fdl51uQBWaxsnAMOpw0=; b=KAVmVvqWAY0Tf+0lLvqK/+c8IzXLdjBL16FmfSabNz+n+NVbte7TMhInyqL/mNBVOK +5zcVi4VjV0tX22fRxtNjXfJpP3+MaaM2TRbMe2fEstSflr+lCn8Jdh9IDr2ad7+dPQM WUL9fkrWUIabFjfwosrltEPzg7BTnlh1PxFD8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710700277; x=1711305077; 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=FzqCrQnHwX8UXBNjdVrrvDJ5fdl51uQBWaxsnAMOpw0=; b=vmweUVwFP7RVujs2a1bSzKKY1CUqAfNmTvz7Nk4MdSIjnOsO9ERjXStLGAyOVhrsxo IS3S+1li6QQIcy5IZkD+kk3kobhcswLDL6oDifOy9DchzPFETn29h34+7BsdQDF1JoAT 1NHQOKlPzoRVSDaHaUYP0Axnu7heNWPzs6jgCR4yGiWmCvPUsKGVwqw8m7B104GhTNnF T8ZuDQU2ANXn/iHH1MHOX8noumG2vZXY8lHXe5G7iwtMjq3BRQaGyRHx1QlxCzCsRF2u LVGDfltBU7WlVINiPDI3ZlhW81mLqBtpEYySToXEytaMZCLd45OVjwSXV841IrE2hYi3 rH0g== X-Gm-Message-State: AOJu0Yx6sxqWjB688mxYSXfdty7/iWCfp4QST4UoViesIit8hCc904/Q wCs/WUSQI07wYbkppZXD7QdBLyLpAajEnER/l850Ld+nzO5r+av8jDr57D1Clg== X-Google-Smtp-Source: AGHT+IE/uOSNBR9D13Vzwrt2zpvl42OrhLdQIyneaURjRojbvcoAB9fZ8ZI0OkKMUodTshcESGsScw== X-Received: by 2002:a81:5b45:0:b0:610:cf0d:b4bc with SMTP id p66-20020a815b45000000b00610cf0db4bcmr198169ywb.4.1710700277026; Sun, 17 Mar 2024 11:31:17 -0700 (PDT) Received: from rfd.leadboat.com ([2600:1702:a20:5750::48]) by smtp.gmail.com with ESMTPSA id et4-20020a05690c2e0400b006042345d3e2sm1550283ywb.141.2024.03.17.11.31.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Mar 2024 11:31:16 -0700 (PDT) Date: Sun, 17 Mar 2024 11:31:14 -0700 From: Noah Misch To: "Drouvot, Bertrand" , Michael Paquier Cc: PostgreSQL Hackers Subject: Re: Autogenerate some wait events code and documentation Message-ID: <20240317183114.16@rfd.leadboat.com> References: <106e8d0a-0820-687a-7da5-3143e1f5b05b@gmail.com> <976f4eb1-cbc0-9616-ec26-ebb4a252315c@gmail.com> <69588eaf-02d7-95a8-0da4-3e120de16a59@gmail.com> <0b3cdac7-f078-61a6-76e0-99db7aae78ce@gmail.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 Wed, Jul 05, 2023 at 10:57:19AM +0900, Michael Paquier wrote: > I have applied it. I like the new developer experience of adding a wait event. After release of v17, how should we approach back-patching an event, like was done in commits 8fa4a1a 1396b5c 78c0f85? Each of those commits put the new event at the end of its released-branch wait_event.h enum. In v17, generate-wait_event_types.pl sorts events to position them. Adding an event will renumber others, which can make an extension report the wrong event until recompiled. Extensions citus, pg_bulkload, and vector refer to static events. If a back-patch added WAIT_EVENT_MESSAGE_QUEUE_SOMETHING_NEW, an old-build pg_bulkload report of WAIT_EVENT_PARALLEL_CREATE_INDEX_SCAN would show up in pg_stat_activity as WAIT_EVENT_PARALLEL_BITMAP_SCAN. (WAIT_EVENT_EXTENSION is not part of a generated enum, fortunately.) Some options: 1. Don't back-patch wait events to v17+. Use the closest existing event. 2. Let wait_event_names.txt back-patches control the enum order. For example, a line could have an annotation that controls its position relative to the auto-sorted lines. For another example, the generator could stop sorting. 3. Accept the renumbering, because the consequence isn't that horrible. Option (3) is worse than (1), but I don't have a recommendation between (1) and (2). I tend to like (1), a concern being the ease of accidental violations. If we had the ABI compliance checking that https://postgr.es/m/flat/CAH2-Wzk7tvgLXzOZ8a22aF-gmO5gHojWTYRvAk5ZgOvTrcEQeg@mail.gmail.com explored, (1) would be plenty safe. Should anything change here, or not?