Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Removal of master-slave language #1220

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
172 changes: 86 additions & 86 deletions go/app/cli.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion go/app/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func TestKnownCommands(t *testing.T) {
}
test.S(t).ExpectEquals(commandsMap["no-such-command"], "")
test.S(t).ExpectEquals(commandsMap["relocate"], "Smart relocation")
test.S(t).ExpectEquals(commandsMap["relocate-slaves"], "")
test.S(t).ExpectEquals(commandsMap["relocate-subordinates"], "")
test.S(t).ExpectEquals(commandsMap["relocate-replicas"], "Smart relocation")

for _, synonym := range commandSynonyms {
Expand Down
258 changes: 129 additions & 129 deletions go/app/command_help.go

Large diffs are not rendered by default.

154 changes: 77 additions & 77 deletions go/config/config.go

Large diffs are not rendered by default.

64 changes: 32 additions & 32 deletions go/db/generate_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ var generateSQLBase = []string{
version varchar(128) CHARACTER SET ascii NOT NULL,
binlog_format varchar(16) CHARACTER SET ascii NOT NULL,
log_bin tinyint(3) unsigned NOT NULL,
log_slave_updates tinyint(3) unsigned NOT NULL,
log_subordinate_updates tinyint(3) unsigned NOT NULL,
binary_log_file varchar(128) CHARACTER SET ascii NOT NULL,
binary_log_pos bigint(20) unsigned NOT NULL,
master_host varchar(128) CHARACTER SET ascii NOT NULL,
master_port smallint(5) unsigned NOT NULL,
slave_sql_running tinyint(3) unsigned NOT NULL,
slave_io_running tinyint(3) unsigned NOT NULL,
master_log_file varchar(128) CHARACTER SET ascii NOT NULL,
read_master_log_pos bigint(20) unsigned NOT NULL,
relay_master_log_file varchar(128) CHARACTER SET ascii NOT NULL,
exec_master_log_pos bigint(20) unsigned NOT NULL,
seconds_behind_master bigint(20) unsigned DEFAULT NULL,
slave_lag_seconds bigint(20) unsigned DEFAULT NULL,
num_slave_hosts int(10) unsigned NOT NULL,
slave_hosts text CHARACTER SET ascii NOT NULL,
main_host varchar(128) CHARACTER SET ascii NOT NULL,
main_port smallint(5) unsigned NOT NULL,
subordinate_sql_running tinyint(3) unsigned NOT NULL,
subordinate_io_running tinyint(3) unsigned NOT NULL,
main_log_file varchar(128) CHARACTER SET ascii NOT NULL,
read_main_log_pos bigint(20) unsigned NOT NULL,
relay_main_log_file varchar(128) CHARACTER SET ascii NOT NULL,
exec_main_log_pos bigint(20) unsigned NOT NULL,
seconds_behind_main bigint(20) unsigned DEFAULT NULL,
subordinate_lag_seconds bigint(20) unsigned DEFAULT NULL,
num_subordinate_hosts int(10) unsigned NOT NULL,
subordinate_hosts text CHARACTER SET ascii NOT NULL,
cluster_name varchar(128) CHARACTER SET ascii NOT NULL,
PRIMARY KEY (hostname,port)
) ENGINE=InnoDB DEFAULT CHARSET=ascii
Expand Down Expand Up @@ -375,8 +375,8 @@ var generateSQLBase = []string{
snapshot_unix_timestamp INT UNSIGNED NOT NULL,
hostname varchar(128) CHARACTER SET ascii NOT NULL,
port smallint(5) unsigned NOT NULL,
master_host varchar(128) CHARACTER SET ascii NOT NULL,
master_port smallint(5) unsigned NOT NULL,
main_host varchar(128) CHARACTER SET ascii NOT NULL,
main_port smallint(5) unsigned NOT NULL,
cluster_name tinytext CHARACTER SET ascii NOT NULL,
PRIMARY KEY (snapshot_unix_timestamp, hostname, port)
) ENGINE=InnoDB DEFAULT CHARSET=ascii
Expand Down Expand Up @@ -426,8 +426,8 @@ var generateSQLBase = []string{
analysis varchar(128) NOT NULL,
cluster_name varchar(128) NOT NULL,
cluster_alias varchar(128) NOT NULL,
count_affected_slaves int unsigned NOT NULL,
slave_hosts text NOT NULL,
count_affected_subordinates int unsigned NOT NULL,
subordinate_hosts text NOT NULL,
PRIMARY KEY (detection_id)
) ENGINE=InnoDB DEFAULT CHARSET=ascii
`,
Expand Down Expand Up @@ -494,37 +494,37 @@ var generateSQLBase = []string{
CREATE INDEX domain_name_idx_cluster_domain_name ON cluster_domain_name (domain_name(32))
`,
`
CREATE TABLE IF NOT EXISTS master_position_equivalence (
CREATE TABLE IF NOT EXISTS main_position_equivalence (
equivalence_id bigint unsigned not null auto_increment,
master1_hostname varchar(128) CHARACTER SET ascii NOT NULL,
master1_port smallint(5) unsigned NOT NULL,
master1_binary_log_file varchar(128) CHARACTER SET ascii NOT NULL,
master1_binary_log_pos bigint(20) unsigned NOT NULL,
master2_hostname varchar(128) CHARACTER SET ascii NOT NULL,
master2_port smallint(5) unsigned NOT NULL,
master2_binary_log_file varchar(128) CHARACTER SET ascii NOT NULL,
master2_binary_log_pos bigint(20) unsigned NOT NULL,
main1_hostname varchar(128) CHARACTER SET ascii NOT NULL,
main1_port smallint(5) unsigned NOT NULL,
main1_binary_log_file varchar(128) CHARACTER SET ascii NOT NULL,
main1_binary_log_pos bigint(20) unsigned NOT NULL,
main2_hostname varchar(128) CHARACTER SET ascii NOT NULL,
main2_port smallint(5) unsigned NOT NULL,
main2_binary_log_file varchar(128) CHARACTER SET ascii NOT NULL,
main2_binary_log_pos bigint(20) unsigned NOT NULL,
last_suggested TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (equivalence_id)
) ENGINE=InnoDB DEFAULT CHARSET=ascii
`,
`
DROP INDEX equivalence_uidx ON master_position_equivalence
DROP INDEX equivalence_uidx ON main_position_equivalence
`,
`
CREATE UNIQUE INDEX equivalence_uidx_master_position_equivalence ON master_position_equivalence (master1_hostname, master1_port, master1_binary_log_file, master1_binary_log_pos, master2_hostname, master2_port)
CREATE UNIQUE INDEX equivalence_uidx_main_position_equivalence ON main_position_equivalence (main1_hostname, main1_port, main1_binary_log_file, main1_binary_log_pos, main2_hostname, main2_port)
`,
`
DROP INDEX master2_idx ON master_position_equivalence
DROP INDEX main2_idx ON main_position_equivalence
`,
`
CREATE INDEX master2_idx_master_position_equivalence ON master_position_equivalence (master2_hostname, master2_port, master2_binary_log_file, master2_binary_log_pos)
CREATE INDEX main2_idx_main_position_equivalence ON main_position_equivalence (main2_hostname, main2_port, main2_binary_log_file, main2_binary_log_pos)
`,
`
DROP INDEX last_suggested_idx ON master_position_equivalence
DROP INDEX last_suggested_idx ON main_position_equivalence
`,
`
CREATE INDEX last_suggested_idx_master_position_equivalence ON master_position_equivalence (last_suggested)
CREATE INDEX last_suggested_idx_main_position_equivalence ON main_position_equivalence (last_suggested)
`,
`
CREATE TABLE IF NOT EXISTS async_request (
Expand Down
48 changes: 24 additions & 24 deletions go/db/generate_patches.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var generateSQLPatches = []string{
`
ALTER TABLE
database_instance
ADD COLUMN last_sql_error TEXT NOT NULL AFTER exec_master_log_pos
ADD COLUMN last_sql_error TEXT NOT NULL AFTER exec_main_log_pos
`,
`
ALTER TABLE
Expand All @@ -37,7 +37,7 @@ var generateSQLPatches = []string{
`
ALTER TABLE
database_instance
ADD COLUMN oracle_gtid TINYINT UNSIGNED NOT NULL AFTER slave_io_running
ADD COLUMN oracle_gtid TINYINT UNSIGNED NOT NULL AFTER subordinate_io_running
`,
`
ALTER TABLE
Expand All @@ -47,20 +47,20 @@ var generateSQLPatches = []string{
`
ALTER TABLE
database_instance
ADD COLUMN relay_log_file varchar(128) CHARACTER SET ascii NOT NULL AFTER exec_master_log_pos
ADD COLUMN relay_log_file varchar(128) CHARACTER SET ascii NOT NULL AFTER exec_main_log_pos
`,
`
ALTER TABLE
database_instance
ADD COLUMN relay_log_pos bigint unsigned NOT NULL AFTER relay_log_file
`,
`
DROP INDEX master_host_port_idx ON database_instance
DROP INDEX main_host_port_idx ON database_instance
`,
`
ALTER TABLE
database_instance
ADD INDEX master_host_port_idx_database_instance (master_host, master_port)
ADD INDEX main_host_port_idx_database_instance (main_host, main_port)
`,
`
ALTER TABLE
Expand All @@ -75,7 +75,7 @@ var generateSQLPatches = []string{
`
ALTER TABLE
database_instance
ADD COLUMN has_replication_filters TINYINT UNSIGNED NOT NULL AFTER slave_io_running
ADD COLUMN has_replication_filters TINYINT UNSIGNED NOT NULL AFTER subordinate_io_running
`,
`
ALTER TABLE
Expand Down Expand Up @@ -105,7 +105,7 @@ var generateSQLPatches = []string{
`
ALTER TABLE
database_instance
ADD COLUMN is_co_master TINYINT UNSIGNED NOT NULL AFTER replication_depth
ADD COLUMN is_co_main TINYINT UNSIGNED NOT NULL AFTER replication_depth
`,
`
ALTER TABLE
Expand All @@ -115,7 +115,7 @@ var generateSQLPatches = []string{
`
ALTER TABLE
database_instance
ADD COLUMN sql_delay INT UNSIGNED NOT NULL AFTER slave_lag_seconds
ADD COLUMN sql_delay INT UNSIGNED NOT NULL AFTER subordinate_lag_seconds
`,
`
ALTER TABLE
Expand All @@ -135,12 +135,12 @@ var generateSQLPatches = []string{
`
ALTER TABLE
topology_recovery
ADD COLUMN count_affected_slaves int unsigned NOT NULL
ADD COLUMN count_affected_subordinates int unsigned NOT NULL
`,
`
ALTER TABLE
topology_recovery
ADD COLUMN slave_hosts text CHARACTER SET ascii NOT NULL
ADD COLUMN subordinate_hosts text CHARACTER SET ascii NOT NULL
`,
`
ALTER TABLE hostname_unresolve
Expand Down Expand Up @@ -222,17 +222,17 @@ var generateSQLPatches = []string{
`
ALTER TABLE
topology_recovery
ADD COLUMN participating_instances text CHARACTER SET ascii NOT NULL after slave_hosts
ADD COLUMN participating_instances text CHARACTER SET ascii NOT NULL after subordinate_hosts
`,
`
ALTER TABLE
topology_recovery
ADD COLUMN lost_slaves text CHARACTER SET ascii NOT NULL after participating_instances
ADD COLUMN lost_subordinates text CHARACTER SET ascii NOT NULL after participating_instances
`,
`
ALTER TABLE
topology_recovery
ADD COLUMN all_errors text CHARACTER SET ascii NOT NULL after lost_slaves
ADD COLUMN all_errors text CHARACTER SET ascii NOT NULL after lost_subordinates
`,
`
ALTER TABLE audit
Expand Down Expand Up @@ -288,7 +288,7 @@ var generateSQLPatches = []string{
MODIFY last_suggested timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
`,
`
ALTER TABLE master_position_equivalence /* sqlite3-skip */
ALTER TABLE main_position_equivalence /* sqlite3-skip */
MODIFY last_suggested timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
`,
`
Expand Down Expand Up @@ -493,7 +493,7 @@ var generateSQLPatches = []string{
`
ALTER TABLE
database_instance
ADD COLUMN semi_sync_master_enabled TINYINT UNSIGNED NOT NULL
ADD COLUMN semi_sync_main_enabled TINYINT UNSIGNED NOT NULL
`,
`
ALTER TABLE
Expand All @@ -513,7 +513,7 @@ var generateSQLPatches = []string{
`
ALTER TABLE
database_instance
ADD COLUMN master_uuid varchar(64) CHARACTER SET ascii NOT NULL AFTER oracle_gtid
ADD COLUMN main_uuid varchar(64) CHARACTER SET ascii NOT NULL AFTER oracle_gtid
`,
`
ALTER TABLE
Expand All @@ -523,12 +523,12 @@ var generateSQLPatches = []string{
`
ALTER TABLE
database_instance
ADD COLUMN ancestry_uuid text CHARACTER SET ascii NOT NULL AFTER master_uuid
ADD COLUMN ancestry_uuid text CHARACTER SET ascii NOT NULL AFTER main_uuid
`,
`
ALTER TABLE
database_instance
ADD COLUMN replication_sql_thread_state tinyint signed not null default 0 AFTER slave_io_running
ADD COLUMN replication_sql_thread_state tinyint signed not null default 0 AFTER subordinate_io_running
`,
`
ALTER TABLE
Expand All @@ -549,27 +549,27 @@ var generateSQLPatches = []string{
`
ALTER TABLE
database_instance
ADD COLUMN semi_sync_master_timeout INT UNSIGNED NOT NULL DEFAULT 0 AFTER semi_sync_master_enabled
ADD COLUMN semi_sync_main_timeout INT UNSIGNED NOT NULL DEFAULT 0 AFTER semi_sync_main_enabled
`,
`
ALTER TABLE
database_instance
ADD COLUMN semi_sync_master_wait_for_slave_count INT UNSIGNED NOT NULL DEFAULT 0 AFTER semi_sync_master_timeout
ADD COLUMN semi_sync_main_wait_for_subordinate_count INT UNSIGNED NOT NULL DEFAULT 0 AFTER semi_sync_main_timeout
`,
`
ALTER TABLE
database_instance
ADD COLUMN semi_sync_master_status TINYINT UNSIGNED NOT NULL DEFAULT 0 AFTER semi_sync_master_wait_for_slave_count
ADD COLUMN semi_sync_main_status TINYINT UNSIGNED NOT NULL DEFAULT 0 AFTER semi_sync_main_wait_for_subordinate_count
`,
`
ALTER TABLE
database_instance
ADD COLUMN semi_sync_replica_status TINYINT UNSIGNED NOT NULL DEFAULT 0 AFTER semi_sync_master_status
ADD COLUMN semi_sync_replica_status TINYINT UNSIGNED NOT NULL DEFAULT 0 AFTER semi_sync_main_status
`,
`
ALTER TABLE
database_instance
ADD COLUMN semi_sync_master_clients INT UNSIGNED NOT NULL DEFAULT 0 AFTER semi_sync_master_status
ADD COLUMN semi_sync_main_clients INT UNSIGNED NOT NULL DEFAULT 0 AFTER semi_sync_main_status
`,
`
ALTER TABLE
Expand All @@ -579,7 +579,7 @@ var generateSQLPatches = []string{
`
ALTER TABLE /* sqlite3-skip */
database_instance
MODIFY semi_sync_master_timeout BIGINT UNSIGNED NOT NULL DEFAULT 0
MODIFY semi_sync_main_timeout BIGINT UNSIGNED NOT NULL DEFAULT 0
`,
// Fields related to Replication Group the instance belongs to
`
Expand Down
Loading