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 1rm1qn-005ZC8-5t for pgsql-hackers@arkaria.postgresql.org; Mon, 18 Mar 2024 01:31:41 +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 1rm1ql-00EHYe-36 for pgsql-hackers@arkaria.postgresql.org; Mon, 18 Mar 2024 01:31:39 +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 1rm1qk-00EHYW-Gw for pgsql-hackers@lists.postgresql.org; Mon, 18 Mar 2024 01:31:39 +0000 Received: from mail-yw1-x112b.google.com ([2607:f8b0:4864:20::112b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rm1qh-0056DM-US for pgsql-hackers@lists.postgresql.org; Mon, 18 Mar 2024 01:31:38 +0000 Received: by mail-yw1-x112b.google.com with SMTP id 00721157ae682-60a0579a931so37534387b3.0 for ; Sun, 17 Mar 2024 18:31:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1710725493; x=1711330293; 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=wafD1q7t4PhAq6Zbt0BCFRKLau14gEP43K1Cmal0pgQ=; b=LtFZwvBKTPjjqtZaNs+Kjp8jSD23RWtzjU3iPSLutoyGLfRua5/Q3BsxzRwwawdFbX kSrUzKSdsTkJjv7qt4hqXzBl7qrq/fnlvt+YyUzgnqnL8Zpj8mT93sqQByOZbb4JCh7z eEppfHOjzwjqCF5Klz6n7H8qu6JXEvTeUfMss= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710725493; x=1711330293; 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=wafD1q7t4PhAq6Zbt0BCFRKLau14gEP43K1Cmal0pgQ=; b=XsZ+Oah6i7XQmuuYvQwVX5f9Nw8LxBw36wxAUZGqpL4g2wDfAnwRYIAS4PkVzCf3ps U/PxHkH3D/6+T6QdlHWuqe6TrPNuO7oRgIJ/nZdWxkz1xPiJLafEG416mTBH/be9NL0l sKtLZBbnk4P0s9b+fCw0nZpryvzTnqkiFBc3XxREiO1q9IuvWRGSMUQT0IjnxqJakDn3 Biqg6wkNDe44xpWkX/6lGkILnLkBBKWFE6OCQshrumtofB8LShs0jFSG7iEOuKiBUPv3 6DEpsMnoXPvgXhEctDiVTMsG4Esl8cBeFk3yIGzsva83TAJHN0pMmvfOtTUVnSFZsFcu jTNA== X-Forwarded-Encrypted: i=1; AJvYcCXxOv6eBKJV0gAheX5pvUzloj48OfhjWQMr2XkticWMxKRp3avkIFj1p7ZgxWbc30pWJacskL1obsyn3QLtHwYeofqSFjLwNkyliZrXBImCehDH X-Gm-Message-State: AOJu0YxBInWpNZnk7JCP0JZ6/IaHg4uRq8ufLku9Sb04zhcts//xnKsC 97xYJh4Hd5t+/WVlgOJgy2QPFvBEwJTeTNwqYHO/oxwz4y/eZlIy9cp/4we1sQ== X-Google-Smtp-Source: AGHT+IFGIeUKR5FDCGWFwRwE7gcZ+Q5jPN5UXdJF8w6WsrdKZXdH53WvWnhFiEGbJta3/7yRHA7xaA== X-Received: by 2002:a0d:fd87:0:b0:609:e4b4:c2fb with SMTP id n129-20020a0dfd87000000b00609e4b4c2fbmr9559374ywf.27.1710725493414; Sun, 17 Mar 2024 18:31:33 -0700 (PDT) Received: from rfd.leadboat.com ([2600:1702:a20:5750::48]) by smtp.gmail.com with ESMTPSA id w64-20020a814943000000b0060a2c381287sm1759785ywa.125.2024.03.17.18.31.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Mar 2024 18:31:32 -0700 (PDT) Date: Sun, 17 Mar 2024 18:31:30 -0700 From: Noah Misch To: Michael Paquier Cc: "Drouvot, Bertrand" , PostgreSQL Hackers Subject: Re: Autogenerate some wait events code and documentation Message-ID: <20240318013130.e5@rfd.leadboat.com> References: <976f4eb1-cbc0-9616-ec26-ebb4a252315c@gmail.com> <69588eaf-02d7-95a8-0da4-3e120de16a59@gmail.com> <0b3cdac7-f078-61a6-76e0-99db7aae78ce@gmail.com> <20240317183114.16@rfd.leadboat.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, Mar 18, 2024 at 08:02:24AM +0900, Michael Paquier wrote: > > 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. > I see an option (4), similar to your (2) without the per-line > annotation: add a new magic keyword like the existing "Section" that > is used in the first lines of generate-wait_event_types.pl where we > generate tab-separated lines with the section name as prefix of each > line. So I can think of something like: > Section: ClassName - WaitEventFoo > FOO_1 "Waiting in foo1" > FOO_2 "Waiting in foo2" > Backpatch: > BAR_1 "Waiting in bar1" > BAR_2 "Waiting in bar2" > > Then force the ordering for the docs and keep the elements in the > backpatch section at the end of the enums in the order in the txt. > One thing that could make sense is to enforce that "Backpatch" is at > the end of a section, meaning that we would need a second keyword like > a "Section: EndBackpatch" or something like that. That's not strictly > necessary IMO as the format of the txt is easy to follow. Works for me, with or without the trailing keyword line.