model-writtenrun 8227 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Bharath Rupireddy reported that parallel queries started after smart shutdown hang because the postmaster refuses to launch workers, and proposed either disabling parallelism or allowing workers to start #1; Thomas Munro favored preserving parallel execution to honor existing sessions’ ability to finish normally #2.
- Tom Lane broadened the fix to preserve all support processes until normal clients disconnect, introducing PM_WAIT_CLIENTS and clarifying the documentation in #3.
- Thomas Munro tested the initial patch and identified walreceiver-restart and autovacuum restrictions #4; Tom addressed those in #5, then extended process-restart checks and restored a separate recovery waiting state in #6.
- Thomas found that autovacuum admission and parallel-worker startup were still blocked #7; discussion of recovery-state distinctions and workers supporting ordinary user activity exposed the growing complexity of additional shutdown states #8 #9.
- Tom replaced those extra waiting states with a separate connection-restriction variable, preserving the normal operating state while clients remain and sharing smart and fast shutdown signaling through PM_STOP_BACKENDS #10.
- Thomas verified parallel workers on a primary and replica but found autovacuum still blocked #11; Tom restricted the connection check to normal backends, reordered the checks, and finalized naming in #12 #13.
- Thomas confirmed the final patch’s parallel-query and vacuum behavior on primary and standby #14, and Arseny Sher independently reported successful testing and check-world results #16.
- Tom committed #13 with only a comment wording change as 0038f94387, backpatched through PostgreSQL 9.6, and confirmed completion in #17; the commit left broader handling of unavailable parallel workers for future work and excluded 9.5 because its risk/reward balance was weaker.