On Thu, Nov 19, 2026 at 1:17 PM Fujii Masao <[email protected]> wrote: > > On Thu, Nov 12, 2026 at 5:58 AM Bharath Rupireddy > <[email protected]> wrote: > > I think it is RfC. Thoughts? > > I'm not sure how useful it is to log these statistics even though > they are already available in pg_stat_recovery_prefetch. > > Currently, the counters in pg_stat_recovery_prefetch are not saved > and restored by pgstat, so they are lost even across a clean restart. > So, if the goal of this patch is to preserve them for later analysis, > logging them could be useful. > > But, making these statistics persistent was already discussed when > recovery prefetch was introduced [1]. If we eventually implement that > in the future, the statistics could be queried from the view after > a clean restart. So I'm wondering what additional value the log message > would provide in that case.... Sorry if I'm missing something.
Hi Fujii, I think logging the information would be helpful for two reasons mainly: 1. For analysis of the past events - sometimes support cases/coworkers have only access to the log and without ability to fetch from view on demand. As this is recovery thingy, thoses cluster node can end-up being bounced hard (frequent failover/switchovers). Then sometime people later ask the question why the recovery took so long or what it was different this time? (having this in log would help answering such questions) 2. By logging it always, devs could get some insight from real world systems how the WAL stream looks like there (in terms of xlogprefetcher capable of dealing with that). I'm thinking of this as some 'feature usage analytics' that would helps further spot some issues potentially. Also such measures could be used to tweak m_io_c and wal_decode_buffer_size. However, my bigger problem now is that the patch today misses to calculate actionable metrics (e.g. what was the average io_depth or block_distance over time)? So if avg io_depth and/or avg wal_distance are out, I don't think it's all that useful. Also Thomas mentioned "true-AIO-for-recovery" [1] potentially one day, so whatever would be logged here today, would have to stick and cover future implementation too, right? -J. [1] - https://www.postgresql.org/message-id/CA%2BhUKGJpKFpAB-du_m3zzZmRjdg_V65TsLj_DDMSJnzikWDG7w%40mail.gmail.com
