Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1izcRr-0006Yg-88 for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Feb 2020 08:23:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1izcRp-0005KX-2y for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Feb 2020 08:23:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1izcRo-0005KQ-Og for pgsql-hackers@lists.postgresql.org; Thu, 06 Feb 2020 08:23:40 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1izcRn-0003B6-8q for pgsql-hackers@lists.postgresql.org; Thu, 06 Feb 2020 08:23:40 +0000 Received: by mail-wr1-x444.google.com with SMTP id m16so5976189wrx.11 for ; Thu, 06 Feb 2020 00:23:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ap7gi1XXE0YzWIv0ASMfpod/Q2HAmfcmNtKSJqyLlDg=; b=mhniZd9T9Zxazs/01+1ZndnBBTLiRp0uyzRnlTJtRlNqcq0THarJn4mxa1I/X/dTq3 vtqWbtKS4T9qaug5SKd1D3v6Hf2wlLc1d9UniC2Nco58OCiXzzFuyXH6zrKFxWUltSa3 BYuSm+RRYz9ztQ8dJa0IZi1H4/C5ttRBjM7XPmlFWMVpRw1qDU0c0z01Ip+kldmORART TED9mkt0y6dWlmWjjZC7RXC0FGPEZjYZzWMRZA0N/mjSJwNBfALj1bhsSCooqciH+qzS jVHSz6LHYaC6mHt1YGzh3AQkGPJSlonQv9YhR4W8Av6U0opfOdxM/sIc/Uk3RJf6Z+Qt ko3A== 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; bh=ap7gi1XXE0YzWIv0ASMfpod/Q2HAmfcmNtKSJqyLlDg=; b=k+CrWz+qsBYqdMfnZZwKDNEz9c0wCSYZ3LkeQ1qTB4a96UR8dfWl4OJu9YLZFW9EiE pnsp3mZUss4v3hyJq9EWmoIDazYciw2fa1HRJPC9Xg+IiDWJP8FviQCq3v1oIT859gUm 4qpmtmUl7KOi4euSQmOyVEll8nnQiHGfnRZ7weAS9BVoRM24xSen0YVsJhmA0cuwO2cz quakQItXTEo7q4yWfVV4TOjH9QI7HE8Z2j2RSEIp+uqq4Qm6HzDkvLD+j82UVfb50Xrk 78Ar3sxkCkL7Mbf74ctA29m0+P2U1+CklhUKXSAUr7NDFIKxyfzX2qkr3+A8caDF16P3 Z4Gw== X-Gm-Message-State: APjAAAU6GydkWlOURT2rCvuYUzJ6kYtW6g7O0h2p/zssumg0mCPU2aPo AMGbGPQ4HRc/jX0wdijsIYYZbOpcYO5LFA== X-Google-Smtp-Source: APXvYqx4LX31GKsbTekYkB4PSXUg035XYndwHNYY5AEuhggCQ7rKIywoX5cAoA2c7cfN9ubMSseg5g== X-Received: by 2002:a05:6000:1205:: with SMTP id e5mr2579725wrx.55.1580977416374; Thu, 06 Feb 2020 00:23:36 -0800 (PST) Received: from nol (82-64-124-11.subs.proxad.net. [82.64.124.11]) by smtp.gmail.com with ESMTPSA id y1sm3202665wrq.16.2020.02.06.00.23.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2020 00:23:35 -0800 (PST) Date: Thu, 6 Feb 2020 09:23:33 +0100 From: Julien Rouhaud To: Michael Paquier Cc: Tomas Vondra , Sergei Kornilov , Guillaume Lelarge , PostgreSQL Hackers Subject: Re: Expose lock group leader pid in pg_stat_activity Message-ID: <20200206082333.GA95343@nol> References: <20200118025102.GB230692@paquier.xyz> <20200128130910.anay3mlhaminob6w@development> <20200128135208.6tnr72gamv2dr262@development> <20200130130301.GC130922@paquier.xyz> <20200204142725.GA30965@nol> <20200205014831.GC23913@paquier.xyz> <20200205065720.GA31242@nol> <20200206002416.GD23913@paquier.xyz> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="zhXaljGHf11kAtnf" Content-Disposition: inline In-Reply-To: <20200206002416.GD23913@paquier.xyz> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --zhXaljGHf11kAtnf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Feb 06, 2020 at 09:24:16AM +0900, Michael Paquier wrote: > On Wed, Feb 05, 2020 at 07:57:20AM +0100, Julien Rouhaud wrote: > > This looks good, thanks a lot! > > Thanks for double-checking. And done. Thanks! While on the topic, is there any reason why the backend stays a group leader for the rest of its lifetime, and should we change that? Also, while reading ProcKill, I noticed a typo in a comment: /* * Detach from any lock group of which we are a member. If the leader - * exist before all other group members, it's PGPROC will remain allocated + * exist before all other group members, its PGPROC will remain allocated * until the last group process exits; that process must return the * leader's PGPROC to the appropriate list. */ --zhXaljGHf11kAtnf Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="prockill-typo.diff" diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c index 32df8c85a1..eb321f72ea 100644 --- a/src/backend/storage/lmgr/proc.c +++ b/src/backend/storage/lmgr/proc.c @@ -851,7 +851,7 @@ ProcKill(int code, Datum arg) /* * Detach from any lock group of which we are a member. If the leader - * exist before all other group members, it's PGPROC will remain allocated + * exist before all other group members, its PGPROC will remain allocated * until the last group process exits; that process must return the * leader's PGPROC to the appropriate list. */ --zhXaljGHf11kAtnf--