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 1v6wad-00CJQz-FE for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Oct 2025 19:46:15 +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 1v6waa-008JSZ-VV for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Oct 2025 19:46:13 +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 1v6waa-008JSI-Fx for pgsql-hackers@lists.postgresql.org; Thu, 09 Oct 2025 19:46:13 +0000 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v6waS-000utT-2f for pgsql-hackers@postgresql.org; Thu, 09 Oct 2025 19:46:12 +0000 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3f44000626bso952393f8f.3 for ; Thu, 09 Oct 2025 12:46:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bowt-ie.20230601.gappssmtp.com; s=20230601; t=1760039158; x=1760643958; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=hG8Wwvxduu8hJXN67JUEG0vKZjnRMidj6HqwVxvTvto=; b=V5AnUbUz0IeFFFFbQYE+DXMmVCV017QxvLnyl+NCh2HPn7oPep9PiN9+IyJygGH38+ o5y5jibChREtQ1i5QjrRPO4AS5Rv6cAK+xW1h+WCUboW5IWECFmFAWshs8DZv2ZRJGVT Kk+C2az7jYqncyEOBTAhQoPPk2VSo9rWN86Zr/SYRtxnpkGwE6Hb8j63fiIVmneNjI56 /0WdwjNZ8JwlK2HA5Jvl5vDnyverdn57qNdhuSBbJivnab6XiWq892D13MkXyrDtOPEQ Q5NAFkes2gwUGxX/Pudjxje88EeOe+xeF7COfETGDcy7SsYD4u8bvZq3MlQOo2Sj/q8R iXJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760039158; x=1760643958; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hG8Wwvxduu8hJXN67JUEG0vKZjnRMidj6HqwVxvTvto=; b=VG5mMO1PvKHI7zRgJrtrjDzwZXygydcBPTu7WpbUl24byw6jLvTi1VpJsXOv69qrjq Turnu301mLbyP9RGwkefHHskH9V6CAw9VTMZHUU9psP1PPmah3+GzjZvRS9AQ8g1Tugd gypk2Q662bIb9zjGgUoGylekzVrETLtIby77O+QKmf5OVuoJ/a84DNsFcNYuHRikTDQY sDJTB8CgFHJChG4kAAH7Btcq1Pa/wiJ6e99pJBIJtmN117SbQtYe/35bothaOG3ooQAN UOheTkPYpmT0NGmdJ4FR8h7CVfG2Jur4xmzgnlnbHWvARSmCjlw4jd9rhZsU+o1vxx20 qPJA== X-Forwarded-Encrypted: i=1; AJvYcCXB+rVMxdHowhxhbIbJMID7feuLW30frNSRkFZx3/eCIiBcyeOcg+W2XeY5K31u6LB80KkLQF0Qgpgln+GK@postgresql.org X-Gm-Message-State: AOJu0YwLwJQf5RcH6ygFRnDN5elmAPx04UI7bNE02w5xbxpd4PF5N65c d2HgdHouHNd8/AeYghl8p1Zb6PwTNf8TmfoJFcscRJJaVpUbW6rYtdjSFa+LJ2qa1/3SbTLbYmW XzROf5aF0cFkwT6zircvjX9mctWfHqlAHuolAlgWXfA== X-Gm-Gg: ASbGncs43f2BMwINHs/OOPqnjXzt8EkpDRToABavXyZnRRCAvqqxhfQeW8IU8us8eRo JxxajU5jo8FGGtq8t8QOSVxc5Utdw6F8I3vdd0IGnaYFSwSTDb9/+/mcXMG7MunzI2rSCnGcz3T PJURcrFIRCUt2cEWYiHN1kQvPBX61+TazK3TImGcIDUR9zvvZsXOGzArfVCexV7qCYCQTjqV+of 57vK/3+prJnpX3ivbDpdBS5kqq7+S8= X-Google-Smtp-Source: AGHT+IFkMjCdOIARtPIwdvsH8mtwdWpMkFjNkgKpyDn8Im/yM/w1d51wftk9o8DuSD4x2nJ+qVcn1nOeGxzXJ0QYOnQ= X-Received: by 2002:a05:6000:420c:b0:425:58d0:483b with SMTP id ffacd0b85a97d-4266e8dac41mr6289446f8f.45.1760039158239; Thu, 09 Oct 2025 12:45:58 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Peter Geoghegan Date: Thu, 9 Oct 2025 15:45:32 -0400 X-Gm-Features: AS18NWD8BouoxweLUcYahytr_ziZCrZIvDr6KIlUriT3RScwqeQUE_Qt5DquQnM Message-ID: Subject: Re: another autovacuum scheduling thread To: Andres Freund Cc: Nathan Bossart , pgsql-hackers@postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Oct 9, 2025 at 12:15=E2=80=AFPM Andres Freund = wrote: > > Each worker would consult this table before processing. If the table i= s > > there, it would remove it from the shared table and skip processing it. > > Then the next worker would try processing the table again. > > > > I also wonder how hard it would be to gracefully catch the error and le= t > > the worker continue with the rest of its list... > > The main set of cases I've seen are when workers get hung up permanently = in > corrupt indexes. How recently was this? I'm aware of problems like that that we discussed around 2018, but they were greatly mitigated. First by your commit 3a01f68e, then by my commit c34787f9. In general, there's no particularly good reason why (at least with nbtree indexes) VACUUM should ever hang forever. The access pattern is overwhelmingly simple, sequential access. The only exception is nbtree page deletion (plus backtracking), where it isn't particularly hard to just be very careful about self-deadlock. > There never is actually an error, the autovacuums just get > terminated as part of whatever independent reason there is to restart. What do you mean? In general I'd expect nbtree VACUUM of a corrupt index to either not fail at all (we'll soldier on to the best of our ability when page deletion encounters an inconsistency), or to get permanently stuck due to locking the same page twice/self-deadlock (though as I said, those problems were mitigated, and might even be almost impossible these days). Every other case involves some kind of error (e.g., an OOM is just about possible). I agree with you about using a perfectly deterministic order coming with real downsides, without any upside. Don't interpret what I've said as expressing opposition to that idea. -- Peter Geoghegan