Summary:
Block updates to the ysql catalog during ysql major (pg15) upgrade. For temp table DDLs, pg performs the write using the `force_catalog_modifications` flag. Updating this logic to also include the initdb, and binary upgrade (pg_upgrade) phases.
yb-master rejects all updates to the ysql catalog during the ysql major upgrade, unless it has the `force_catalog_modifications` flag set.
DDLs are allowed only after the upgrade has finalized (ysql catalog state `DONE`). In this state older catalog is fully blocked even if `force_catalog_modifications` flag is set.
- Move catalog state related logic from `YsqlCatalogConfig` to `YsqlInitDBAndMajorUpgradeHandler`.
- Move `YBIsMajorUpgradeInitDb` from `pg_yb_common.c` to `ybc_util.cc`, and cache the env var.
- Disable YSQL webserver in binary upgrade mode. The webserver fails to start since it cannot bind to the port. The normal postgres process started by the tserver uses this port. This webserver is not needed, so instead of trying to assign another port, its better to not run it at all.
- Remove warning line from `MasterTabletServer::GetMessenger`. The caller is expected to handle the nullptr, and so this is just spamming the logs.
- Bumped the build to 2024.2.1.0-b116
- Handle the case where yb-master is downgraded in the middle of an ysql catalog upgrade by crashing the master with a friendly error message.
Fixes #25362
Jira: DB-14586
Test Plan: ysql_major_upgrade_ddl_blocking-test
Reviewers: smishra, telgersma
Reviewed By: telgersma
Subscribers: svc_phabricator, yql, ybase
Differential Revision: https://phorge.dev.yugabyte.com/D40515