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 1jHaUe-0002L7-Bi for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Mar 2020 21:56:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jHaUb-0002kv-TV for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Mar 2020 21:56:49 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jHaUb-0002ko-5O for pgsql-hackers@lists.postgresql.org; Thu, 26 Mar 2020 21:56:49 +0000 Received: from mail-qv1-xf41.google.com ([2607:f8b0:4864:20::f41]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jHaUT-0006pl-DQ for pgsql-hackers@postgresql.org; Thu, 26 Mar 2020 21:56:47 +0000 Received: by mail-qv1-xf41.google.com with SMTP id ca9so3936370qvb.9 for ; Thu, 26 Mar 2020 14:56:40 -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=tYlrXkO1s7Cyl+QE316Kr/iuHe9Ec1T5RG8b186tmic=; b=HEZZHdiLuphq6lbeas8Q8Pd1udgbP4xPWLC7hNVhk8T7isrtS63nsA8JWBsWcR1sbS p0Am3/jheJwABplrNuPmIMTTAPykUqm3xT+zynFdjb/oIq8therqfns2JNgfAipPCmmo CdRjJ0GKqsie5+O/HmywbLgcUX/27b5yd0fy7uKkDGtZx/nGE9O4sATM2cvyeafdPPRx xFJBgO/lDGGTXEsEj8ihrv2w+sUduPvu4+EzXmFUX/5wmA4EV06pbVsg7VJ34ClOqEsr +3mv+dOY7BRbTnnHeKOjyeSxHWMcLHNp0M9KlIZAjf1nJrXkAuUw4MkEqHumW5SO/kIx 047A== 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=tYlrXkO1s7Cyl+QE316Kr/iuHe9Ec1T5RG8b186tmic=; b=lpgFsn+EA7WQG+st7pdwc7WrYFO90JxF2brIyb9t1p1Cv8wZgzcPhARqniAbqMvDn8 82GckI/bOuk+V0Nn4Xm4AJ47JQxZZX3KF0iJZW9L7Z5NA5CBfsbvNApIUQ2ySgncNwO4 LnC4MIhY1hHP6b0PUFBc17IiwAFvqXSENGJRxkQ/LeNQ2aELTq2x11ohESBnnmoEPfU6 leO9TXKBzRudD1f6HWgIKsoVozNbfeFsjRaw7IfKcVgkbulL1IButF27Epmqv7cSnUVJ 4t32dYTfOA75G07eU6mYjGPwML0jAgtf9giqo0+fxwz7PT8coPuPQI6ka2m39edLdZKe 46sw== X-Gm-Message-State: ANhLgQ0Zrn1vijaky7RYAj4Ykw9YYvTQ0PdPpGl3TsQmsiK6JNRRTHfZ rtEJHGimO/Ryc3kmYktsvGLxbA== X-Google-Smtp-Source: ADFU+vv/pTQD3+qrJDZf6d6dIr11ywaPqP7YQSrSSem4nZhvmcCuLXCc+tnCiW2MB1asnGNShja34g== X-Received: by 2002:ad4:498c:: with SMTP id t12mr11083145qvx.27.1585259800074; Thu, 26 Mar 2020 14:56:40 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.95.18.252]) by smtp.gmail.com with ESMTPSA id d22sm2437785qte.93.2020.03.26.14.56.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 14:56:39 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id C134B3007F7; Thu, 26 Mar 2020 18:56:36 -0300 (-03) Date: Thu, 26 Mar 2020 18:56:36 -0300 From: Alvaro Herrera To: Michael Paquier Cc: Alexander Korotkov , Kuntal Ghosh , Alexey Kondratov , Liudmila Mantrova , Thomas Munro , Andrey Borodin , David Steele , Andres Freund , PostgreSQL-development , Dmitry Dolgov <9erthalion6@gmail.com>, vladimirlesk@yandex-team.ru, dsarafan@yandex-team.ru Subject: Re: [Patch] pg_rewind: options to use restore_command from recovery.conf or command line Message-ID: <20200326215636.GA18768@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200326073458.GJ1471@paquier.xyz> 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-26, Michael Paquier wrote: > I was looking at this patch again today and I am rather fine with the > existing semantics. Still I don't like much to name the frontend-side > routine FrontendRestoreArchivedFile() and use a different name than > the backend counterpart because we have to include xlog_internal.h in > fe_archive.c to be able to grab XLOGDIR. Uh, is XLOGDIR the only reason to include xlog_internal.h? Maybe it would be easier to have a routine in xlog.c that returns the path? There's a few functions in xlog.c that could use it, as well. Altough ... looking at xlog.h, that one is even worse, so I'm not sure *where* you'd put the prototype for the new function I'm proposing. > So here is an idea: let's move the declaration of the routines part of > xlogarchive.c to a new header, called xlogarchive.h, and then let's > use the same routine name for the frontend and the backend in this > second patch. We include xlog_internal.h already in many frontend > tools, so that would clean up things a bit. The patch downthread looks decent cleanup, but I'm not sure how it helps further the objective. (A really good cleanup could be a situation where frontend files don't need xlog_internal.h -- for example, maybe a new file xlogpage.h could contain struct defs that relate to page and segment headers and the like, as well as useful macros. I don't know if this can be made to work -- but xlog_internal.h contains stuff like xl_parameter_change etc as well as RmgrData which surely are of no interest to readers of wal files ... or, say, RequestXLogSwitch.) I don't think any such cleanup should hamper the patch at hand anyway. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services