Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1er78e-0003g1-Tj for pgsql-admin@arkaria.postgresql.org; Wed, 28 Feb 2018 19:11:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1er78d-0005xF-6i for pgsql-admin@arkaria.postgresql.org; Wed, 28 Feb 2018 19:11:39 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1er78c-0005x4-SJ for pgsql-admin@lists.postgresql.org; Wed, 28 Feb 2018 19:11:39 +0000 Received: from shopzeus.com ([87.229.70.149]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1er78a-00008D-BL for pgsql-admin@lists.postgresql.org; Wed, 28 Feb 2018 19:11:37 +0000 Received: from [127.127.127.127] (localhost [127.127.127.127]) (Authenticated sender: gandalf) by shopzeus.com (Postfix) with ESMTPSA id 40872889B83C; Wed, 28 Feb 2018 13:09:03 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shopzeus.com; s=shopzeus_com; t=1519841343; bh=GN+2baCzNBub9WQrp1vvsGdXP8TJZIrkaWFhbkDFHP8=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=e/2oZfou1eO86s+azJdH76VQIHzTRN81ZnDyuMtcG9ZkVjPcChpxIHqsNMxcDvfpT rqtVbwHL4zIT0pq6DHPow4WFafdMLNuycuehEZIstKxjjoJUPRjJv7P4+X8PcPFDiv YaibIg+uZZmx9eWr1rjfWMh9S9khZtQ++kwr80e49pUj3wHiSJ7NTHiDdS21Ec1XIu RqVwHcRI42HAWN8xqBzP0V9oqL32fIhgKKgb7OsavVQXR1ZMI6CWGkxzCR/2vnNxhM EFr2eHbyWfm5O+N9pxuRgisZ4/fFY6hnLmWALFymLwSoX8KSKQA812i/9b4mgmmsV3 vbZsp01y9a+sg== Subject: Re: Reliable WAL file shipping over unreliable network To: Rui DeSousa Cc: pgsql-admin@lists.postgresql.org References: <400AC9CD-1E43-422C-A689-70BDBAFF231E@elevated-dev.com> <954e01b6-b240-eb9a-5feb-8efd202fef5a@shopzeus.com> <285DC762-7035-4313-B550-5DA2273D7066@icloud.com> From: =?UTF-8?Q?Nagy_L=c3=a1szl=c3=b3_Zsolt?= Message-ID: <10bea809-cf89-4e5d-6064-95dd95164e20@shopzeus.com> Date: Wed, 28 Feb 2018 20:11:33 +0100 MIME-Version: 1.0 In-Reply-To: <285DC762-7035-4313-B550-5DA2273D7066@icloud.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Language: hu List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 2018. 02. 28. 19:11 keltez=C3=A9ssel, Rui DeSousa =C3=ADrta: > Easiest thing to do is to keep the replica from seeing the file until > it=E2=80=99s=C2=A0successfully transferred; i.e. > > 1. Transfer the file successfully first with a temporary extension: =C2= =A0 > $ARCH_DIR/$WALFILE.swap > 2. If successfully transferred then move it into place: > =C2=A0 =C2=A0 mv $ARCH_DIR/$WALFILE.swap $ARCH_DIR/$WALFILE This works ONLY if the directory is mounted on the master, and you can execute "mv" on the master (as part of the archive_command) to rename the file that is stored on the slave. But the original question specified that mounting is not an option.