Summary:
Prior to this diff, taking a backup includes the following steps:
1- Start by checking the catalog version.
2- Create a snapshot of the data.
3- Back up the YSQL metadata using the ysql_dump command
4- Verify that the catalog version hasn't changed since 1.
If the catalog version changes between 1 and 4, the backup will be marked as failed and we have to restart all over again. This means the chances of failing the backup are higher.
With the introduction of `--read-time` option of ysql_dump we can dump the schema as of a point in time. Therefore, we can use the point-in-time option to make the backup creation workflow more robust and avoid the catalog version check. The new flow becomes:
1- Create a snapshot of the data and mark the snapshot creation time t.
2- Back up the YSQL metadata as of time t using the ysql_dump `--read-time=t` command.
This diff accomplishes this as follows:
- Add the `read-time` option to the help output of the ysql_dump command. This signals to YBController that the core database supports backups during DDL. As a consequence, catalog version check is not needed and YBC uses the new backup workflow (using ysql_dump as of time and avoiding checking catalog version).
Jira: DB-9484
Test Plan:
New end-to-end tests are being added that cover snapshots during DDLs.
QA are also testing the feature on the master branch.
Additionally, some tests started failing due to switching to the new backup flow. These tests will be handled as follows:
Disabled the tests:
```
./yb_build.sh release --cxx-test tools_yb-backup-cross-feature-test --gtest_filter CrossColocationTests/YBBackupCrossColocation.TestYSQLRestoreWithInvalidIndex/*
./yb_build.sh release --cxx-test tools_yb-backup-cross-feature-test --gtest_filter TableRewriteTests/YBBackupTestWithTableRewrite.TestYSQLBackupAndRestoreAfterFailedRewrite/*
```
As they are failing due to a known issue with invalid indices and backup during DDLs. The issue will be addressed in GH-28986
Also disabled the tests:
```
./yb_build.sh release --cxx-test tools_yb-backup-cross-feature-test --gtest_filter YBDdlAtomicityBackupTest.SuccessfulDdlAtomicityTest
./yb_build.sh release --cxx-test tools_yb-backup-cross-feature-test --gtest_filter YBDdlAtomicityBackupTest.DdlRollbackAtomicityTest
```
As they were failing due to ALTER TABLE race with backup creation. The issue is tracked in GH-28766.
These tests need a behavior change, as they were expecting the backup to fail if one of the tables is undergoing DDL verification.
That restriction has been lifted as part of ac671692d114544da6acf55644c3ba0c6abbf922.
Also disabled the tests:
```
./yb_build.sh release --cxx-test tools_yb-backup-cross-feature-test --gtest_filter YBBackupTest.TestRestoreUncompactedChildTabletAndSplit
./yb_build.sh release --cxx-test tools_yb-backup-cross-feature-test --gtest_filter YBBackupTest.TestScanSplitTableAfterRestore
./yb_build.sh release --cxx-test tools_yb-backup-cross-feature-test --gtest_filter YBBackupTest.TestYSQLManualTabletSplit
./yb_build.sh release --cxx-test tools_yb-backup-cross-feature-test --gtest_filter YBBackupTest.TestYSQLTabletSplitRangeIndexOnHiddenColumn
```
As they were failing due to a bug with the backup creation in the middle of a tablet split operation. The issue is tracked in GH-29002
Reviewers: asrivastava, zdrudi, hsunder
Reviewed By: hsunder
Subscribers: svc_phabricator, yql, ybase, slingam
Differential Revision: https://phorge.dev.yugabyte.com/D43598