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 1uHOqq-001b9w-V9 for pgsql-admin@arkaria.postgresql.org; Tue, 20 May 2025 15:25:57 +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 1uHOqp-007H4Q-GX for pgsql-admin@arkaria.postgresql.org; Tue, 20 May 2025 15:25:55 +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 1uHOqp-007H4D-3W for pgsql-admin@lists.postgresql.org; Tue, 20 May 2025 15:25:55 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uHOqm-002m5Y-1p for pgsql-admin@lists.postgresql.org; Tue, 20 May 2025 15:25:54 +0000 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-43ea40a6e98so60260785e9.1 for ; Tue, 20 May 2025 08:25:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1747754751; x=1748359551; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=0MtpYgtzLzTrTcI0GlJWtv7Oj3m6Px66PgKW1gm73dE=; b=QkWA9IFun57ym1/4t9VBP4jyRBRpLYAD3KfB1JPpVHcv8+xMOLbMRRfFst72L4EmfK 01NzFJPYG5puJR+3Fm0uAQQ//sM+NYY4rArmNT3YF3DVB5n8hwqYkzbLpI9eRfXyh75P wnM7VaTRgioDqFiZFJnyq29OUBbHknxjz85SjbZ/c6QZBkUA1wGBZODmdBHpxSUvdjjh CbofO0HNT6ZcAeua3Q9E5DSsGhiKu4XqSD7FH3Fel1B9tLfEp1g87A90MQ9PA8oV4/px G+JeYGfNQvmAkual3yyl2Vxoif1q0826W/OqX8Eoq8vC1VPovbVRT+NcnvTBqiwcq1NV atgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747754751; x=1748359551; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=0MtpYgtzLzTrTcI0GlJWtv7Oj3m6Px66PgKW1gm73dE=; b=R+P4y3sX2rSIQkQr81k6rpWzWHW0D1RmIhv3eQxce8QHeyyt8CoAK7U6Qqe0g2U80T pDi4crEWyCb+sqj+WLqhhrk8N25T8IuiL+QFGVBlLyWVmeIDuyfEEmU5hn4bgUesAwdZ GEwtUjcqt/nqs6w398LeYiEaNcerggaQhDaNe1GOXCBRmD9lCWQW9gz3ZoXjYVIMTMh6 TW9nS+qItVTwT2ktqxU2nvW3l0sTV6LaEyuvTArKyGKToav6oDxdHrK8S/JCbOgaonO8 4nFQzFt01hDayhGt9Ddv/e7o7dwtzFRjO+0WGmWaAgN6HjOZ4hikQ5WmgNXvKIMqO4+6 FNOA== X-Forwarded-Encrypted: i=1; AJvYcCXd5SfY5IXP0Y6t/mfBtW/vj5H5oI4yOEl+6bZF31qVyzmqfkVbgX5084bD1ZO1S2l0ovNSyzOGuVLg6w==@lists.postgresql.org X-Gm-Message-State: AOJu0YyDs5lshJihHJzoJ7hTyh9AvsETNftq7pJ1XKEGbYBlWDEHNl+N LeR/CV64F1D0f027rvfZherJYrBmqql9bUKDKZsCnKhS0rCwQWyeB2fRBxtLHORTo9iPKGcoqjO vEYqMrvQ= X-Gm-Gg: ASbGncuYoouY5ZHsibk0v6qszKwp0uzsYb9M9Xs5WFW7AaF1a0K40DU3qj/Z2ZbBQAa u5izgBG/SpdakVnqSTcQjkjPFCcnCatwuuxbNIjms71Hwb32yWCHPhvcKbAXrd50OiwNcSHwonH XDXeTRuY1pjF/eiCHZxe8TNDjDcXDPdJcXU+9h5o4TWkQRGBqkSTCta/b3diEU9rpe7wHhAYRgv ZzvdSdgvlEX5216FIVYK0/LqxjrL9SezX/oahTfjGf8MTXCVon8jAZpIyv1PXdnSQBq8GE5C4Fz 9XL2DVaSj03m/6xebOR7sgBZMdoqNj1ZchAAhXpO6W0WE3zdrykwYGdK4rMUnEryHR8ICMrYy3d 8lJEJ/Q== X-Google-Smtp-Source: AGHT+IGDhERDVr9reH4jxEdkl3O0LFApadUZ+UzEf6Uhmlnw2yUEcb+e2dtQZxKWMXX2yLDgjZyyig== X-Received: by 2002:a05:600c:4e06:b0:43c:fa24:873e with SMTP id 5b1f17b1804b1-442fd61013fmr171110015e9.13.1747754751431; Tue, 20 May 2025 08:25:51 -0700 (PDT) Received: from laurenz.albe-K4N0CV00F97414D ([2001:871:255:52d3:3ac8:61ab:b634:342]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-447f18251adsm37217985e9.2.2025.05.20.08.25.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 May 2025 08:25:51 -0700 (PDT) Message-ID: <32ad0fda77629362dbdc90136e6d5f667d496e01.camel@cybertec.at> Subject: Re: query hangs out From: Laurenz Albe To: =?UTF-8?Q?=D0=90=D0=BD=D1=82=D0=BE=D0=BD_?= =?UTF-8?Q?=D0=93=D0=BB=D1=83=D1=88=D0=B0=D0=BA=D0=BE=D0=B2?= , pgsql-admin@lists.postgresql.org Date: Tue, 20 May 2025 17:25:50 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.1 (3.56.1-1.fc42) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 2025-05-20 at 16:48 +0300, =D0=90=D0=BD=D1=82=D0=BE=D0=BD =D0=93=D0= =BB=D1=83=D1=88=D0=B0=D0=BA=D0=BE=D0=B2 wrote: > I encountered a very strange behavior. > For any query (even a simple count(*) to one specific table (a small 30MB= table with 3 indexes, > without any specific data types - everything is standard out of the box v= anilla Postgres) - > the query hangs dead. Waited more than 24 hours - the query did not compl= ete). >=20 >=20 > Similarly, the vacuum process to the table hangs. > Only Kill -9 with a full restart helps >=20 > I get a backtrace, from it - I then examined the pg_multixact directory, = which at the time of > the problem had swelled to 900MB and had several thousand files. > I excluded long and inactive transactions, as well as prepared statements= . >=20 > The workaround in the end was this - truncate the table (it was successfu= l), then vacuum freeze > each DB, and after that the files from pg_multixact disappeared. >=20 > What could it be? vacuum\freeze\mulitxact=C2=A0 settings are default. > At the same time, the value pg_database.datminmxid=3D1 > Could the problem with the hang be related to the many old files in pg_mu= ltixact ? (judging by the backtrace - yes) I can't say for certain, but I have seen cases like that where index corrup= tion sent processes into an endless loop. Next time you could try to rebuild the ind= exes. Yours, Laurenz Albe