Skip to content

Commit

Permalink
[#26029] xCluster: Remove the --xcluster_enable_sequence_replication …
Browse files Browse the repository at this point in the history
…flag kill switch

Summary:
As title.  This is equivalent to hard wiring it to be always true.
Jira: DB-15359

Test Plan: Jenkins

Reviewers: xCluster, hsunder

Reviewed By: hsunder

Subscribers: ybase

Differential Revision: https://phorge.dev.yugabyte.com/D41912
  • Loading branch information
mdbridge committed Feb 14, 2025
1 parent 1abe9c7 commit 416045a
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 30 deletions.
3 changes: 0 additions & 3 deletions src/yb/integration-tests/xcluster/xcluster_ysql_test_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ DECLARE_bool(cdc_enable_implicit_checkpointing);
DECLARE_bool(TEST_create_table_with_empty_pgschema_name);
DECLARE_bool(TEST_use_custom_varz);
DECLARE_bool(TEST_xcluster_enable_ddl_replication);
DECLARE_bool(TEST_xcluster_enable_sequence_replication);
DECLARE_uint64(TEST_pg_auth_key);

namespace yb {
Expand All @@ -67,8 +66,6 @@ void XClusterYsqlTestBase::SetUp() {
LOG(INFO) << "DB-scoped replication will use automatic mode: " << UseAutomaticMode();
ANNOTATE_UNPROTECTED_WRITE(FLAGS_TEST_xcluster_enable_ddl_replication) =
UseAutomaticMode();
ANNOTATE_UNPROTECTED_WRITE(FLAGS_TEST_xcluster_enable_sequence_replication) =
UseAutomaticMode();
}

Status XClusterYsqlTestBase::Initialize(uint32_t replication_factor, uint32_t num_masters) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ DEFINE_test_flag(bool, exit_unfinished_merging, false,

DECLARE_bool(enable_xcluster_auto_flag_validation);

DECLARE_bool(TEST_xcluster_enable_sequence_replication);

DECLARE_uint32(xcluster_ysql_statement_timeout_sec);

using namespace std::placeholders;
Expand Down Expand Up @@ -259,14 +257,13 @@ Status XClusterInboundReplicationGroupSetupTask::FirstStep() {
RETURN_NOT_OK(GetAutoFlagConfigVersionIfCompatible());
}

if (data_.automatic_ddl_mode && FLAGS_TEST_xcluster_enable_sequence_replication &&
!is_alter_replication_) {
if (data_.automatic_ddl_mode && !is_alter_replication_) {
// Ensure sequences_data table has been created.
// Skip for alter replication as the table should already have been created on initial setup.
auto local_client = master_.client_future();
RETURN_NOT_OK(tserver::CreateSequencesDataTable(
local_client.get(), CoarseMonoClock::now() +
MonoDelta::FromSeconds(FLAGS_xcluster_ysql_statement_timeout_sec)));
MonoDelta::FromSeconds(FLAGS_xcluster_ysql_statement_timeout_sec)));
}

ScheduleNextStep(
Expand Down Expand Up @@ -294,8 +291,7 @@ Status XClusterInboundReplicationGroupSetupTask::SetupDDLReplicationExtension()
}
}

if (data_.automatic_ddl_mode && FLAGS_TEST_xcluster_enable_sequence_replication &&
!is_alter_replication_) {
if (data_.automatic_ddl_mode && !is_alter_replication_) {
ScheduleNextStep(
std::bind(
&XClusterInboundReplicationGroupSetupTask::BootstrapSequencesData, shared_from(this)),
Expand Down Expand Up @@ -607,7 +603,7 @@ Status XClusterInboundReplicationGroupSetupTask::ValidateTableListForDbScoped()
auto table_designators = VERIFY_RESULT(GetTablesEligibleForXClusterReplication(
catalog_manager_, namespace_id,
/*include_sequences_data=*/
(data_.automatic_ddl_mode && FLAGS_TEST_xcluster_enable_sequence_replication)));
data_.automatic_ddl_mode));

std::vector<TableId> missing_tables;

Expand Down
4 changes: 0 additions & 4 deletions src/yb/master/xcluster/xcluster_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ DEFINE_RUNTIME_uint32(xcluster_ysql_statement_timeout_sec, 120,
DEFINE_test_flag(bool, xcluster_enable_ddl_replication, false,
"Enables xCluster automatic DDL replication.");

DEFINE_test_flag(bool, xcluster_enable_sequence_replication, false,
"Enable xCluster automatic replication of sequences (requires automatic DB-scoped "
"replication).");

DEFINE_test_flag(bool, force_automatic_ddl_replication_mode, false,
"Make XClusterCreateOutboundReplicationGroup always use automatic instead of semi-automatic "
"xCluster replication mode.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
DECLARE_bool(TEST_enable_sync_points);
DECLARE_bool(TEST_block_xcluster_checkpoint_namespace_task);
DECLARE_bool(TEST_xcluster_enable_ddl_replication);
DECLARE_bool(TEST_xcluster_enable_sequence_replication);

using namespace std::chrono_literals;
using namespace std::placeholders;
Expand Down Expand Up @@ -166,8 +165,6 @@ class XClusterOutboundReplicationGroupMockedTest : public YBTest {
YBTest::SetUp();
LOG(INFO) << "Test uses automatic mode: " << UseAutomaticMode();
ANNOTATE_UNPROTECTED_WRITE(FLAGS_TEST_xcluster_enable_ddl_replication) = UseAutomaticMode();
ANNOTATE_UNPROTECTED_WRITE(FLAGS_TEST_xcluster_enable_sequence_replication) =
UseAutomaticMode();
}

virtual bool UseAutomaticMode() {
Expand Down
12 changes: 4 additions & 8 deletions src/yb/master/xcluster/xcluster_outbound_replication_group.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
DEFINE_RUNTIME_uint32(max_xcluster_streams_to_checkpoint_in_parallel, 200,
"Maximum number of xCluster streams to checkpoint in parallel");

DECLARE_bool(TEST_xcluster_enable_sequence_replication);

using namespace std::placeholders;

namespace yb::master {
Expand Down Expand Up @@ -266,8 +264,7 @@ Result<bool> XClusterOutboundReplicationGroup::MarkBootstrapTablesAsCheckpointed

if (table_ids.empty()) {
auto table_designators = VERIFY_RESULT(helper_functions_.get_tables_func(
namespace_id, /*include_sequences_data=*/(
AutomaticDDLMode() && FLAGS_TEST_xcluster_enable_sequence_replication)));
namespace_id, /*include_sequences_data=*/AutomaticDDLMode()));
std::set<TableId> tables;
std::transform(
table_designators.begin(), table_designators.end(), std::inserter(tables, tables.begin()),
Expand Down Expand Up @@ -347,8 +344,8 @@ Result<XClusterOutboundReplicationGroup::NamespaceInfoPB>
XClusterOutboundReplicationGroup::CreateNamespaceInfo(
const NamespaceId& namespace_id, const LeaderEpoch& epoch) {
auto table_designators = VERIFY_RESULT(helper_functions_.get_tables_func(
namespace_id, /*include_sequences_data=*/(
AutomaticDDLMode() && FLAGS_TEST_xcluster_enable_sequence_replication)));
namespace_id, /*include_sequences_data=*/
AutomaticDDLMode()));
VLOG_WITH_PREFIX_AND_FUNC(1) << "Tables: " << yb::ToString(table_designators);

// In automatic DDL mode the DDL queue table and sequences tables will be created automatically.
Expand Down Expand Up @@ -633,8 +630,7 @@ XClusterOutboundReplicationGroup::GetNamespaceCheckpointInfo(
const NamespaceId& namespace_id,
const std::vector<std::pair<TableName, PgSchemaName>>& table_names) const {
auto all_tables = VERIFY_RESULT(helper_functions_.get_tables_func(
namespace_id, /*include_sequences_data=*/(
AutomaticDDLMode() && FLAGS_TEST_xcluster_enable_sequence_replication)));
namespace_id, /*include_sequences_data=*/AutomaticDDLMode()));

SharedLock mutex_lock(mutex_);
auto l = VERIFY_RESULT(LockForRead());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
DEFINE_test_flag(bool, block_xcluster_checkpoint_namespace_task, false,
"When enabled XClusterCheckpointNamespaceTask will be blocked");

DECLARE_bool(TEST_xcluster_enable_sequence_replication);

using namespace std::placeholders;

namespace yb::master {
Expand Down Expand Up @@ -66,8 +64,7 @@ std::string XClusterCheckpointNamespaceTask::description() const {
}

Status XClusterCheckpointNamespaceTask::FirstStep() {
if (outbound_replication_group_.AutomaticDDLMode() &&
FLAGS_TEST_xcluster_enable_sequence_replication) {
if (outbound_replication_group_.AutomaticDDLMode()) {
// Ensure sequences_data table has been created and added to our tables to checkpoint.
// TODO: Consider making this async so we don't have to burn a thread waiting.
RETURN_NOT_OK(outbound_replication_group_.helper_functions_.create_sequences_data_table_func());
Expand Down

0 comments on commit 416045a

Please sign in to comment.