Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r0Lqb-005A2m-LC for pgsql-admin@arkaria.postgresql.org; Tue, 07 Nov 2023 13:10:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1r0Lpb-008JNF-Mu for pgsql-admin@arkaria.postgresql.org; Tue, 07 Nov 2023 13:09:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r0Lpb-008JN5-AU for pgsql-admin@lists.postgresql.org; Tue, 07 Nov 2023 13:09:23 +0000 Received: from mail-yw1-x112e.google.com ([2607:f8b0:4864:20::112e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1r0LpZ-005BBd-4l for pgsql-admin@lists.postgresql.org; Tue, 07 Nov 2023 13:09:22 +0000 Received: by mail-yw1-x112e.google.com with SMTP id 00721157ae682-5a7c011e113so68846477b3.1 for ; Tue, 07 Nov 2023 05:09:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699362559; x=1699967359; darn=lists.postgresql.org; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=Y27iuSRyDtj7zz/TKmCbjdHTl1Pa/OkkEDBlzTip0pA=; b=IVymQsrpmPaS2vgQBOUij8wqkpwqsAPo3PBd5yDCsEKHtZI+QAyiiY20/6Imo873cU zyyjnnFm+wPoRdc8vOr29Dy0Ix1AWP5nD8TR2CVuS2EXKdq9wkz9H3k+fCopeyNp42B5 fsYQ7k3y2p9YjVbhpeqP2xyi0UQXGMna+rzwMPoYxSuFMGjUWwUYIi7zCH1d5rl4g7yu CqP4/EZ8JzY6l0wwNJCCIuE+wcxHaBebFOD4DUoyJI6JRQgJW9c0b0t8FOBQeWnSA5kz dEGI2wPXNXeCM26n6EsDT1ASDjD+4vp9qYN7izU3PDFGZRx6zsN+xaZcsAtrotXWqnCq OWHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699362559; x=1699967359; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=Y27iuSRyDtj7zz/TKmCbjdHTl1Pa/OkkEDBlzTip0pA=; b=KnOIMqnehinM4SWMqOPmIdN/zoudCBTVNw0A7Pax777tZUS/dso4zgEUjioQ+EfYkb L2ez0bEUU+M7yDkrW5RWhd9B4VHVWpv2CUzXQYCO5xfuzpdLV0hypmQu6x8vqY5mx802 e6F8XczTYzJ/1b2FoSWZEGeaRw5xyww1Q6bTZihmR52ZTWJ96ulUTPowCickCffUZG8Z VALvAHtltppDq5MyXJSpPQSkCIz//KzWO2feWbHBFRcb5vYdYtDC0w1c/S3nX8YA+PV9 Kx64Am0y50j+9j1gbIu0+aFDeoP35iKZsPJxQ7rf/YAhkCd6nMcVLDk9M9pnnkJ2rYr6 sCmw== X-Gm-Message-State: AOJu0YzoxE73mJo0KkPVThANpETtUuNNchI/Bgo7anL+J/T2/uwmtIUL Mk7ddBZhnIEB9fcBpDgfiJnDY1ObJ7k= X-Google-Smtp-Source: AGHT+IEpIlbplP6AufZDxY7zFA7/7fw0HdppWkV36evMssStl45G/EpXEccYLuIKuVEyJnY33bdnuw== X-Received: by 2002:a81:a04e:0:b0:5a7:b560:12df with SMTP id x75-20020a81a04e000000b005a7b56012dfmr13619082ywg.8.1699362558655; Tue, 07 Nov 2023 05:09:18 -0800 (PST) Received: from ?IPV6:2600:1700:bd2c:b810::44? ([2600:1700:bd2c:b810::44]) by smtp.googlemail.com with ESMTPSA id u198-20020a0debcf000000b005a42740fcd4sm5552972ywe.94.2023.11.07.05.09.18 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Nov 2023 05:09:18 -0800 (PST) Content-Type: multipart/alternative; boundary="------------FU2qzuLn0ZkSR48aaec5jMCW" Message-ID: <9cabf7bc-e98f-449c-82ce-446727ff4814@gmail.com> Date: Tue, 7 Nov 2023 07:09:17 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Frequent failover Content-Language: en-US To: pgsql-admin@lists.postgresql.org References: From: Ron In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------FU2qzuLn0ZkSR48aaec5jMCW Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Have you scoured the Patroni and Postgresql logs? Have you increased the logging level? On 11/6/23 23:44, Rajesh Kumar wrote: > Is there a way to narrow down the cause of failover? Yesterday itself > failover happened 7 times. > > On Mon, 6 Nov, 2023, 1:34 PM kaido vaikla, wrote: > > Hi > First of all, read a logs. > $PGDATA/log > #journalctl -u patroni > I had once failover flapping, because of master heavy load, caused by > apliccation change. So, find a pattern. > > If physical replication, after failover you don't need run a vacuum > manually if autovacuum is enabled. > > br > Kaido > > On Mon, 6 Nov 2023 at 04:53, Rajesh Kumar > wrote: > > Hi, > > When I issue command patronictl history, I can see frequent > failover. Like atleast weekly once. > > Every time this happened we have to do vacuum analyse for all dba. > > So, I need assistance in how to avoid frequent failovers and what > is the solution for vacuum part we r doing.. > -- Born in Arizona, moved to Babylonia. --------------FU2qzuLn0ZkSR48aaec5jMCW Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Have you scoured the Patroni and Postgresql logs?

Have you increased the logging level?

On 11/6/23 23:44, Rajesh Kumar wrote:
Is there a way to narrow down the cause of failover? Yesterday itself failover happened 7 times.

On Mon, 6 Nov, 2023, 1:34 PM kaido vaikla, <kaido.vaikla@gmail.com> wrote:
Hi
First of all, read a logs.
$PGDATA/log
#journalctl -u patroni
I had once failover flapping, because of master heavy load, caused by apliccation change. So, find a pattern.

If physical replication, after failover you don't need run a vacuum manually if autovacuum is enabled.

br
Kaido

On Mon, 6 Nov 2023 at 04:53, Rajesh Kumar <rajeshkumar.dba09@gmail.com> wrote:
Hi,

When I issue command patronictl history, I can see frequent failover. Like atleast weekly once.

Every time this happened we have to do vacuum analyse for all dba.

So, I need assistance in how to avoid frequent failovers and what is the solution for vacuum part we r doing..

--
Born in Arizona, moved to Babylonia.
--------------FU2qzuLn0ZkSR48aaec5jMCW--