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 1iwMXf-0001wI-Di for pgsql-admin@arkaria.postgresql.org; Tue, 28 Jan 2020 08:48:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iwMXe-0006zs-8l for pgsql-admin@arkaria.postgresql.org; Tue, 28 Jan 2020 08:48:14 +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 1iwMXd-0006zl-Vu for pgsql-admin@lists.postgresql.org; Tue, 28 Jan 2020 08:48:14 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iwMXb-0006bs-Cp for pgsql-admin@lists.postgresql.org; Tue, 28 Jan 2020 08:48:13 +0000 Received: by mail-wr1-x441.google.com with SMTP id c14so14996542wrn.7 for ; Tue, 28 Jan 2020 00:48:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=y3TEsbeMB4YTS00N8G9chhDht828VExm8cmCYE/ZejA=; b=yLuO5r8LkYGsRmAW+ZuLetyZwh4I8GYU4V8RZmAY1V8ahRUPDPzs9588GzMcmnteiq bsJyN6V1yACnGb8SjIOKxk3nHBvuxxLAhGaJLFyU5evCKNM0H/e/tKQqgvXYTILYlvhQ jfSLXpWyxS5jHZY8WXBtweJh/8ekzfnLNpRu9eUMLh54prargcL4ZNRLzq72oJ2wtp4B FJEsr94RjX8oyR29klRQc0ld5L48IPWJ+cXMk5B4U+TzLWUkFPqtIUNPHC30UHQZom2F xpbwOsiX/GqYKAvN8FWTbJ1bNCA0I69NwC8TT1bauitX9WbpYzLv8Xm95db/hOMP+1mF mdPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=y3TEsbeMB4YTS00N8G9chhDht828VExm8cmCYE/ZejA=; b=raLcF5I9OLtYpynPXgg5RuoaEvVXbriFiRe3epiyITqbyIUDkXsVFd2VQc4qMW62+W FI20u/UkjelqHPFCIqwpm7/qEG8hnA9ac0aSIyH/LzQe5SR4mu10biy3dIBRPhz28bmw y9KtsUmxjtKQbpAYWwVOKqBpFLi9cJ24/5xc3iX+x6k61rMbcRjgU+Ouqm9vNkpN/IJ9 ClDFxBiDGrx6x4IJM6lUWLt+N6YpUjtLta1Zi+JwimBFN65/3XLxiexShdzuf6hVJsEg QGW0oEinHqnDTkJWE912kpUZoiI4ftX2svzX2i/ZGdttipOHcXGQKBaehKAJpaq5tTI2 ZVng== X-Gm-Message-State: APjAAAXI+dTMyK1yuItH1Sm+D7nEHEZcY0m5mIJD9jY/1n00og4MSMpo lEGdoDE7paV+K2Mb26XJg565xg== X-Google-Smtp-Source: APXvYqzU0E1SpmhlheDCniEjaoBbwKeRm+d1Kf2SYifTBi790A+nsmuTZ+vhURW20mgdJImSQmIGCg== X-Received: by 2002:a5d:6a8e:: with SMTP id s14mr28538067wru.150.1580201290427; Tue, 28 Jan 2020 00:48:10 -0800 (PST) Received: from localhost.localdomain ([212.186.219.234]) by smtp.gmail.com with ESMTPSA id z4sm2085860wma.2.2020.01.28.00.48.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2020 00:48:09 -0800 (PST) Message-ID: <7389f3b042bed5d6b8fcf4cbf890fc932bc7963e.camel@cybertec.at> Subject: Re: pg_rewind From: Laurenz Albe To: soumik.bhattacharjee@kpn.com Cc: pgsql-admin@lists.postgresql.org, pgsql-admin@postgresql.org Date: Tue, 28 Jan 2020 09:48:09 +0100 In-Reply-To: <2A91BEF8171A5349931391E0C721CC537D787704@CPEMS-KPN501.KPNCNL.LOCAL> References: <2A91BEF8171A5349931391E0C721CC537D787037@CPEMS-KPN501.KPNCNL.LOCAL> <2079fc510f11cc43ed95a34afbec01d51a745d67.camel@cybertec.at> <2A91BEF8171A5349931391E0C721CC537D787704@CPEMS-KPN501.KPNCNL.LOCAL> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.5 (3.32.5-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, 2020-01-27 at 16:01 +0000, soumik.bhattacharjee@kpn.com wrote: > I set the "wal_log_hints = on" , but enabling this parameter "on" in new MASTER(old SLAVE) needs a restart-- > which I cannot do as all application transactions are going on there now. > > Also I used pg_rewind in old MASTER(which now I want to make as new SLAVE) and it was successful, > but this also needs restart of new MASTER(old SLAVE) which is again an issue. > > Command used: ./pg_rewind -D $PGDATA --source-server='host= port=5432 user=postgres password=xxxx > > Could you please suggest how to get this to work to keep the MASTER(old SLAVE) up & running and make the old MASTER(new SLAVE) If you want to use "pg_rewind", you have to plan for that ahead of time by either using data page checksums or enabling "wal_log_hints". The first requires longer don time, the second a restart. There is no way to do that retroactively. Just use "pg_basebackup" to create a new standby, and enable "wal_log_hints" next time you get a chance to restart. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com