Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bsIaq-0006o8-EL for pgsql-bugs@arkaria.postgresql.org; Fri, 07 Oct 2016 00:00:52 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bsIap-0002Ut-OX for pgsql-bugs@arkaria.postgresql.org; Fri, 07 Oct 2016 00:00:51 +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.84_2) (envelope-from ) id 1bsIaB-0001jq-Jt for pgsql-bugs@postgresql.org; Fri, 07 Oct 2016 00:00:11 +0000 Received: from mwork.nabble.com ([162.253.133.43]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bsIa7-0000jc-IO for pgsql-bugs@postgresql.org; Fri, 07 Oct 2016 00:00:10 +0000 Received: from mben.nabble.com (unknown [162.253.133.72]) by mwork.nabble.com (Postfix) with ESMTP id 6634E54CC59E5 for ; Thu, 6 Oct 2016 17:00:04 -0700 (MST) Date: Thu, 6 Oct 2016 17:00:04 -0700 (MST) From: =?UTF-8?B?5Y6a56ev6JaE5Y+R?= To: pgsql-bugs@postgresql.org Message-ID: <1475798404178-5924787.post@n3.nabble.com> Subject: When I set the synchronous_standby_names and synchronous_commit to off, the replication query state also show in sync mode. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.6 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org When I use the sync replation in PG9.6, I find a question about the query state display.The following is the testing steps: 1) set the postgresql.conf parameter synchronous_standby_names = '5(*)' synchronous_commit = on 2) start the standby node ,and query the replication state It shows that the replication in the sync mode. postgres=# select * from pg_stat_replication; -[ RECORD 1 ]----+------------------------------ pid | 2650 usesysid | 10 usename | houjibofa application_name | walreceiver client_addr | 127.0.0.1 client_hostname | client_port | 50816 backend_start | 2016-10-07 15:32:22.179723+08 backend_xmin | state | streaming sent_location | 0/70000F4 write_location | 0/70000F4 flush_location | 0/70000F4 replay_location | 0/70000F4 sync_priority | 1 sync_state | sync postgres=# show synchronous_commit; -[ RECORD 1 ]------+--- synchronous_commit | on 4) set the synchronous_commit to off, using the pg_ctl reload method postgres=# show synchronous_commit; -[ RECORD 1 ]------+---- synchronous_commit | off postgres=# select * from pg_stat_replication; -[ RECORD 1 ]----+------------------------------ pid | 2650 usesysid | 10 usename | houjibofa application_name | walreceiver client_addr | 127.0.0.1 client_hostname | client_port | 50816 backend_start | 2016-10-07 15:32:22.179723+08 backend_xmin | state | streaming sent_location | 0/70000F4 write_location | 0/70000F4 flush_location | 0/70000F4 replay_location | 0/70000F4 sync_priority | 1 sync_state | sync It also shows in the sync replication mode, however, it is in the async mode. And I can create a table in the primary mode. postgres=# show synchronous_standby_names; -[ RECORD 1 ]-------------+----- synchronous_standby_names | 5(*) postgres=# create table test(a int); CREATE TABLE The PG version is follows. postgres=# select version(); version ------------------------------------------------------------------------------------- ------------------- PostgreSQL 9.6.0 on i686-pc-linux-gnu, compiled by gcc (Ubuntu 5.3.1-14ubuntu2) 5.3. 1 20160413, 32-bit (1 row) I think the reason is that when get the replication priority in the function SyncRepGetStandbyPriority, it does not consider the parameter synchronous_commit. So if we set the synchronous_standby_names parameter and the standby fit the setting, no matter whether sync or not, it's priority will not equal to 0. -- View this message in context: http://postgresql.nabble.com/When-I-set-the-synchronous-standby-names-and-synchronous-commit-to-off-the-replication-query-state-a-tp5924787.html Sent from the PostgreSQL - bugs mailing list archive at Nabble.com. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs