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 1j5wDO-0001Bi-Gh for pgsql-general@arkaria.postgresql.org; Sun, 23 Feb 2020 18:42:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j5wDN-0007iG-AT for pgsql-general@arkaria.postgresql.org; Sun, 23 Feb 2020 18:42:53 +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 1j5wDN-0007gT-04 for pgsql-general@lists.postgresql.org; Sun, 23 Feb 2020 18:42:53 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j5wDF-0000B2-Nu for pgsql-general@postgresql.org; Sun, 23 Feb 2020 18:42:52 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 9F2E020E15; Sun, 23 Feb 2020 13:42:43 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Sun, 23 Feb 2020 13:42:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=4 QSE35shz5nkg/X6XLW71qAONoSwvsW/8x7T6UMt0Jw=; b=SfSnyYrYIePNrqUuv aEM5CLVkS+JAGtVyGVQfVupn7jBtqHDM+q5C9DF9HFomPiE2gFcJBWC/RBmE/4+t SXaYZAeckq/djJJWZwYAuAoJRPeQqc+r2hDOBH3wsHlJgXuBMH5u7Um0Kfc/wpT8 z8IOUkew+V/RRnYF+ALMRBzsHeF7/gF9QG3isBqvjt6joPwTaxL6iKtPTCu8nA4h FGiw4X6/yDPqu7uJn0qI2wz6O5bLIN80wlxj8z5H3Re/Iy1kijlr8ImMKoTtUTIF lGPLY1czAZFAZhbkKyrxzuAwzaPCl9zwzuFF7dN6Wdmo2x3FgburWlI2gUQ9ehbn KWqtw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=4QSE35shz5nkg/X6XLW71qAONoSwvsW/8x7T6UMt0 Jw=; b=bQJd83p+ak8CmGGvA2KoFzhigFlgElf+X8AnegvrwO5FVnf9rZCsfGCsO AHbX0G8awaP3o+cvdfPEI6OB4/VQqmZxkCmxfHlh9Tghqoa2L9HY03j7WraCPhhN +gyHKyOGMAHScLnduLcLXPspIHWAYQIBEJkg8y7veT5NPI4Le/pskplZB4aWQXCH 9o9zsct7qEcQRtLcqcSziwW5xf1yZpsLhkxh0BaFmEa38P1uKr8siR9O8DCX9iOo tRiQBdC3fpZIs+IH0trTdyjth/6vWuxb0SFl/G33AhDVrlySzo8oDtOHLD208RHz NZ7/yu4FMYiWsuH4yEEwbXdm5YNZQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrkeekgdduudeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefheenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgnecukfhppeejuddrvddu vddruddvledrudelfeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: from [192.168.1.10] (unknown [71.212.129.193]) by mail.messagingengine.com (Postfix) with ESMTPA id 0C6693060F09; Sun, 23 Feb 2020 13:42:42 -0500 (EST) Subject: Re: Replication: slave server has 3x size of production server? To: Edson Richter , pgsql-general References: <98f036e0-9bf2-8798-8742-9dba0601fb9a@aklaver.com> <590174e0-256a-fe72-468a-0bcf77ca0df8@aklaver.com> <46ab8dff-645a-0521-16e8-821db6fc6d9c@aklaver.com> <22dad45b-7d11-807e-c258-1e9872561f3b@aklaver.com> From: Adrian Klaver Message-ID: <50b09faf-4005-ce14-9f1d-4534e849efab@aklaver.com> Date: Sun, 23 Feb 2020 10:42:42 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2/23/20 8:04 AM, Edson Richter wrote: > ------------------------------------------------------------------------ > > *De:* Adrian Klaver > *Enviado:* sábado, 22 de fevereiro de 2020 20:34 > *Para:* Edson Richter ; pgsql-general > > *Assunto:* Re: Replication: slave server has 3x size of production > server? > On 2/22/20 2:51 PM, Edson Richter wrote: > > > > > Yes, it is working. Last X'log file is present on all thee servers. > > Also, comparting last transaction number on master and slave shows that > > all are in sync. > > Last, but not least, select max(id) from a busy table shows same id > > (when queried almost simultaneously using a simple test routine). > > Well something is keeping those WAL file around. You probably should > analyze your complete setup to see what else is touching those servers. > > > It is safe to add a "--remove-source-files" into my archive_command as > folows into my slave server? I would say not. See: https://www.postgresql.org/docs/12/wal-configuration.html "Checkpoints are points in the sequence of transactions at which it is guaranteed that the heap and index data files have been updated with all information written before that checkpoint. At checkpoint time, all dirty data pages are flushed to disk and a special checkpoint record is written to the log file. (The change records were previously flushed to the WAL files.) In the event of a crash, the crash recovery procedure looks at the latest checkpoint record to determine the point in the log (known as the redo record) from which it should start the REDO operation. Any changes made to data files before that point are guaranteed to be already on disk. Hence, after a checkpoint, log segments preceding the one containing the redo record are no longer needed and can be recycled or removed. (When WAL archiving is being done, the log segments must be archived before being recycled or removed.)" So there is a window where a WAL is written but before the data it represents is check pointed, so it still needed. > > > archive_command = 'rsync --remove-source-files -e "ssh -2 -C -p 2022" > -az %p barman@192.168.0.2:/dados/barman/dbcluster/incoming/%f' > > > and remove the xlog file after copy to barman? > I mean, whem the archive command starts, the wal has been already > processed by the slave server, so we don't need them after copying to > backup server, right? > > > Regards, > > Edson > > > > >     > > >     > > >     > The files are about 7 months old. > > > >     Are there newer files that would indicate that the streaming is working? > > > > > > Yes, streaming is working properly (as stated above). > > > > Thanks, > > > > > > Edson Richter > > > > > >> > > > > -- > Adrian Klaver > adrian.klaver@aklaver.com > -- Adrian Klaver adrian.klaver@aklaver.com