Skip to content

Commit

Permalink
[#23414] xCluster: Convert enable_xcluster_api_v2 to an AutoFlag
Browse files Browse the repository at this point in the history
Summary:
Convert `enable_xcluster_api_v2` to an AutoFlag.
With this flag enabled we will store `SysXClusterOutboundReplicationGroupEntryPB` in sys_catalog and use new xCluster APIs that are between the two universes hence this is an kExternal type flag.

Fixes #23414
Jira: DB-12337

Test Plan: Jenkins

Reviewers: jhe, slingam, xCluster

Reviewed By: slingam

Subscribers: ybase, yugaware

Differential Revision: https://phorge.dev.yugabyte.com/D37101
  • Loading branch information
hari90 committed Aug 7, 2024
1 parent e0629f3 commit 1d1780c
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 24 deletions.
2 changes: 0 additions & 2 deletions bin/yugabyted
Original file line number Diff line number Diff line change
Expand Up @@ -3243,8 +3243,6 @@ class ControlScript(object):
"--webserver_port={}".format(self.configs.saved_data.get("master_webserver_port")),
"--default_memory_limit_to_ram_ratio=0.35",
"--instance_uuid_override={}".format(self.configs.saved_data.get("master_uuid")),
"--enable_xcluster_api_v2=true",
"--allowed_preview_flags_csv=enable_xcluster_api_v2",
]

if self.configs.saved_data.get("secure"):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import com.yugabyte.yw.common.PlacementInfoUtil;
import com.yugabyte.yw.common.ReleaseManager;
import com.yugabyte.yw.common.config.GlobalConfKeys;
import com.yugabyte.yw.common.gflags.SpecificGFlags;
import com.yugabyte.yw.forms.DrConfigCreateForm;
import com.yugabyte.yw.forms.DrConfigSetDatabasesForm;
import com.yugabyte.yw.forms.TableInfoForm;
Expand All @@ -30,7 +29,6 @@
import com.yugabyte.yw.models.configs.CustomerConfig;
import com.yugabyte.yw.models.helpers.provider.LocalCloudInfo;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
Expand All @@ -49,13 +47,6 @@ public class DRDbScopedLocalTest extends DRLocalTestBase {
"https://s3.us-west-2.amazonaws.com/uploads.dev.yugabyte.com/"
+ "local-provider-test/2.23.0.0-b394/yugabyte-2.23.0.0-b394-%s-%s.tar.gz";

public static Map<String, String> dbScopedMasterGFlags = new HashMap<>(GFLAGS);

static {
dbScopedMasterGFlags.put("enable_xcluster_api_v2", "true");
dbScopedMasterGFlags.put("allowed_preview_flags_csv", "enable_xcluster_api_v2");
}

@Before
public void setupDrDbScoped() {
runtimeConfService.setKey(
Expand Down Expand Up @@ -94,7 +85,6 @@ public Universe createDRUniverse(
ybBinPath = deriveYBBinPath(DBVersion);
UniverseDefinitionTaskParams.UserIntent userIntent =
getDefaultUserIntent(universeName, disableTls);
userIntent.specificGFlags = SpecificGFlags.construct(dbScopedMasterGFlags, GFLAGS);
userIntent.numNodes = numNodes;
userIntent.replicationFactor = replicationFactor;

Expand Down
2 changes: 0 additions & 2 deletions src/yb/integration-tests/xcluster/xcluster_db_scoped-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "yb/master/catalog_manager.h"
#include "yb/master/mini_master.h"

DECLARE_bool(enable_xcluster_api_v2);
DECLARE_int32(cdc_parent_tablet_deletion_task_retry_secs);
DECLARE_string(certs_for_cdc_dir);
DECLARE_bool(disable_xcluster_db_scoped_new_table_processing);
Expand All @@ -37,7 +36,6 @@ class XClusterDBScopedTest : public XClusterYsqlTestBase {

virtual void SetUp() override {
XClusterYsqlTestBase::SetUp();
ANNOTATE_UNPROTECTED_WRITE(FLAGS_enable_xcluster_api_v2) = true;
}

Result<master::GetXClusterStreamsResponsePB> GetXClusterStreams(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "yb/integration-tests/xcluster/xcluster_ysql_test_base.h"
#include "yb/master/mini_master.h"

DECLARE_bool(enable_xcluster_api_v2);
DECLARE_int32(cdc_parent_tablet_deletion_task_retry_secs);
DECLARE_uint32(xcluster_consistent_wal_safe_time_frequency_ms);

Expand Down Expand Up @@ -51,7 +50,6 @@ class XClusterDDLReplicationTest : public XClusterYsqlTestBase {

virtual void SetUp() override {
XClusterYsqlTestBase::SetUp();
ANNOTATE_UNPROTECTED_WRITE(FLAGS_enable_xcluster_api_v2) = true;
ANNOTATE_UNPROTECTED_WRITE(FLAGS_TEST_xcluster_enable_ddl_replication) = true;
ANNOTATE_UNPROTECTED_WRITE(FLAGS_TEST_xcluster_ddl_queue_handler_log_queries) = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "yb/master/mini_master.h"
#include "yb/tablet/tablet_peer.h"

DECLARE_bool(enable_xcluster_api_v2);
DECLARE_uint32(cdc_wal_retention_time_secs);
DECLARE_uint32(max_xcluster_streams_to_checkpoint_in_parallel);
DECLARE_bool(TEST_block_xcluster_checkpoint_namespace_task);
Expand All @@ -36,8 +35,6 @@ class XClusterOutboundReplicationGroupTest : public XClusterYsqlTestBase {
public:
XClusterOutboundReplicationGroupTest() {}
void SetUp() override {
ANNOTATE_UNPROTECTED_WRITE(FLAGS_enable_xcluster_api_v2) = true;

XClusterYsqlTestBase::SetUp();
MiniClusterOptions opts;
opts.num_tablet_servers = 1;
Expand Down
4 changes: 0 additions & 4 deletions src/yb/integration-tests/xcluster/xcluster_ysql_index-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ DECLARE_string(vmodule);
DECLARE_bool(TEST_disable_apply_committed_transactions);
DECLARE_bool(TEST_xcluster_fail_table_create_during_bootstrap);
DECLARE_int32(TEST_user_ddl_operation_timeout_sec);
DECLARE_bool(enable_xcluster_api_v2);
DECLARE_bool(TEST_fail_universe_replication_merge);

using std::string;
Expand Down Expand Up @@ -476,7 +475,6 @@ class XClusterDbScopedYsqlIndexTest : public XClusterYsqlIndexTest {
const xcluster::ReplicationGroupId& replication_group_id,
const std::vector<TableId>& producer_table_ids,
const std::vector<xrepl::StreamId>& bootstrap_ids, SetupReplicationOptions opts) override {
ANNOTATE_UNPROTECTED_WRITE(FLAGS_enable_xcluster_api_v2) = true;
RETURN_NOT_OK(CheckpointReplicationGroup());
RETURN_NOT_OK(CreateReplicationFromCheckpoint());
return Status::OK();
Expand Down Expand Up @@ -519,8 +517,6 @@ class XClusterYsqlIndexProducerOnlyTest : public XClusterYsqlIndexTest {
google::SetVLOGLevel("multi_step*", 4);
google::SetVLOGLevel("catalog*", 4);

ANNOTATE_UNPROTECTED_WRITE(FLAGS_enable_xcluster_api_v2) = true;

XClusterYsqlTestBase::SetUp();
MiniClusterOptions opts;
opts.num_tablet_servers = 1;
Expand Down
2 changes: 1 addition & 1 deletion src/yb/master/xcluster/xcluster_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "yb/util/logging.h"
#include "yb/util/result.h"

DEFINE_RUNTIME_PREVIEW_bool(enable_xcluster_api_v2, false,
DEFINE_RUNTIME_AUTO_bool(enable_xcluster_api_v2, kExternal, false, true,
"Allow the usage of v2 xCluster APIs that support DB Scoped replication groups");

DEFINE_RUNTIME_bool(disable_xcluster_db_scoped_new_table_processing, false,
Expand Down

0 comments on commit 1d1780c

Please sign in to comment.