Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jxje0-0008Nl-Iy for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Jul 2020 04:12:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jxjdy-0006yv-K7 for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Jul 2020 04:12:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jxjdy-0006yn-8S for pgsql-hackers@lists.postgresql.org; Tue, 21 Jul 2020 04:12:42 +0000 Received: from mail-io1-xd41.google.com ([2607:f8b0:4864:20::d41]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jxjdq-000840-VB for pgsql-hackers@postgresql.org; Tue, 21 Jul 2020 04:12:40 +0000 Received: by mail-io1-xd41.google.com with SMTP id e64so19947825iof.12 for ; Mon, 20 Jul 2020 21:12:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=KrzHhpUD8OlvRB1zH0LjrSWjB8BujNtRDNPbBBTJTcE=; b=NNL18SiXuy788Jog4NhGzMdavGIWpl6NIPTc/IOnXA5thtwI68r/3bNyjXcxxetBAO ytVEzrsOyhp8eOtxWlgaBSO7qx2tbFOCwMhkNRHYKsCcNIBN7jsFcrslNmhzyl0ugKku Y0f2WPlWPLShMs/20cf5jGAl11ASYUhLeTbpqPiBOWGZyzFor7TWryFwBUQRVK53Sl50 tW/+UgvVVSQaTvHj2XE+dZFCOSCJ097sWHOrcYrSi3U+6BSVN3tqJ+Na+Eel3KceAJIt resZPf8uASGFO02h+K+PWH+Gu1dfyM68EJ/6m0U9lvMIUVt2ZiauPUA9b9nLxRB+wjLu ra4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=KrzHhpUD8OlvRB1zH0LjrSWjB8BujNtRDNPbBBTJTcE=; b=r2u3VkuO4MujjonDjKtpObrXTmpod9jBjwowiNDToK7WpISE26L4GzdsW79+fPBWPj g7V3XDTtwb6nX9ZYnCBsmLQyOxtQlBkYQnEKRvf2NRkYwrTHiCUe/jt7EpYjV4q5yo9e wXHQKzaG6nIDXnK/Fp8x0/C9LqhuNwRljw8GKD3NDX9G9vg+4OtBc9NRWC0DnnoF1Dzi 1dszZl/QFVa8RZdV5n2mKgjGq3f9d0BhAjErinKXo/QI1PmvDEUqJWpoVsFrJDYUpPaG bxcXUatLSlOb5Qs1kutj1Mh6Magfw0sQAwsv/+9lN5DsjBGBXyF8V+c1b3z77APXfiql aFRA== X-Gm-Message-State: AOAM530Tra7nINnTq8b5+jbrLq/6wz4JoROJDMLssHNYf2EHrr1fwzxt 3d03FhIMnrYD0PI8OVe2WyUOZQ== X-Google-Smtp-Source: ABdhPJxwDUmgCwjIzm9JOR9iOImT2kFsdea50FdEItfMsPtxCu499LarGnxWZFz+myiVU0izPSxdNw== X-Received: by 2002:a6b:b246:: with SMTP id b67mr1976662iof.54.1595304753994; Mon, 20 Jul 2020 21:12:33 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id j28sm10370317ili.76.2020.07.20.21.12.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Jul 2020 21:12:33 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 4F706800171; Mon, 20 Jul 2020 23:12:31 -0500 (CDT) Date: Mon, 20 Jul 2020 23:12:31 -0500 From: Justin Pryzby To: Michael Paquier Cc: Alvaro Herrera , Julien Rouhaud , Tomas Vondra , pgsql-hackers@postgresql.org Subject: Re: expose parallel leader in CSV and log_line_prefix Message-ID: <20200721041231.GD5748@telsasoft.com> References: <20200717205421.GR23581@telsasoft.com> <20200717212721.GA3827@alvherre.pgsql> <20200717223236.GT23581@telsasoft.com> <20200720233048.GC5748@telsasoft.com> <20200721035145.GB17300@paquier.xyz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200721035145.GB17300@paquier.xyz> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, Jul 21, 2020 at 12:51:45PM +0900, Michael Paquier wrote: > And I'd rather keep the simple suggestion of upthread to leave the > field as NULL for the parallel group leader with a PID match but not a > backend type check so as this could be useful for other types of > processes. The documentation could talk about either: 1) "lock group leader" - low-level, raw view of the internal data structure (with a secondary mention that "for a parallel process, this is its parallel leader). 2) "parallel leaders" high-level, user-facing, "cooked" view; Right now it doesn't matter, but it seems that if we document the high-level "parallel leader", then we don't need to accomodate future uses (at least until the future happens). > diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml > index dc49177c78..15c598b2a5 100644 > --- a/doc/src/sgml/monitoring.sgml > +++ b/doc/src/sgml/monitoring.sgml > @@ -687,12 +687,9 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser > leader_pid integer > > > - Process ID of the parallel group leader if this process is or > - has been involved in parallel query, or null. This field is set > - when a process wants to cooperate with parallel workers, and > - remains set as long as the process exists. For a parallel group leader, > - this field is set to its own process ID. For a parallel worker, > - this field is set to the process ID of the parallel group leader. > + Process ID of the parallel group leader if this process is involved > + in parallel query, or null. For a parallel group leader, this field > + is NULL. > > FWIW , I prefer something like my earlier phrase: | For a parallel worker, this is the Process ID of its leader process. Null | for processes which are not parallel workers. -- Justin