Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#23033] Allow running YSQL upgrade unit tests with snapshot other th…
…an 2.0.9.0 Summary: Currently, when running some YSQL upgrade unit tests (e.g., org.yb.pgsql.TestYsqlUpgrade#migratingIsEquivalentToReinitdb), we create the cluster using initial_sys_catalog_snapshot_2.0.9.0_release or initial_sys_catalog_snapshot_2.0.9.0_debug. When doing investigation of 128-byte PG name (by changing NAMEDATALEN from 64 to 128, some YSQL upgrade unit tests failed (including `migratingIsEquivalentToReinitdb`). This is because the snapshot for 2.0.9.0 isn't compatible with the new 128-byte build. In order to run the test we need a compatible 2.0.9.0 snapshot that is also built with 128-byte NAMEDATALEN. But our build tools have changed and a simple git reset back to 2.0.9.0 to do a 128-byte NAMEDATALEN build did not work. However I was able to make a 2.14 128-byte NAMEDATALEN build which produced a compatible 2.14 snapshot. But in order to run YSQL upgrade test using 2.14 snapshot instead of 2.0.9.0 snapshot, I had to change the test code. It will be good to provide a java test argument that can be used to override the default 2.0.9.0 snapshot when running the YSQL upgrade test. I made a change to allow using --java-test-args to pass the absolute path to the snapshot directory to override the 2.0.9.0 snapshot. I found several tests had issue so made some adjustments needed to get them to pass. In particular: 1. Created a helper function `createPgTablegroupTableIfNotExists`: needed for both `migratingIsEquivalentToReinitdb` and `upgradeCheckingIdempotency`. 2. Some of the number calculations assumed 2.0.9.0 settings and are hard coded, they need to be adjusted when a different snapshot is used. Test Plan: (1) The default test PASS ./yb_build.sh release --java-test 'org.yb.pgsql.TestYsqlUpgrade' Note that it uses 2.0.9.0 snapshot to start upgrade (2) The customized test that uses 2.14.13.0 snapshot to start upgrade Download yugabyte-2.14.13.0-b13-linux-x86_64.tar to unpack and get a 2.14.13.0 snapshot at /tmp/yugabyte-2.14.13.0/share/initial_sys_catalog_snapshot. PASS ./yb_build.sh release --java-test 'org.yb.pgsql.TestYsqlUpgrade' --java-test-args '-Dysql_sys_catalog_snapshot_path=/tmp/yugabyte-2.14.13.0/share/initial_sys_catalog_snapshot' (3) Repeated the test steps by making two 128-byte NAMEDATALEN builds with a change like: -#define NAMEDATALEN 64 +#define NAMEDATALEN 128 One for master branch, one for 2.14. The latter is used to produce a 128-byte NAMEDATALEN 2.14 snapshot that is compatible with the 128-byte NAMEDATALEN master build to test YSQL upgrade. (3.1) The default test fails as expected because the default snapshot 2.0.9.0 was built with 64-byte NAMEDATALEN and is not compatible with a 128-byte build. FAIL ./yb_build.sh release --java-test 'org.yb.pgsql.TestYsqlUpgrade' (3.2) Run the customized test using the 128-byte 2.14 snapshot. PASS ./yb_build.sh release --java-test 'org.yb.pgsql.TestYsqlUpgrade' --java-test-args '-Dysql_sys_catalog_snapshot_path=/tmp/ysql-sys-catalog-snapshots-128/initial_sys_catalog_snapshot_2.14_release' Reviewers: yguan Reviewed By: yguan Subscribers: yql Differential Revision: https://phorge.dev.yugabyte.com/D36198
- Loading branch information