Skip to content

Commit 53f9b04

Browse files
committed
BUG#35114864 Improve NOTE: The Cluster's group_replication_view_change_uuid
This patch improves the note shown when rescanning a cluster and the group_replication_view_change_uuid var is set (persisted) but not yet being used. The new note is more explicit regarding the interaction between the var and if the Cluster is to be used in a ClusterSet. Also, a warning telling the user to call rebootClusterFromCompleteOutage (to force the var to be used) was removed, mainly because it is unnecessary: if the user tries to create a ClusterSet, a check is made and the command fails if group_replication_view_change_uuid hasn't the correct value. Change-Id: I76c2427ad7cee300c0270f7a57d5a818f75cbf58 (cherry picked from commit 2012fb06bc07c4a0d1c88c41fb4cf7d20c0e80b1)
1 parent cbda23b commit 53f9b04

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

modules/adminapi/cluster/rescan.cc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -690,8 +690,6 @@ void Rescan::ensure_view_change_uuid_set() {
690690
Precondition_checker::k_min_cs_version)
691691
return;
692692

693-
auto console = mysqlsh::current_console();
694-
695693
// Check if group_replication_view_change_uuid is already set on the cluster
696694
std::shared_ptr<Instance> cluster_instance = m_cluster->get_cluster_server();
697695
auto view_change_uuid = cluster_instance->get_sysvar_string(
@@ -707,16 +705,19 @@ void Rescan::ensure_view_change_uuid_set() {
707705
->get_persisted_value("group_replication_view_change_uuid")
708706
.value_or("");
709707

708+
auto console = mysqlsh::current_console();
709+
710710
if (!view_change_uuid_persisted.empty() &&
711711
view_change_uuid_persisted != view_change_uuid) {
712-
console->print_note(
713-
"The Cluster's group_replication_view_change_uuid is set but not "
714-
"yet effective");
712+
console->print_warning(
713+
"The current Cluster group_replication_view_change_uuid setting does "
714+
"not allow ClusterSet to be implemented, because it's set but not "
715+
"yet effective.");
715716

716717
skip_md_mismatch_check = true;
717718
} else {
718719
console->print_note(
719-
"The Cluster's group_replication_view_change_uuid is not set");
720+
"The Cluster's group_replication_view_change_uuid is not set.");
720721
console->print_info(
721722
"Generating and setting a value for "
722723
"group_replication_view_change_uuid...");
@@ -729,11 +730,10 @@ void Rescan::ensure_view_change_uuid_set() {
729730
auto cfg = m_cluster->create_config_object({}, false, true);
730731

731732
cfg->set("group_replication_view_change_uuid", view_change_uuid);
732-
733733
cfg->apply();
734734
}
735735

736-
console->print_warning(
736+
console->print_note(
737737
"The Cluster must be completely taken OFFLINE and restarted "
738738
"(<<<dba.rebootClusterFromCompleteOutage>>>()) for the settings to "
739739
"be effective");
@@ -996,7 +996,7 @@ shcore::Value Rescan::execute() {
996996

997997
if (view_change_uuid == "AUTOMATIC") {
998998
if (m_options.update_view_change_uuid.is_null()) {
999-
console->print_warning(
999+
console->print_note(
10001000
"The Cluster is not configured to use "
10011001
"'group_replication_view_change_uuid', which is required "
10021002
"for InnoDB ClusterSet. Configuring it requires a full Cluster "

unittest/scripts/auto/js_adminapi/scripts/cluster_rescan.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -672,23 +672,23 @@ shell.options["useWizards"] = false;
672672
// Validate output with interactive disabled
673673
EXPECT_NO_THROWS(function() { cluster.rescan(); });
674674

675-
EXPECT_OUTPUT_CONTAINS("WARNING: The Cluster is not configured to use 'group_replication_view_change_uuid', which is required for InnoDB ClusterSet. Configuring it requires a full Cluster reboot.");
675+
EXPECT_OUTPUT_CONTAINS("NOTE: The Cluster is not configured to use 'group_replication_view_change_uuid', which is required for InnoDB ClusterSet. Configuring it requires a full Cluster reboot.");
676676
EXPECT_OUTPUT_CONTAINS("Use the 'updateViewChangeUuid' option to generate and configure a value for the Cluster.");
677677
WIPE_STDOUT();
678678

679679
// Use the option and validate it's successful
680680
EXPECT_NO_THROWS(function() { cluster.rescan({updateViewChangeUuid: true}); });
681681

682-
EXPECT_OUTPUT_CONTAINS("NOTE: The Cluster's group_replication_view_change_uuid is not set");
682+
EXPECT_OUTPUT_CONTAINS("NOTE: The Cluster's group_replication_view_change_uuid is not set.");
683683
EXPECT_OUTPUT_CONTAINS("Generating and setting a value for group_replication_view_change_uuid...");
684-
EXPECT_OUTPUT_CONTAINS("WARNING: The Cluster must be completely taken OFFLINE and restarted (dba.rebootClusterFromCompleteOutage()) for the settings to be effective");
684+
EXPECT_OUTPUT_CONTAINS("NOTE: The Cluster must be completely taken OFFLINE and restarted (dba.rebootClusterFromCompleteOutage()) for the settings to be effective");
685685
EXPECT_OUTPUT_CONTAINS("Updating group_replication_view_change_uuid in the Cluster's metadata...");
686686
WIPE_STDOUT();
687687

688688
// Do not restart yet and confirm that cluster.rescan() detects a restart is needed for the change to be effective
689689
EXPECT_NO_THROWS(function() { cluster.rescan({updateViewChangeUuid: true}); });
690-
EXPECT_OUTPUT_CONTAINS("NOTE: The Cluster's group_replication_view_change_uuid is set but not yet effective");
691-
EXPECT_OUTPUT_CONTAINS("WARNING: The Cluster must be completely taken OFFLINE and restarted (dba.rebootClusterFromCompleteOutage()) for the settings to be effective");
690+
EXPECT_OUTPUT_CONTAINS("WARNING: The current Cluster group_replication_view_change_uuid setting does not allow ClusterSet to be implemented, because it's set but not yet effective.");
691+
EXPECT_OUTPUT_CONTAINS("NOTE: The Cluster must be completely taken OFFLINE and restarted (dba.rebootClusterFromCompleteOutage()) for the settings to be effective");
692692
WIPE_STDOUT();
693693

694694
// Restart the instances and reboot it from complete outage after rescan() changed group_replication_view_change_uuid
@@ -731,9 +731,9 @@ EXPECT_EQ(view_change_uuid, view_change_uuid_md);
731731

732732
// cluster.rescan() must not warn or act if the target cluster has group_replication_view_change_uuid set
733733
EXPECT_NO_THROWS(function() { cluster.rescan(); });
734-
EXPECT_OUTPUT_NOT_CONTAINS("NOTE: The Cluster's group_replication_view_change_uuid is not set");
734+
EXPECT_OUTPUT_NOT_CONTAINS("NOTE: The Cluster's group_replication_view_change_uuid is not set.");
735735
EXPECT_OUTPUT_NOT_CONTAINS("Generating and setting a value for group_replication_view_change_uuid...");
736-
EXPECT_OUTPUT_NOT_CONTAINS("WARNING: The Cluster must be completely taken OFFLINE and restarted (dba.rebootClusterFromCompleteOutage()) for the settings to be effective");
736+
EXPECT_OUTPUT_NOT_CONTAINS("NOTE: The Cluster must be completely taken OFFLINE and restarted (dba.rebootClusterFromCompleteOutage()) for the settings to be effective");
737737
EXPECT_OUTPUT_NOT_CONTAINS("Updating group_replication_view_change_uuid in the Cluster's metadata...");
738738
WIPE_STDOUT();
739739

@@ -750,10 +750,10 @@ testutil.expectPrompt("Would you like 'group_replication_view_change_uuid' to be
750750

751751
EXPECT_NO_THROWS(function() { cluster.rescan(); });
752752

753-
EXPECT_OUTPUT_CONTAINS("WARNING: The Cluster is not configured to use 'group_replication_view_change_uuid', which is required for InnoDB ClusterSet. Configuring it requires a full Cluster reboot.");
753+
EXPECT_OUTPUT_CONTAINS("NOTE: The Cluster is not configured to use 'group_replication_view_change_uuid', which is required for InnoDB ClusterSet. Configuring it requires a full Cluster reboot.");
754754

755755
EXPECT_OUTPUT_CONTAINS("Generating and setting a value for group_replication_view_change_uuid...");
756-
EXPECT_OUTPUT_CONTAINS("WARNING: The Cluster must be completely taken OFFLINE and restarted (dba.rebootClusterFromCompleteOutage()) for the settings to be effective");
756+
EXPECT_OUTPUT_CONTAINS("NOTE: The Cluster must be completely taken OFFLINE and restarted (dba.rebootClusterFromCompleteOutage()) for the settings to be effective");
757757
EXPECT_OUTPUT_CONTAINS("Updating group_replication_view_change_uuid in the Cluster's metadata...");
758758
WIPE_STDOUT();
759759

@@ -774,9 +774,9 @@ EXPECT_EQ(view_change_uuid, view_change_uuid_md);
774774

775775
// Confirm cluster.rescan() does not warn or act if the target cluster has group_replication_view_change_uuid set
776776
EXPECT_NO_THROWS(function() { cluster.rescan(); });
777-
EXPECT_OUTPUT_NOT_CONTAINS("NOTE: The Cluster's group_replication_view_change_uuid is not set");
777+
EXPECT_OUTPUT_NOT_CONTAINS("NOTE: The Cluster's group_replication_view_change_uuid is not set.");
778778
EXPECT_OUTPUT_NOT_CONTAINS("Generating and setting a value for group_replication_view_change_uuid...");
779-
EXPECT_OUTPUT_NOT_CONTAINS("WARNING: The Cluster must be completely taken OFFLINE and restarted (dba.rebootClusterFromCompleteOutage()) for the settings to be effective");
779+
EXPECT_OUTPUT_NOT_CONTAINS("NOTE: The Cluster must be completely taken OFFLINE and restarted (dba.rebootClusterFromCompleteOutage()) for the settings to be effective");
780780
EXPECT_OUTPUT_NOT_CONTAINS("Updating group_replication_view_change_uuid in the Cluster's metadata...");
781781

782782
//@<> Bug #33235502 Check for incorrect recovery accounts and fix them

0 commit comments

Comments
 (0)