Hi,
The patch looks overall good to me. I have a few comments:
1/ I believe It is possible for the mode to flip to "failsafe" during the
operation since lazy_check_wraparound_failsafe() is checked in-flight.
I think this should be mentioned in the "mode" section of the documentation
in the "failsafe" description.
2/ It feels odd that we do not have parity of the "mode" column in
pg_stat_progress_analyze. Should we add a "mode" column
there also that shows if the analyze was triggered_by "manual" or
"autovacuum"? An autovacuum in a relation can trigger both
a vacuum and an analyze, and a VACUUM(ANALYZE) will
also do both.
--
Sami Imseih
Amazon Web Services (AWS)