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.96) (envelope-from ) id 1wUpW4-001TZ0-1j for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Jun 2026 17:36:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wUpW3-002NUl-1C for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Jun 2026 17:36:31 +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.96) (envelope-from ) id 1wUpW3-002NUd-0C for pgsql-hackers@lists.postgresql.org; Wed, 03 Jun 2026 17:36:31 +0000 Received: from mail-qv1-xf32.google.com ([2607:f8b0:4864:20::f32]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wUpW0-000000015cT-0uRX for pgsql-hackers@lists.postgresql.org; Wed, 03 Jun 2026 17:36:29 +0000 Received: by mail-qv1-xf32.google.com with SMTP id 6a1803df08f44-8ccef9eabccso9078036d6.1 for ; Wed, 03 Jun 2026 10:36:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1780508185; cv=none; d=google.com; s=arc-20240605; b=Q5Xj/p/1Br4bYB/uI9CnIVJnBz4ydj5bW52Eg69WXTTeGWrWDo++mC1s82fsOxhqmr i1YQR2gca9Mv0X6ma3pqWdUhoU5wkncfrELmWTMbM4t79qQv7lyswlsiuOHwMHd4U++t cz4pqx+49h+SmMZ5XtC6KYhmCMSz7p8rA7Oj6PDMjobJbuK+KeqpICAOUhrgS1ZaDEHH 7Ce+lph/cPuR9q8xnyXPIZYD3cp6mK3+F3JlSmqAjLGiCUCY/Ae4VMHDGLO/iyCEuA3r BHxmPXwwjaB6dzUM4z7UcCN871aOr4ZhrzW1jfousOs7czTjO6OlIyBUciYW1jrZJixL KScw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=9I1geySv615c5KgHLYWAQWGbvjtamVgpFxFuA1x/Pe8=; fh=bl7yN204Rtr90bil421tUcv+boBl4PyrsWunyevB838=; b=IpZRvHoJ7YOKsNBof/d0+on07KOGx83a8HYe+uIrxXMPb8PvoN8uzhdMuDmHElWo6F 2kIXzhKsCQcswwzXttbxA2gl8FN/b0tYEbbxYSO4Xna4vS8VBhYXWIC/KDOOrNkcYaar bgRnL7tFE8s2LXE2XKPO9Hj6D8equGzvcipFYOvQ89dETTJD7wMVRBoCaSVoSsN0A/C1 20GLOE69wHhuPDXiTSvxCE19BdfqCX31bUrIKDEUkvmfADmcC4MZJ0skwgcJWrFibNec yrYfKPGk+S9Bg/YTibGV/9u3gTLVUn8xjreyvTfT5/p5vgq9eysjpW+1F6sH11DSGr+u Shqw==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1780508185; x=1781112985; darn=lists.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=9I1geySv615c5KgHLYWAQWGbvjtamVgpFxFuA1x/Pe8=; b=LccJtWrz+dMI2kiZ8yrqN6ervqdhKeDwhOvxDpHYxcxJGfBYHY/j482pYL3KPIB1qC O7aW1bkbZ3UEQzUxlX8mj8Bmb0PmdaR99YO3vdFf2SiA1HJI/m9I0QtCak7I+tacKmTP rqO8JAPuHJSGF0IlrQqqlAMUyp7bRKhSqazksE9AIHwleIg1CWfYuApOsXlPiy942hN6 G/DEx+xFNcmbJfesrngFCkv4pHXxQ613FYyfLIfhU5VLAuYZqze9y2phuQFf6PBL9BRa SSvzTLYk/hpyJTDICebLZK5wrrxoPafOMeir7TOfs5wU37kcI9CRttA6d/Jz3K4T1pW6 yLnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780508185; x=1781112985; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=9I1geySv615c5KgHLYWAQWGbvjtamVgpFxFuA1x/Pe8=; b=skZr7MLuUvcm6s20zNB+rVA20IpefPEcXByK/XHEG8mZ7lie2YfbOWUhnQvCLEOJNw cEmpHHWbDvvzLXHuEbnxue3yqTPCME55z2u3fyNkiVuw1/8LyYu/BERk38zDF2Co3yQv LUJR2GNnByfJb3cIClgAXWEK3kq3tvdOMlrp7zCl53BLl0tbo3vd6oeCzvfBLl6YcjPu a+y6vwbq2xuUmQIRXCU4LmbKsvlgBzEEaAmCgkwHiQAduzZqngXeBCBFubvSOwguUBVb 5fnDnqzxD+o024ckmbeKWzsq3r4TieVarx54uBvAOjS35aPXYo83ZNGiwaTAdpcFi9O8 2+9w== X-Forwarded-Encrypted: i=1; AFNElJ8CWgDmfQLb50tMUPmSdGgIFKIs0NBA45y/2iMzSfxQulLnETb/6/t3y+NB/FtkjDpJw4OImmDg1cG8pj+a@lists.postgresql.org X-Gm-Message-State: AOJu0Ywq3coJiq8fRFnu1scs5R/+Qzad47r/dkrizBRg8MuQ5c0frn6m HsBEIN/9eZ0h8yvGNDbu1rNJIO+sJZjhJWgBhRSndXk84ZR3ch9h8jshC1sTp0HhH9nepEDyae2 OYSRPf7oNNtKBUJKKblA3KlxwWkr2ngAX4PrRVHK6 X-Gm-Gg: Acq92OEzB/x4az56+p1RJkV+1yWf6vAg1KqTxWgRWARkC72OLAxm4cK7/F7G+CHuZeD t8M5m9FXnJcyiJyEvy3LolGfTh92c+MFemeixzmK/Fk6ZiH/Ef8NBLdrwMv7L6KweHA4kTNyNUl yutCbSf56GcJf/jk+22fKDFN/YqwpRAtpJaI4YpYe8EWYgp59h8I14OlScmqZRGjUGd+bywLwk5 t7LhRzsQsdNCpNsPw1zxjcE+IW5al7BtB9nqchyZLHIMjhVz2VDR2DAVcqRuLCrMOBkg6EWGw64 Zn51l7IIjBkkwl8= X-Received: by 2002:a05:6214:252f:b0:8cc:f5b7:4e13 with SMTP id 6a1803df08f44-8ced82950cfmr5275316d6.24.1780508185128; Wed, 03 Jun 2026 10:36:25 -0700 (PDT) MIME-Version: 1.0 References: <6634e1b0b5b74e5c2e3b06201120a81e11d82a55.camel@cybertec.at> <3bnBUxwx2npXqvHL0trI11LOOvzQ7LI0GzWqbaj5SJnk7DTb1uzStGveKwj0JJmBW4ebzGIF3az7of4I4rQeaO_PRqDnnClCduPyjM6gPgM=@scottray.io> <20260602.165755.1084850050958933598.horikyota.ntt@gmail.com> In-Reply-To: From: Jacob Champion Date: Wed, 3 Jun 2026 10:36:14 -0700 X-Gm-Features: AVHnY4JfS-EbjFRySom6lNrVrtjkOIoYEA4i3gMK6jqJXpBTK5eoz2K-0XMAUas Message-ID: Subject: Re: Report oldest xmin source when autovacuum cannot remove tuples To: Shinya Kato Cc: Sami Imseih , Kyotaro Horiguchi , scott@scottray.io, laurenz.albe@cybertec.at, japinli@hotmail.com, qiuwenhuifx@gmail.com, pgsql-hackers@lists.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 (A colleague pointed me at this thread just now, because I somehow missed it, but I've also been playing around with a solution for this recently. Your patches are much farther along than mine -- hooray!) On Tue, Jun 2, 2026 at 6:11=E2=80=AFPM Shinya Kato wrote: > I agree that exposing xid horizon retention information via a > SQL-visible interface is valuable. However, I believe reporting it > in the VACUUM log is also important: a view only shows the current > state, so once a blocker has gone away there is no way to determine, > after the fact, what was holding the horizon back at the time a > particular VACUUM ran. Logs are the only durable record we have for > that kind of post-hoc analysis. +1. I'd *really* like to have this information logged at the point that VACUUM is blocked; it'll help during support escalations (or prevent them!) in a way that a view cannot. That's not to say we couldn't also have a view, of course. > That said, I share the concern about emitting best-effort > information in the VACUUM log, which otherwise reports facts > observed during the operation. Would it be acceptable if we > reported the exact blocker -- captured at the moment OldestXmin is > computed -- rather than a best-effort guess reconstructed > afterwards? I don't want to weigh in very strongly here; you've all been thinking about it for longer than I have. So, taking off the committer hat and putting my user hat on: I ran into the same decision between 1) tracking the origin during horizon calculation and 2) attempting to reconstruct it after the fact. I decided, for my own patch, that I'd rather track them during horizon calculation. The cases where I really need these logs are high-stress, chaotic situations where things are falling apart, and if the database's answer to "what's causing the problem?" is ever "I don't know, you better run VACUUM again", I think that's likely to spike my blood pressure. As discussed above, though, this approach leads to a collision issue. So I put the patch down before PGConf.dev, trying to figure out how best to solve that. (That said, there's nothing wrong with getting a good solution in and working on a better one, as long as the first patch doesn't make the second one harder. Thank you for working on this!) --Jacob