Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oq6y3-0007xr-KF for pgsql-admin@arkaria.postgresql.org; Wed, 02 Nov 2022 06:11:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oq6y2-0006zC-GW for pgsql-admin@arkaria.postgresql.org; Wed, 02 Nov 2022 06:11:14 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oq6y2-0006z3-2r for pgsql-admin@lists.postgresql.org; Wed, 02 Nov 2022 06:11:14 +0000 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oq6xv-0004vs-Ku for pgsql-admin@lists.postgresql.org; Wed, 02 Nov 2022 06:11:12 +0000 Received: by mail-wr1-x42d.google.com with SMTP id w14so22965578wru.8 for ; Tue, 01 Nov 2022 23:11:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=HCdkoPRlVU+SxnGbQLruDneFNt9aFGi4lZ7WKLwPSHg=; b=xrNfgv1yWtLXUjHNuns4GJV+TJdn7e7Atw3MhQWitGOID0HxpSeyJlC3OihiTsDHdU s+x58W7F/mFbVQm9YvkwR6jKYe+XUBzOcV4EkF/C/9v4gozcmfJemnbghLlhyyW2V12z VL1LurbjEofSXPZ3LLgK+piya/5AtDGH7bhfyjiqEVBT3Ku37T40itYavPTsG2hn0uUM +JACaaCPPhy7GXMYZ6PQlNG9UI1gsaw8VLHfc2ZBoL7vVzxPP4Gwf4FkNO5ElhKkie3o 8SLN4TMuoAHgTNi5LP/Lbb43yu74DmA5Dlm7rUIfRWz4qRCnmouMllIABH9iyQ3Rrkfb x+uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=HCdkoPRlVU+SxnGbQLruDneFNt9aFGi4lZ7WKLwPSHg=; b=BKMBEYC/M01/rnr2hzvh/1/9KWOjxuIcKJGZSpsZaIaoYR4K/cDKa1J307cVBImVcH iZDR+hHncyeCDapO7IMLeNbLGwz8qVxjy4zCkmcwedpLEp7G1nxuodLPL9ULCN3DFQpB kIKNqs0YzhN6YErM6lp0o9bl2JiJHjcxZ74YP9abwWUiorFuEfoEAjHI3M5bZpo2Px1E jIKup/H8YF9QpWS32OMYs6bqclVm73pwWjC5j+rBoLl0mo5B0EedOBOx4UfoYheUSWhO NUtCAvVi+dIsQHWQmFFl/kQVmK9ucuxay+i4r3kCz94r1G/W08ZM6nyeaFOSABYLbTOo gewA== X-Gm-Message-State: ACrzQf14o7RhPVbwqnvXZukl6GHSxEX5Ss+IBFDOX9rEHOeVMayxjqdV Rw63SBfG20fKaqYZhMQ7YRijBw== X-Google-Smtp-Source: AMsMyM5WTF9FmhodTEPNBycpu+rfWGxCdWbzNkFoJevEXPCBlAQlQDATjZ8Dvd3GA7FmdzPbeokRCw== X-Received: by 2002:adf:f44b:0:b0:236:b1ae:85ac with SMTP id f11-20020adff44b000000b00236b1ae85acmr13155364wrp.34.1667369466217; Tue, 01 Nov 2022 23:11:06 -0700 (PDT) Received: from localhost.localdomain (178-190-168-243.adsl.highway.telekom.at. [178.190.168.243]) by smtp.gmail.com with ESMTPSA id y3-20020a05600c17c300b003b4cba4ef71sm913762wmo.41.2022.11.01.23.11.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Nov 2022 23:11:05 -0700 (PDT) Message-ID: Subject: Re: [External] Re: WAL Replication query From: Laurenz Albe To: KK CHN Cc: Ron , pgsql-admin@lists.postgresql.org Date: Wed, 02 Nov 2022 07:11:05 +0100 In-Reply-To: References: <88faef33e966796226022d6e7f3e32ad6c59fcfd.camel@cybertec.at> <8f9e6c92-4daa-a543-6825-05a3503f4296@gmail.com> <42306ea2-74c2-a95e-551d-e1d16946c083@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2022-11-02 at 09:30 +0530, KK CHN wrote: >   I  mean when the Primary Server crashes due to a H/W failure or whatever other reason, > Then   in my case  I am forced to  promote the Standby server as  Primary until the > old  primary  server H/W vendor replaces the hardware component( it may vary from hours to days as pre SLA  terms with H/W vendor).   > > In this scenario  any transactions happened in  crashed Primary server which were not transferred due to the > delay in transfer to the Standby server.  But   I am in need to promote the Standby to Primary and > it will run for another one day or two, until my  Old crashed server failed component is replaced with a new H/W part.    > > So there will be an inconsistency in the data  between the current  Primary  ( promoted standby) > and my recovered /repaired old server ( which was primary before the crash).   > >    How to handle this data inconsistency or what best mechanism needs to be implemented if you were me in this  use case scenario? Thanks for the clarification. Yes, in that case you can lose committed data. The normal way to avoid that is to use synchronous replication. That is easy to set up, but has some implications: - it will slow down data modifications considerably - you should have a low network latency between the machines - the whole system becomes unavailable if the standby goes down, so have at least two synchronous standbys if you want good availability Yours, Laurenz Albe