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 1hpc4M-00077p-4v for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Jul 2019 17:25:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hpc4J-0001jo-KY for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Jul 2019 17:25:47 +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 1hpc4J-0001jh-Bm for pgsql-hackers@lists.postgresql.org; Mon, 22 Jul 2019 17:25:47 +0000 Received: from mail-vs1-f66.google.com ([209.85.217.66]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hpc4G-0001yY-Pt for pgsql-hackers@postgresql.org; Mon, 22 Jul 2019 17:25:46 +0000 Received: by mail-vs1-f66.google.com with SMTP id u3so26701470vsh.6 for ; Mon, 22 Jul 2019 10:25:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:cc:references:from :organization:message-id:date:user-agent:mime-version:in-reply-to :content-language; bh=H8UrBkDIV7i69N9cd7QwxlumDx3DiLQQO+mvZr3VsDE=; b=h+phmWb+IjWPOI3SYwdFK/ZBkBvgRzZl6avuqQi6dkbWNKUSoekaOtJKOGjTul05Q8 iR4cF2Ly6kIY57yhUf3dchPE+n77Fq335q2YgVq3FzZbeoIzSNxlKM+sjAWjcf/irC+A hsYS+ZU811yKQDCcKSMQE6V8k0Gs9fOc1Fl+dcrYmcfdhQPRcdXEA6xM50RIoNMtM5Ex qQExXDVd/XBU+0kldd9znZMX2joDNnzmAMat8V+RXzcX4WOYIVWoHzA97BXqjX3oLsuK eN009cLRZc4/C+cxOdukPf/cfGq4SFN+vOc9RPRFum9eZsqabEYB2UBfjeBiquPTd5Ax pJKw== X-Gm-Message-State: APjAAAU4yUkAdXfgU5mewnqNlmYiAPhMYv5SUlKRiIwdJ1Amjq1CEDyi QDI2dpwdgaeTKGa3Eag4CbNSmqg3wQ8F6g== X-Google-Smtp-Source: APXvYqxbAQsq7BZ8RmHFrFtgc708ZhO3t9X5hETHg9u9CXAbKKNVe/vu/sauOvWRoXN/K/d4gcVJdw== X-Received: by 2002:a67:e350:: with SMTP id s16mr42178827vsm.91.1563816343114; Mon, 22 Jul 2019 10:25:43 -0700 (PDT) Received: from localhost.localdomain (c-24-61-8-151.hsd1.ma.comcast.net. [24.61.8.151]) by smtp.gmail.com with ESMTPSA id h61sm8861741uah.18.2019.07.22.10.25.41 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jul 2019 10:25:42 -0700 (PDT) Reply-To: jesper.pedersen@redhat.com Subject: Re: pg_receivewal documentation To: Michael Paquier , Robert Haas Cc: Laurenz Albe , Alvaro Herrera , PostgreSQL-development References: <20190710142421.GA28387@alvherre.pgsql> <54779de5-f922-c0cf-629d-b582eded7265@redhat.com> <20190716050555.GA1439@paquier.xyz> <65c3ecdf-8995-34cb-83c4-50068877e632@redhat.com> <20190717013835.GA2130@paquier.xyz> <20190722014851.GC1757@paquier.xyz> From: Jesper Pedersen Organization: Red Hat Message-ID: <9fea76ce-6912-c262-6f64-2b7c4496be65@redhat.com> Date: Mon, 22 Jul 2019 13:25:41 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190722014851.GC1757@paquier.xyz> Content-Type: multipart/mixed; boundary="------------DDBDA98E782E7B413C0604FE" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------DDBDA98E782E7B413C0604FE Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Hi, On 7/21/19 9:48 PM, Michael Paquier wrote: >> Since pg_receivewal does not apply WAL, you should not allow it to >> become a synchronous standby when synchronous_commit = remote_apply. >> If it does, it will appear to be a standby which never catches up, >> which may cause commits to block. To avoid this, you should either >> configure an appropriate value for synchronous_standby_names, or >> specify an application_name for pg_receivewal that does not match it, >> or change the value of synchronous_commit to something other than >> remote_apply. >> >> I think that'd be a lot more useful than enumerating the total-failure >> scenarios. > > +1. Thanks for the suggestions! Your wording looks good to me. +1 Here is the patch for it, with Robert as the author. Best regards, Jesper --------------DDBDA98E782E7B413C0604FE Content-Type: text/x-patch; name="v9_pgreceivewal-doc.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="v9_pgreceivewal-doc.patch" From a6512e79e9fd054b188489757ee622dbf98ddf2b Mon Sep 17 00:00:00 2001 From: jesperpedersen Date: Mon, 22 Jul 2019 13:19:56 -0400 Subject: [PATCH] Highlight that pg_receivewal doesn't apply WAL, and as such synchronous-commit needs to be remote_write or lower. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Author: Robert Haas Review-by: Michael Paquier, Álvaro Herrera, Laurenz Albe and Jesper Pedersen --- doc/src/sgml/ref/pg_receivewal.sgml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/doc/src/sgml/ref/pg_receivewal.sgml b/doc/src/sgml/ref/pg_receivewal.sgml index e96d753955..beab6f0391 100644 --- a/doc/src/sgml/ref/pg_receivewal.sgml +++ b/doc/src/sgml/ref/pg_receivewal.sgml @@ -52,7 +52,16 @@ PostgreSQL documentation Unlike the WAL receiver of a PostgreSQL standby server, pg_receivewal by default flushes WAL data only when a WAL file is closed. The option must be specified to flush WAL data - in real time. + in real time. Since pg_receivewal does not apply WAL, + you should not allow it to become a synchronous standby when + equals remote_apply. + If it does, it will appear to be a standby which never catches up, + which may cause commits to block. To avoid this, you should either + configure an appropriate value for , or + specify an application_name for + pg_receivewal that does not match it, or change the value of + to something other than + remote_apply. @@ -207,16 +216,6 @@ PostgreSQL documentation server as a synchronous standby, to ensure that timely feedback is sent to the server. - - - Note that while WAL will be flushed with this setting, - pg_receivewal never applies it, - so must not be set - to remote_apply or on if - pg_receivewal is a synchronous standby, be it a - member of a priority-based (FIRST) or a - quorum-based (ANY) synchronous replication setup. - -- 2.21.0 --------------DDBDA98E782E7B413C0604FE--