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.92) (envelope-from ) id 1jDvK7-0002fE-Cp for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Mar 2020 19:22:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jDvK5-0000rG-Fe for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Mar 2020 19:22:49 +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 1jDvK5-0000r7-2d for pgsql-hackers@lists.postgresql.org; Mon, 16 Mar 2020 19:22:49 +0000 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jDvK2-0006Sr-3x for pgsql-hackers@lists.postgresql.org; Mon, 16 Mar 2020 19:22:48 +0000 Received: by mail-qk1-x743.google.com with SMTP id c145so28263109qke.12 for ; Mon, 16 Mar 2020 12:22:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=AfGirViGE2j98usXfKa00XW6aQ77rWc0a2p8HKCjmwc=; b=k11l/FCoT1VIQPG8b7Ikmelt6fXeEF53HYO9F4A4gVCvC0ogHIk371a6k6OYd/SZZg nEpSUhifg5jp2Tss2mEJZOgurvl6f32/jwT/S2+pIIZO+yAbAfeaAr9S+RMcUTWx/R+l TFETfLFgUDZ41+00NcKLjqEOs4I79M1/e1WxAWHhYht3BEl2ALvOOoxMr+DQdUcpo/I9 pLHeJ+gXqo2JiE33YKI7v0mCe/wcKWwOwj/jByBxMDk/NrGYmnFMq6Vi8JKlxioDEQ20 ioE39qAWwiUxmi5D8qUj+2uK1OntSK5CBWLp1CzlXwUIxuJcDimO9kKl042ShQIl5mon ml7A== 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:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=AfGirViGE2j98usXfKa00XW6aQ77rWc0a2p8HKCjmwc=; b=e+YmVersgQy2g3sKapMTWooB47KebyTF9rvKS8c03+TIcuGcpCGFgd6Xsgv/nh0ITP paM8dP9KkO29tDWRQh+tNmBhKuPPV05e2L02tRgbJXGqMJFj1ngPjGM9n21iyIlvxRJq C35WNVHeZYZNqimVlYp0SwT4RiG14AbJC95ot9t2JLpSgtlSG7pTPXDy5ge1LVr6yc3Q 1Xx6VEP0Mu5O7eeFR2ioUrTQS6rnDrC5EmOTI/4gJ8XS+gfCHcvYkjxMRMLMbj7YmOHp Oj3/eaKibKmEnL+k9LMiNuhY3EGxrs4+iAZaTQnSQyztYQ2kDMFxVxSvvH8TcpWujVTt X8rw== X-Gm-Message-State: ANhLgQ2MiRTIwVwSgpjRMljn7Bk3aBAF0Dp7p/BZ/5NEFPP49OdT1IUv BT+9RjZqfG0YzLxdNJ5Oyu8JFA== X-Google-Smtp-Source: ADFU+vtQpOWvinMCD0fMF5LH7mQxS68LFq/ynTsY+Pgj5VuJdkANedRsKu7rekfZxMyTuROKnDx+Bw== X-Received: by 2002:a05:620a:645:: with SMTP id a5mr1252978qka.493.1584386563253; Mon, 16 Mar 2020 12:22:43 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([201.186.208.119]) by smtp.gmail.com with ESMTPSA id p126sm388639qkd.108.2020.03.16.12.22.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2020 12:22:42 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id C59333006A2; Mon, 16 Mar 2020 16:22:17 -0300 (-03) Date: Mon, 16 Mar 2020 16:22:17 -0300 From: Alvaro Herrera To: Peter Eisentraut Cc: pgsql-hackers@lists.postgresql.org Subject: Re: pgsql: Unify several ways to tracking backend type Message-ID: <20200316192217.GA24733@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Mar-13, Peter Eisentraut wrote: > Unify several ways to tracking backend type > > Add a new global variable MyBackendType that uses the same BackendType > enum that was previously only used by the stats collector. That way > several duplicate ways of checking what type a particular process is > can be simplified. Since it's no longer just for stats, move to > miscinit.c and rename existing functions to match the expanded > purpose. Now that I look at this again, I realize that these backend-type descriptions are not marked translatable, which is at odds with what we do with HandlChildCrash, for example. Now, in addition to plastering _() to the strings, maybe we could use that new function in postmaster.c, say HandleChildCrash(pid, exitstatus, GetBackendTypeDesc(B_CHECKPOINTER)); and so on. Same with LogChildExit(). That'd reduce duplication. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services