diff --git a/pg15_tests/test_upgrade_backslash_d.sh b/pg15_tests/test_upgrade_backslash_d.sh deleted file mode 100755 index 7ab1211456fd..000000000000 --- a/pg15_tests/test_upgrade_backslash_d.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env bash -source "${BASH_SOURCE[0]%/*}"/common.sh -source "${BASH_SOURCE[0]%/*}"/common_upgrade.sh - -run_and_pushd_pg11 - -# Create a pre-existing PG11 table -ysqlsh <AddExtraFlag(flag, value); + RETURN_NOT_OK_PREPEND( + SetFlag(daemon, flag, value), Format("Failed to set flag on $0", daemon->id())); + } + + return Status::OK(); +} uint16_t ExternalMiniCluster::AllocateFreePort() { // This will take a file lock ensuring the port does not get claimed by another thread/process diff --git a/src/yb/integration-tests/external_mini_cluster.h b/src/yb/integration-tests/external_mini_cluster.h index 15c1c0d029b5..941d143f89a8 100644 --- a/src/yb/integration-tests/external_mini_cluster.h +++ b/src/yb/integration-tests/external_mini_cluster.h @@ -504,6 +504,10 @@ class ExternalMiniCluster : public MiniClusterBase { // to get any effect of that change. void RemoveExtraFlagOnTServers(const std::string& flag); + // Adds the given flag to the extra flags on all servers. Also dynamically sets the flag on the + // running processes. Non runtime flags would still require a restart. + Status AddAndSetExtraFlag(const std::string& flag, const std::string& value); + // Allocates a free port and stores a file lock guarding access to that port into an internal // array of file locks. uint16_t AllocateFreePort(); diff --git a/src/yb/integration-tests/upgrade-tests/pg15_upgrade-test.cc b/src/yb/integration-tests/upgrade-tests/pg15_upgrade-test.cc new file mode 100644 index 000000000000..8b760fddeab5 --- /dev/null +++ b/src/yb/integration-tests/upgrade-tests/pg15_upgrade-test.cc @@ -0,0 +1,171 @@ +// Copyright (c) YugabyteDB, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software distributed under the License +// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +// or implied. See the License for the specific language governing permissions and limitations +// under the License. +// + +#include "yb/integration-tests/upgrade-tests/pg15_upgrade_test_base.h" + +#include "yb/yql/pgwrapper/libpq_utils.h" + +namespace yb { + +class Pg15UpgradeTest : public Pg15UpgradeTestBase { + public: + Pg15UpgradeTest() = default; +}; + +TEST_F(Pg15UpgradeTest, CheckVersion) { + const auto kSelectVersion = "SELECT version()"; + { + auto conn = ASSERT_RESULT(cluster_->ConnectToDB()); + auto version = ASSERT_RESULT(conn.FetchRowAsString(kSelectVersion)); + ASSERT_STR_CONTAINS(version, old_version_info().version); + } + + ASSERT_OK(UpgradeClusterToMixedMode()); + + { + auto conn = ASSERT_RESULT(CreateConnToTs(kMixedModeTserverPg15)); + auto version = ASSERT_RESULT(conn.FetchRowAsString(kSelectVersion)); + ASSERT_STR_CONTAINS(version, current_version_info().version_number()); + } + { + auto conn = ASSERT_RESULT(CreateConnToTs(kMixedModeTserverPg11)); + auto version = ASSERT_RESULT(conn.FetchRowAsString(kSelectVersion)); + ASSERT_STR_CONTAINS(version, old_version_info().version); + } + + ASSERT_OK(FinalizeUpgradeFromMixedMode()); + + { + auto conn = ASSERT_RESULT(cluster_->ConnectToDB()); + auto version = ASSERT_RESULT(conn.FetchRowAsString(kSelectVersion)); + ASSERT_STR_CONTAINS(version, current_version_info().version_number()); + } +} + +TEST_F(Pg15UpgradeTest, SimpleTable) { + const size_t kRowCount = 100; + // Create a table with 3 tablets and kRowCount rows so that each tablet has at least a few rows. + ASSERT_OK(ExecuteStatements( + {"CREATE TABLE t (a INT) SPLIT INTO 3 TABLETS", + Format("INSERT INTO t VALUES(generate_series(1, $0))", kRowCount)})); + static const auto kSelectFromTable = "SELECT * FROM t"; + + ASSERT_OK(UpgradeClusterToMixedMode()); + + { + auto conn = ASSERT_RESULT(CreateConnToTs(kMixedModeTserverPg15)); + auto count = ASSERT_RESULT(conn.Fetch(kSelectFromTable)); + ASSERT_EQ(PQntuples(count.get()), kRowCount); + } + { + auto conn = ASSERT_RESULT(CreateConnToTs(kMixedModeTserverPg11)); + auto count = ASSERT_RESULT(conn.Fetch(kSelectFromTable)); + ASSERT_EQ(PQntuples(count.get()), kRowCount); + } + + ASSERT_OK(FinalizeUpgradeFromMixedMode()); + + // Verify row count from a random tserver. + { + auto conn = ASSERT_RESULT(cluster_->ConnectToDB()); + auto count = ASSERT_RESULT(conn.Fetch(kSelectFromTable)); + ASSERT_EQ(PQntuples(count.get()), kRowCount); + } +} + +TEST_F(Pg15UpgradeTest, BackslashD) { + ASSERT_OK(ExecuteStatement("CREATE TABLE t (a INT)")); + static const auto kBackslashD = "\\d"; + static const auto kExpectedResult = + " List of relations\n" + " Schema | Name | Type | Owner \n" + "--------+------+-------+----------\n" + " public | t | table | postgres\n" + "(1 row)\n\n"; + + auto result = ASSERT_RESULT(ExecuteViaYsqlsh(kBackslashD)); + ASSERT_EQ(result, kExpectedResult); + + ASSERT_OK(UpgradeClusterToMixedMode()); + + result = ASSERT_RESULT(ExecuteViaYsqlshOnTs(kBackslashD, kMixedModeTserverPg15)); + ASSERT_EQ(result, kExpectedResult); + result = ASSERT_RESULT(ExecuteViaYsqlshOnTs(kBackslashD, kMixedModeTserverPg11)); + ASSERT_EQ(result, kExpectedResult); + + ASSERT_OK(FinalizeUpgradeFromMixedMode()); + + // Verify the result from a random tserver. + result = ASSERT_RESULT(ExecuteViaYsqlsh(kBackslashD)); + ASSERT_EQ(result, kExpectedResult); +} + +TEST_F(Pg15UpgradeTest, Comments) { + const auto kPg11DatabaseComment = "PG11: [db] I came first!"; + const auto kPg11TableComment = "PG11: [table] I came first!"; + ASSERT_OK(ExecuteStatements( + {"CREATE TABLE t (a int)", + Format("COMMENT ON DATABASE yugabyte IS '$0'", kPg11DatabaseComment), + Format("COMMENT ON TABLE t IS '$0'", kPg11TableComment)})); + + ASSERT_OK(UpgradeClusterToMixedMode()); + + const auto kSelectDatabaseComment = + "SELECT pg_catalog.shobj_description(d.oid, 'pg_database') FROM pg_catalog.pg_database d " + "WHERE datname = 'yugabyte'"; + const auto kSelectTableComment = + "SELECT description from pg_description JOIN pg_class on pg_description.objoid = " + "pg_class.oid WHERE relname = 't'"; + + auto check_pg11_comment = [&](pgwrapper::PGConn& conn) { + auto comment = ASSERT_RESULT(conn.FetchRow(kSelectDatabaseComment)); + ASSERT_EQ(comment, kPg11DatabaseComment); + comment = ASSERT_RESULT(conn.FetchRow(kSelectTableComment)); + ASSERT_EQ(comment, kPg11TableComment); + }; + + { + auto conn = ASSERT_RESULT(CreateConnToTs(kMixedModeTserverPg15)); + ASSERT_NO_FATALS(check_pg11_comment(conn)); + } + { + auto conn = ASSERT_RESULT(CreateConnToTs(kMixedModeTserverPg11)); + ASSERT_NO_FATALS(check_pg11_comment(conn)); + } + + ASSERT_OK(FinalizeUpgradeFromMixedMode()); + + // Check the comment from a random tserver. + { + auto conn = ASSERT_RESULT(cluster_->ConnectToDB()); + ASSERT_NO_FATALS(check_pg11_comment(conn)); + } + + // Update the comment. + const auto kPg15DatabaseComment = "PG15: [db] I am better than you!"; + const auto kPg15TableComment = "PG15: [table] I am better than you!"; + ASSERT_OK(ExecuteStatements( + {Format("COMMENT ON DATABASE yugabyte IS '$0'", kPg15DatabaseComment), + Format("COMMENT ON TABLE t IS '$0'", kPg15TableComment)})); + + // Check the new comment from a random tserver. + { + auto conn = ASSERT_RESULT(cluster_->ConnectToDB()); + auto comment = ASSERT_RESULT(conn.FetchRow(kSelectDatabaseComment)); + ASSERT_EQ(comment, kPg15DatabaseComment); + comment = ASSERT_RESULT(conn.FetchRow(kSelectTableComment)); + ASSERT_EQ(comment, kPg15TableComment); + } +} + +} // namespace yb diff --git a/src/yb/integration-tests/upgrade-tests/pg15_upgrade_test_base.cc b/src/yb/integration-tests/upgrade-tests/pg15_upgrade_test_base.cc new file mode 100644 index 000000000000..9ef572b27d97 --- /dev/null +++ b/src/yb/integration-tests/upgrade-tests/pg15_upgrade_test_base.cc @@ -0,0 +1,129 @@ +// Copyright (c) YugabyteDB, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software distributed under the License +// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +// or implied. See the License for the specific language governing permissions and limitations +// under the License. +// + +#include "yb/integration-tests/upgrade-tests/pg15_upgrade_test_base.h" +#include "yb/yql/pgwrapper/libpq_utils.h" + +namespace yb { + +void Pg15UpgradeTestBase::SetUp() { + UpgradeTestBase::SetUp(); + if (IsTestSkipped()) { + return; + } + CHECK_OK_PREPEND(StartClusterInOldVersion(), "Failed to start cluster in old version"); + CHECK(IsYsqlMajorVersionUpgrade()); + CHECK_GT(cluster_->num_tablet_servers(), 1); +} + +Status Pg15UpgradeTestBase::UpgradeClusterToMixedMode() { + LOG(INFO) << "Upgrading cluster to mixed mode"; + + static const MonoDelta no_delay_between_nodes = 0s; + RETURN_NOT_OK_PREPEND( + RestartAllMastersInCurrentVersion(no_delay_between_nodes), "Failed to restart masters"); + + RETURN_NOT_OK_PREPEND( + PerformYsqlMajorVersionUpgrade(), "Failed to run ysql major version upgrade"); + + LOG(INFO) << "Restarting yb-tserver " << kMixedModeTserverPg15 << " in current version"; + auto mixed_mode_pg15_tserver = cluster_->tablet_server(kMixedModeTserverPg15); + RETURN_NOT_OK(RestartTServerInCurrentVersion( + *mixed_mode_pg15_tserver, /*wait_for_cluster_to_stabilize=*/true)); + + return Status::OK(); +} + +Status Pg15UpgradeTestBase::FinalizeUpgradeFromMixedMode() { + LOG(INFO) << "Restarting all other yb-tservers in current version"; + + auto mixed_mode_pg15_tserver = cluster_->tablet_server(kMixedModeTserverPg15); + for (auto* tserver : cluster_->tserver_daemons()) { + if (tserver == mixed_mode_pg15_tserver) { + continue; + } + RETURN_NOT_OK( + RestartTServerInCurrentVersion(*tserver, /*wait_for_cluster_to_stabilize=*/false)); + } + + RETURN_NOT_OK(WaitForClusterToStabilize()); + + RETURN_NOT_OK(UpgradeTestBase::FinalizeUpgrade()); + + return Status::OK(); +} + +Status Pg15UpgradeTestBase::RollbackUpgradeFromMixedMode() { + RETURN_NOT_OK_PREPEND(RollbackVolatileAutoFlags(), "Failed to rollback Volatile AutoFlags"); + + LOG(INFO) << "Restarting yb-tserver " << kMixedModeTserverPg15 << " in old version"; + auto first_tserver = cluster_->tablet_server(kMixedModeTserverPg15); + RETURN_NOT_OK(RestartTServerInOldVersion(*first_tserver, /*wait_for_cluster_to_stabilize=*/true)); + + RETURN_NOT_OK_PREPEND(RollbackYsqlMajorVersion(), "Failed to run ysql major version rollback"); + + static const MonoDelta no_delay_between_nodes = 0s; + RETURN_NOT_OK_PREPEND( + RestartAllMastersInOldVersion(no_delay_between_nodes), "Failed to restart masters"); + + return Status::OK(); +} + +Status Pg15UpgradeTestBase::ExecuteStatements(const std::vector& sql_statements) { + auto conn = VERIFY_RESULT(cluster_->ConnectToDB()); + for (const auto& statement : sql_statements) { + RETURN_NOT_OK(conn.Execute(statement)); + } + return Status::OK(); +} + +Result Pg15UpgradeTestBase::CreateConnToTs(size_t ts_id) { + return cluster_->ConnectToDB("yugabyte", ts_id); +} + +Status Pg15UpgradeTestBase::ExecuteStatement(const std::string& sql_statement) { + return ExecuteStatements({sql_statement}); +} + +Result Pg15UpgradeTestBase::ExecuteViaYsqlshOnTs( + const std::string& sql_statement, size_t ts_id) { + // tserver could have restarted recently. Create a connection which will wait till the pg process + // is up. + RETURN_NOT_OK(CreateConnToTs(ts_id)); + + auto tserver = cluster_->tablet_server(ts_id); + std::vector args; + args.push_back(GetPgToolPath("ysqlsh")); + args.push_back("--host"); + args.push_back(tserver->bind_host()); + args.push_back("--port"); + args.push_back(AsString(tserver->pgsql_rpc_port())); + args.push_back("-c"); + args.push_back(sql_statement); + + std::string output, error; + LOG_WITH_FUNC(INFO) << "Executing on " << ts_id << ": " << AsString(args); + auto status = Subprocess::Call(args, &output, &error); + if (!status.ok()) { + return status.CloneAndAppend(error); + } + LOG_WITH_FUNC(INFO) << "Command output: " << output; + return output; +} + +Result Pg15UpgradeTestBase::ExecuteViaYsqlsh(const std::string& sql_statement) { + auto node_index = RandomUniformInt(0, cluster_->num_tablet_servers() - 1); + return ExecuteViaYsqlshOnTs(sql_statement, node_index); +} + +} // namespace yb diff --git a/src/yb/integration-tests/upgrade-tests/pg15_upgrade_test_base.h b/src/yb/integration-tests/upgrade-tests/pg15_upgrade_test_base.h new file mode 100644 index 000000000000..8e3559e981f4 --- /dev/null +++ b/src/yb/integration-tests/upgrade-tests/pg15_upgrade_test_base.h @@ -0,0 +1,61 @@ +// Copyright (c) YugabyteDB, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software distributed under the License +// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +// or implied. See the License for the specific language governing permissions and limitations +// under the License. +// + +#pragma once + +#include "yb/integration-tests/upgrade-tests/upgrade_test_base.h" + +namespace yb { + +class Pg15UpgradeTestBase : public UpgradeTestBase { + public: + Pg15UpgradeTestBase() : UpgradeTestBase(kBuild_2_20_2_4) {} + virtual ~Pg15UpgradeTestBase() override = default; + + void SetUp() override; + + protected: + // UpgradeTestBase provides helper functions UpgradeClusterToCurrentVersion, FinalizeUpgrade, + // and RollbackClusterToOldVersion. These restart all tservers to the current version. The below + // helper functions only upgrade one tserver (id=kMixedModeTserverPg15) to the current version and + // keep the other tservers in the old version, helping us perform validations while in mixed mode. + + const size_t kMixedModeTserverPg15 = 0; + const size_t kMixedModeTserverPg11 = 1; + + // Restarts all masters in the current version, runs ysql major version upgrade, and restarts + // tserver kMixedModeTserverPg15 in the current version. Other tservers are kept in the pg11 + // version. + Status UpgradeClusterToMixedMode(); + + // Restarts all other tservers in the current version, and finalizes the upgrade. + Status FinalizeUpgradeFromMixedMode(); + + // Restarts tserver kMixedModeTserverPg15 in the old version, rolls backs the ysql major version + // upgrade, and restarts all masters in the old version. + Status RollbackUpgradeFromMixedMode(); + + // Connects to a random tserver and executes ysql statements. + Status ExecuteStatements(const std::vector& sql_statements); + Status ExecuteStatement(const std::string& sql_statement); + + Result CreateConnToTs(size_t ts_id); + + // Run a ysql statement via ysqlsh against a given tserver. + Result ExecuteViaYsqlshOnTs(const std::string& sql_statement, size_t ts_id); + + // Run a ysql statement via ysqlsh against a random tserver. + Result ExecuteViaYsqlsh(const std::string& sql_statement); +}; + +} // namespace yb diff --git a/src/yb/integration-tests/upgrade-tests/upgrade_test_base.cc b/src/yb/integration-tests/upgrade-tests/upgrade_test_base.cc index 2ad98df3fd46..57f4ce584a32 100644 --- a/src/yb/integration-tests/upgrade-tests/upgrade_test_base.cc +++ b/src/yb/integration-tests/upgrade-tests/upgrade_test_base.cc @@ -186,17 +186,30 @@ Status RestartDaemonInVersion(T& daemon, const std::string& bin_path) { return daemon.Restart(); } -// Add the flag_name to undefok list, so that it can be set on all versions even if the version does -// not contain the flag. If the flag_list already contains an undefok flag, append to it, else -// insert a new entry. -void AddUnDefOkFlag(std::vector& flag_list, const std::string& flag_name) { +void AddFlagToCsvFlag( + std::vector& flag_list, const std::string& flag_name, + const std::string& flag_to_add) { for (auto& flag : flag_list) { - if (flag.find("--undefok=")) { - flag += Format(",$0", flag_name); + if (flag.starts_with(Format("--$0=", flag_name))) { + flag += Format(",$0", flag_to_add); return; } } - flag_list.push_back(Format("--undefok=$0", flag_name)); + flag_list.push_back(Format("--$0=$1", flag_name, flag_to_add)); +} + +// Add the flag_name to undefok list, so that it can be set on all versions even if the version does +// not contain the flag. If the flag_list already contains an undefok flag, append to it, else +// insert a new entry. +void AddUnDefOkAndSetFlag( + std::vector& flag_list, const std::string& flag_name, + const std::string& flag_value) { + AddFlagToCsvFlag(flag_list, "undefok", flag_name); + flag_list.emplace_back(Format("--$0=$1", flag_name, flag_value)); +} + +void AddAllowedPreviewFlag(std::vector& flag_list, const std::string& flag_name) { + AddFlagToCsvFlag(flag_list, "allowed_preview_flags_csv", flag_name); } void WaitForAutoFlagApply() { SleepFor(FLAGS_auto_flags_apply_delay_ms * 1ms + 3s); } @@ -219,19 +232,23 @@ UpgradeTestBase::UpgradeTestBase(const std::string& from_version) void UpgradeTestBase::SetUp() { if (old_version_info_.version != kBuild_2_20_2_4) { + test_skipped_ = true; GTEST_SKIP() << "PG15 upgrade is only supported from version " << kBuild_2_20_2_4; } if (IsSanitizer()) { + test_skipped_ = true; GTEST_SKIP() << "Upgrade testing not supported with sanitizers"; } if (old_version_info_.version.empty()) { + test_skipped_ = true; CHECK(false) << "Build info for old version not set"; return; } if (GetRelevantUrl(old_version_info_).empty()) { + test_skipped_ = true; GTEST_SKIP() << "Upgrade testing not supported from version " << old_version_info_.version << " for this OS architecture and build type"; } @@ -257,10 +274,19 @@ Status UpgradeTestBase::StartClusterInOldVersion(const ExternalMiniClusterOption opts.daemon_bin_path = VERIFY_RESULT(DownloadAndGetBinPath(old_version_info_)); // Disable TEST_always_return_consensus_info_for_succeeded_rpc since it is not upgrade safe. - AddUnDefOkFlag(opts.extra_master_flags, "TEST_always_return_consensus_info_for_succeeded_rpc"); - opts.extra_master_flags.push_back("--TEST_always_return_consensus_info_for_succeeded_rpc=false"); - AddUnDefOkFlag(opts.extra_tserver_flags, "TEST_always_return_consensus_info_for_succeeded_rpc"); - opts.extra_tserver_flags.push_back("--TEST_always_return_consensus_info_for_succeeded_rpc=false"); + AddUnDefOkAndSetFlag( + opts.extra_master_flags, "TEST_always_return_consensus_info_for_succeeded_rpc", "false"); + AddUnDefOkAndSetFlag( + opts.extra_tserver_flags, "TEST_always_return_consensus_info_for_succeeded_rpc", "false"); + + // YB_TODO: Enable ysql_enable_db_catalog_version_mode since it is not major version upgrade + // safe. + if (old_version_info_.version == kBuild_2_20_2_4) { + AddAllowedPreviewFlag(opts.extra_master_flags, "ysql_enable_db_catalog_version_mode"); + AddUnDefOkAndSetFlag(opts.extra_master_flags, "ysql_enable_db_catalog_version_mode", "true"); + AddAllowedPreviewFlag(opts.extra_tserver_flags, "ysql_enable_db_catalog_version_mode"); + AddUnDefOkAndSetFlag(opts.extra_tserver_flags, "ysql_enable_db_catalog_version_mode", "true"); + } LOG(INFO) << "Starting cluster in version: " << old_version_info_.version; @@ -285,6 +311,19 @@ Status UpgradeTestBase::StartClusterInOldVersion(const ExternalMiniClusterOption is_ysql_major_version_upgrade_ = resp.status().version_info().ysql_major_version() != current_version_info_.ysql_major_version(); + if (IsYsqlMajorVersionUpgrade()) { + // YB_TODO: Remove when support for expression pushdown in mixed mode is implemented. + RETURN_NOT_OK(cluster_->AddAndSetExtraFlag("ysql_yb_enable_expression_pushdown", "false")); + } + + if (old_version_info_.version == kBuild_2_20_2_4) { + // YB_TODO: Remove when the min upgrade-from version is 2024.1+. + auto conn = VERIFY_RESULT(cluster_->ConnectToDB()); + RETURN_NOT_OK(conn.Execute("SET yb_non_ddl_txn_for_sys_tables_allowed=true")); + RETURN_NOT_OK(conn.Fetch("SELECT yb_fix_catalog_version_table(true)")); + RETURN_NOT_OK(conn.Execute("SET yb_non_ddl_txn_for_sys_tables_allowed=false")); + } + return Status::OK(); } @@ -539,13 +578,13 @@ Status UpgradeTestBase::RollbackVolatileAutoFlags() { Status UpgradeTestBase::RollbackClusterToOldVersion(MonoDelta delay_between_nodes) { LOG(INFO) << "Rolling back upgrade"; - RETURN_NOT_OK_PREPEND(RollbackYsqlMajorVersion(), "Failed to run ysql major version rollback"); - RETURN_NOT_OK_PREPEND(RollbackVolatileAutoFlags(), "Failed to rollback Volatile AutoFlags"); RETURN_NOT_OK_PREPEND( RestartAllTServersInOldVersion(delay_between_nodes), "Failed to restart tservers"); + RETURN_NOT_OK_PREPEND(RollbackYsqlMajorVersion(), "Failed to run ysql major version rollback"); + RETURN_NOT_OK_PREPEND( RestartAllMastersInOldVersion(delay_between_nodes), "Failed to restart masters"); diff --git a/src/yb/integration-tests/upgrade-tests/upgrade_test_base.h b/src/yb/integration-tests/upgrade-tests/upgrade_test_base.h index 3904dc1dca8a..8ee7188c8417 100644 --- a/src/yb/integration-tests/upgrade-tests/upgrade_test_base.h +++ b/src/yb/integration-tests/upgrade-tests/upgrade_test_base.h @@ -86,9 +86,14 @@ class UpgradeTestBase : public ExternalMiniClusterITestBase { VersionInfoPB current_version_info() const { return current_version_info_; } TestThreadHolder test_thread_holder_; + bool IsYsqlMajorVersionUpgrade() const { return is_ysql_major_version_upgrade_; } + + bool IsTestSkipped() const { return test_skipped_; } + private: const BuildInfo old_version_info_; VersionInfoPB current_version_info_; + bool test_skipped_ = false; std::string old_version_bin_path_, current_version_bin_path_; std::string old_version_master_bin_path_, current_version_master_bin_path_; @@ -103,16 +108,4 @@ class UpgradeTestBase : public ExternalMiniClusterITestBase { static constexpr auto kBuild_2_20_2_4 = "2.20.2.4"; static constexpr auto kBuild_2024_1_0_1 = "2024.1.0.1"; -// Helper classes for specific versions -class TestUpgradeFrom_2_20_2_4 : public UpgradeTestBase { - public: - TestUpgradeFrom_2_20_2_4() : UpgradeTestBase(kBuild_2_20_2_4) {} - virtual ~TestUpgradeFrom_2_20_2_4() = default; -}; - -class TestUpgradeFrom_2024_1_0_1 : public UpgradeTestBase { - public: - TestUpgradeFrom_2024_1_0_1() : UpgradeTestBase(kBuild_2024_1_0_1) {} -}; - } // namespace yb