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 1tDkeT-002wCp-31 for pgsql-general@arkaria.postgresql.org; Wed, 20 Nov 2024 13:21:49 +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 1tDkeQ-005VJr-My for pgsql-general@arkaria.postgresql.org; Wed, 20 Nov 2024 13:21:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tDkeP-005V9b-Nm for pgsql-general@lists.postgresql.org; Wed, 20 Nov 2024 13:21:46 +0000 Received: from sonic315-20.consmr.mail.ne1.yahoo.com ([66.163.190.146]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tDkeI-002siB-FF for pgsql-general@lists.postgresql.org; Wed, 20 Nov 2024 13:21:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1732108896; bh=US/bL3WsZ7rZCeIuEJ3DDNbEwl4BOGNbfcqCL9tJV4g=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From:Subject:Reply-To; b=DWkwA0v54w3nE+E/zjpeoG2IFod6jJWgoUswD3zLEO1aRHybFlxu8RXbvbwZkKIfb34dKEPyhn2Up5+02h4UtIIZ9kQgAfdyZx+/51jGbN0Q+YD6Tjk0lZ+A04+9eBF/sudxHcgu1BUrEWUtuYY8GHQMt/U/cXpNjDc4rrO4Mb/ZwpdCsNO7nO/z8ClDDCkZ0vpmsJQZFtOMFn2IhHNrpvB/+sZK8VU959+Mxmq/B/bt5xBv1DosVcB6+hoUP7Tkvo8pS9acyjYnFQnyzrufqyBdfv/CnC3S+EzUdMt7D4vXqOhf+pEK6WCWEgAFT9NPhgND/msuhSDPGbxJcQv+Bw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1732108896; bh=7Emlnq1elYYd9vf+vCbjRFUt4wS7nDhr2rOmEw+2GXZ=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=kdHA3mnRaNUvLbFC6WKRBNN+UTA9bogv0ewh5mXZvOT2+Dqd1BlizJEvOhuc8rjcF5bddE5zHPwtT0H/CoG/IjeQS2JkgWDeiRD4QS8svbW8Gnm74Y7MTlZMc8LZCYRiUyqJPLsDRgBNg/W36cSzjP0k+XcXTKBCy3/KR/Ct7cvar6ICg3/4QgNxzLo+/rIeeS12F/k71ky0aJe0Ms0+UEizHtlvjcvorir1kB7uvNg+K6iz7R+/53sHQtA+AtW0i31EORruZ13QGoakEnSLkeHAz9KkL75X3EXQQLdBkyqnGyR9cYb1KhfevqnMwz/I7rZvSWR5Kvd2Q+LFe+f1IA== X-YMail-OSG: NNOFJ1gVM1k273Bj4KQU.50Ckqygi3ihvelcvI4JoZfqhSSUag5Bzfl0CSV0_KN BaicXf1SsHa3aEq8psQsi1fVMnEN.jN0mAZEfe_aiIis0Fky22WNMX7h6PCQB26F.e4YFlyMcJ6H .ODgJJIRuW9X5qM1j2Qc.JRwt8apu.83DAH7k9AF_EVc4koB46M2dhPFTFi.h43PqDsfeamY_B0b oyOegdZnZJHDX.ZUwVcsm1Ajy3su3OZ9RTPERKEY22u7OpU6rksM3hxswOjV33jt6462h_._fPoS yZvEGBy0UOK5EY.L5DQAekapGTu.w1gCC0E6yU1RadOcJQJIauM5fa9pW5ZQaWLVio9YIHvIGtrd pr6tr2P_XJvu79X1APneganOQqvVBD2GDAmyqzClSV3_mhbIx6.3Mxlrzn058R4D5z6zdfqpGlwy jHFTp1UCaKsLEV2Tslh3FVwxrBX1LmgAQSupWyIo5t83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w.9DOzEl8LxfGw77WLOT27b9FWMIdVNAzjbbz i6DlJB7U63m8IyWQn.qTysetBSAhdeywBqsAQJR52swP8W0xsGqtXHkJpa3uKRGH6FF1IgFFwePv De7aUmBZWmoiN9oFQtKtvBHRJTsM.EiaI6nWBUEEmW5C.EujiWdZIR.ctJlYo5dW_GiOT_1i6tKa 6YXyHTRGGE3xr9ZqzfJGgDXChwFvIM45pXioZORv6y7UacHoSnqRy4ZtX6UKc2tcQHDgn91GpE6x PvPxfAWJRa_eydcv9VQxijBZEf_JLHtj25HhjNYbphNt6VgfMHPEXNdSfhALTxUQrwo2rQWYn0IC gw3T5j3ADv67xLmAVJuH6q78Qrrc.HQpJM.XjCtwyt7hDjt3eCdzzBvUI1UiVaY4c2AdjCzOSnWe BAFeLgrBRve62cytxRDDaPFybveKoipYpQc5cy.6fcqJHXQF7WLrtJ1dfpv_.Db7aVnaSTMoBbjE 5SoNlZxIE__xafjJnikggbUZQC._rr4EbxUsJLvokJohYaWydjzaLEqqJFpQb8WvTQrSJyJyqnNj Crvmf9A2j3B5G1ZaXobQ6Z7zESHYjkETD2RZnqwocTkomcCis.k86aH0QuuCB7AurIfjxpJJQZFp 0ofCNBlBoFLB5mX5ROCIYKN41b.J.xXjQElS39Bmehg2iUBO6Vm4Xdnn9bqDnLgwslP.NoS0RR3k ht0D3CqYOX6x6rPiwee7HYsJE8ASVWTy6ghlXBBA8_VXZTuN7l_q.Q2GR2q2Gv2oLj4fb1y0duw- - X-Sonic-MF: X-Sonic-ID: c0e2e5ee-439f-49e6-935c-e2e566d64734 Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.ne1.yahoo.com with HTTP; Wed, 20 Nov 2024 13:21:36 +0000 Date: Wed, 20 Nov 2024 13:21:34 +0000 (UTC) From: "Efrain J. Berdecia" To: Sreejith P , Daniel Gustafsson Cc: "pgsql-general@lists.postgresql.org" Message-ID: <641572272.759924.1732108894204@mail.yahoo.com> In-Reply-To: References: Subject: Re: Suddenly all queries moved to seq scan MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_759923_1608389794.1732108894203" X-Mailer: WebService/1.1.22941 YMailNovation Content-Length: 5136 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------=_Part_759923_1608389794.1732108894203 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Make sure to run analyze on the entire database, possibly using vacuumdb wo= uld be faster. Also, check for invalid indexes. Efrain J. Berdecia=20 On Wednesday, November 20, 2024 at 08:02:36 AM EST, Daniel Gustafsson <= daniel@yesql.se> wrote: =20 =20 > On 20 Nov 2024, at 11:50, Sreejith P wrote: > We are using PostgresQL 10 in our production database.=C2=A0 We have arou= nd 890 req /s request on peak time. PostgreSQL 10 is well out of support and does not receive bugfixes or secur= ity fixes, you should plan a migration to a supported version sooner rather tha= n later. > 2 days back we applied some patches in the primary server and restarted. = We didn't do anything on the secondary server. Patches to the operating system, postgres, another application? > Next day, After 18 hours all our queries from secondary servers started t= aking too much time.=C2=A0 queries were working in 2 sec started taking 80 = seconds. Almost all queries behaved the same way. >=20 > After half an hour of outage we restarted all db servers and system back = to normal. >=20 > Still we are not able to understand the root case. We couldn't find any e= rror log or fatal errors.=C2=A0 During the incident, in=C2=A0 one of the re= ad server disks was full. We couldn't see any replication lag or query canc= ellation due to replication. You say that all queries started doing sequential scans, is that an assumpt= ion from queries being slow or did you capture plans for the queries which be compared against "normal" production plans? -- Daniel Gustafsson =20 ------=_Part_759923_1608389794.1732108894203 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Make sure to run analyze on = the entire database, possibly using vacuumdb would be faster.

Also, check for invalid indexes.

Efrain J. Berdecia


=20
=20
On Wednesday, November 20, 2024 at 08:02:36 AM EST, Dan= iel Gustafsson <daniel@yesql.se> wrote:


> On 20 Nov 2024, at 11:50, Sreeji= th P <sreejith@lifetrenz.com> wrote:

> We are using PostgresQL 10 in our production= database.  We have around 890 req /s request on peak time.

PostgreSQL 10 is well out of support and does = not receive bugfixes or security
fixes, you should plan a= migration to a supported version sooner rather than
late= r.

> 2 days back we applied some pa= tches in the primary server and restarted. We didn't do anything on the sec= ondary server.

Patches to the operatin= g system, postgres, another application?


>= ; Next day, After 18 hours all our queries from secondary servers started t= aking too much time.  queries were working in 2 sec started taking 80 = seconds. Almost all queries behaved the same way.
> > After half an hour of outage we restarted all db serv= ers and system back to normal.
>
&g= t; Still we are not able to understand the root case. We couldn't find any = error log or fatal errors.  During the incident, in  one of the r= ead server disks was full. We couldn't see any replication lag or query can= cellation due to replication.


Yo= u say that all queries started doing sequential scans, is that an assumptio= n
from queries being slow or did you capture plans for th= e queries which be
compared against "normal" production p= lans?

--
Daniel Gust= afsson
=



------=_Part_759923_1608389794.1732108894203--