Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YvWwl-0005DM-P6 for pgsql-admin@arkaria.postgresql.org; Thu, 21 May 2015 20:20:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YvWwl-0005I9-47 for pgsql-admin@arkaria.postgresql.org; Thu, 21 May 2015 20:20:03 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YvWwk-0005Hx-6y for pgsql-admin@postgresql.org; Thu, 21 May 2015 20:20:02 +0000 Received: from imx3.etecsa.cu ([200.55.152.137]) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1YvWwf-0005Zg-Dm for pgsql-admin@postgresql.org; Thu, 21 May 2015 20:20:00 +0000 Received: from Unknown ([192.168.91.42] helo=mn2.etecsa.cu) by imx3.etecsa.cu with ESMTP id tGIblK3Y13346; Thu, 21 May 2015 16:18:37 -0400 Received: (qmail 28553 invoked by uid 11185); 21 May 2015 21:19:05 -0000 Received: from 192.168.91.6 by mn2.etecsa.cu (envelope-from , uid 502) with qmail-scanner-2.08 (spamassassin: 3.2.5. Clear:RC:1(192.168.91.6):. Processed in 0.062558 secs); 21 May 2015 21:19:05 -0000 Received: from unknown (HELO webmail.etecsa.cu) ([192.168.91.6]) (envelope-sender ) by mn2.etecsa.cu (qmail-ldap-1.03) with SMTP for ; 21 May 2015 21:19:05 -0000 Received: from 192.168.207.54 (SquirrelMail authenticated user gilberto.castillo) by webmail.etecsa.cu with HTTP; Thu, 21 May 2015 16:19:04 -0500 (GMT+5) Message-ID: <44694.192.168.207.54.1432243144.squirrel@webmail.etecsa.cu> In-Reply-To: References: Date: Thu, 21 May 2015 16:19:04 -0500 (GMT+5) Subject: Re: Postgres Synchronous replication From: "Gilberto Castillo" To: "Keith" Cc: "Ravi Krishna" , "Payal Singh" , "pgsql-admin@postgresql.org" Reply-To: gilberto.castillo@etecsa.cu User-Agent: SquirrelMail/1.4.8-5.el5_4.10 MIME-Version: 1.0 X-Priority: 3 (Normal) Importance: Normal X-SpamTest-Envelope-From: gilberto.castillo@etecsa.cu X-SpamTest-Info: Profiles 72422 [Jan 28 2015] X-SpamTest-Method: none X-SpamTest-Rate: 0 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0285], KAS30/SDK/Release X-Anti-Virus: Kaspersky Mail Gateway, version: 5.6.28/RELEASE, bases: 20140401T050822 #7726142, check: 20150521 clean Content-Type: multipart/mixed; boundary="=tGIclW8g81588=imx3.etecsa.cu=" X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org This is a multi-part message in MIME format. --=tGIclW8g81588=imx3.etecsa.cu= Content-Disposition: inline Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: 8bit > On Thu, May 21, 2015 at 4:10 PM, Ravi Krishna > wrote: > >> >> AFAIK the commit on master happens only after it receives ack from the >>> slave. This is how synchronous replication ensures that the slave is'in >>> sync'. >>> >> >> >> If that is the case , then why does PG find it impossible to sync back >> with the primary after a crash. >> Other products offering similar technology do not have this issue. >> >> In my opinion this is quite a serious limitation with PG replication. >> Every time the primary crashes and the business continues with the >> promotion of standby as the new primary, the crashed server has to be >> reinitialized for the set up of the replication. >> >> >> >>> >>> On Thu, May 21, 2015 at 3:56 PM, Ravi Krishna >>> wrote: >>> >>>> I want to understand how PG sync replication works. This is what I >>>> know >>>> (assuming two node sync replication) >>>> >>>> 1 - Application issues commit. >>>> 2 - PG commits the transaction locally on the primary server. >>>> 3 - At this stage the application has not got the commit indication >>>> back. >>>> 4 - PG transmits the transaction from the local to the remote server. >>>> 5 - Remote server sends back acknowledgement >>>> 6 - The app gets commit ack back. >>>> >>>> So this means, between step 2 and step 6, the app is not aware that >>>> the >>>> transaction has already been committed. >>>> This is the reason why, in the event of server crashing between step 2 >>>> and step 6, and the remote takes over as the >>>> new primary, the crashed server can not restart as standby and the >>>> only >>>> option is to recreate the db from the remote >>>> server (which is now acting as the primary). >>>> >>>> Am I correct in the understanding? >>>> >>>> One more question: In Step 5, does the remote harden the transaction >>>> on >>>> the disk, or merely receives the transaction in the log buffer and it >>>> sends >>>> back ACK to the local server. >>>> >>>> Thanks >>>> >>> >>> >> > > This issue has been address with pg_rewind in the upcoming 9.5 major > version release > > http://hlinnaka.iki.fi/2015/03/23/pg_rewind-in-postgresql-9-5/ pg_rewind is used 9.3 onwards Saludos, Gilberto Castillo ETECSA, La Habana, Cuba --=tGIclW8g81588=imx3.etecsa.cu= Content-Type: text/plain Content-Disposition: inline --- This message was processed by Kaspersky Mail Gateway 5.6.28/RELEASE running at host imx3.etecsa.cu Visit our web-site: , --=tGIclW8g81588=imx3.etecsa.cu= Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin --=tGIclW8g81588=imx3.etecsa.cu=--