|
| 1 | +include/master-slave.inc |
| 2 | +Warnings: |
| 3 | +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. |
| 4 | +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. |
| 5 | +[connection master] |
| 6 | +show global variables like 'ndb_slave_conflict_role'; |
| 7 | +Variable_name Value |
| 8 | +ndb_slave_conflict_role NONE |
| 9 | +Slave_SQL_Running = 'Yes' |
| 10 | +stop slave sql_thread; |
| 11 | +Slave_SQL_Running = 'No' |
| 12 | +Show set-to-same state is ok |
| 13 | +set global ndb_slave_conflict_role = NONE; |
| 14 | +Now transition through all status, including set-to-self |
| 15 | +set global ndb_slave_conflict_role = "PRIMARY"; |
| 16 | +show global variables like 'ndb_slave_conflict_role'; |
| 17 | +Variable_name Value |
| 18 | +ndb_slave_conflict_role PRIMARY |
| 19 | +set global ndb_slave_conflict_role = "PRIMARY"; |
| 20 | +set global ndb_slave_conflict_role = "SECONDARY"; |
| 21 | +show global variables like 'ndb_slave_conflict_role'; |
| 22 | +Variable_name Value |
| 23 | +ndb_slave_conflict_role SECONDARY |
| 24 | +set global ndb_slave_conflict_role = "SECONDARY"; |
| 25 | +set global ndb_slave_conflict_role = "NONE"; |
| 26 | +set global ndb_slave_conflict_role = "SECONDARY"; |
| 27 | +set global ndb_slave_conflict_role = "PRIMARY"; |
| 28 | +set global ndb_slave_conflict_role = "NONE"; |
| 29 | +set global ndb_slave_conflict_role = "PASS"; |
| 30 | +show global variables like 'ndb_slave_conflict_role'; |
| 31 | +Variable_name Value |
| 32 | +ndb_slave_conflict_role PASS |
| 33 | +set global ndb_slave_conflict_role = "PASS"; |
| 34 | +set global ndb_slave_conflict_role = "NONE"; |
| 35 | +Now test illegal transitions |
| 36 | +set global ndb_slave_conflict_role = "PRIMARY"; |
| 37 | +set global ndb_slave_conflict_role = "PASS"; |
| 38 | +ERROR HY000: Error when executing command SET GLOBAL ndb_slave_conflict_role: Role change from PRIMARY to PASS failed : Invalid role change. |
| 39 | +show global variables like 'ndb_slave_conflict_role'; |
| 40 | +Variable_name Value |
| 41 | +ndb_slave_conflict_role PRIMARY |
| 42 | +set global ndb_slave_conflict_role = "SECONDARY"; |
| 43 | +set global ndb_slave_conflict_role = "PASS"; |
| 44 | +ERROR HY000: Error when executing command SET GLOBAL ndb_slave_conflict_role: Role change from SECONDARY to PASS failed : Invalid role change. |
| 45 | +show global variables like 'ndb_slave_conflict_role'; |
| 46 | +Variable_name Value |
| 47 | +ndb_slave_conflict_role SECONDARY |
| 48 | +set global ndb_slave_conflict_role = "NONE"; |
| 49 | +set global ndb_slave_conflict_role = "PASS"; |
| 50 | +set global ndb_slave_conflict_role = "PRIMARY"; |
| 51 | +ERROR HY000: Error when executing command SET GLOBAL ndb_slave_conflict_role: Role change from PASS to PRIMARY failed : Invalid role change. |
| 52 | +show global variables like 'ndb_slave_conflict_role'; |
| 53 | +Variable_name Value |
| 54 | +ndb_slave_conflict_role PASS |
| 55 | +set global ndb_slave_conflict_role = "SECONDARY"; |
| 56 | +ERROR HY000: Error when executing command SET GLOBAL ndb_slave_conflict_role: Role change from PASS to SECONDARY failed : Invalid role change. |
| 57 | +show global variables like 'ndb_slave_conflict_role'; |
| 58 | +Variable_name Value |
| 59 | +ndb_slave_conflict_role PASS |
| 60 | +set global ndb_slave_conflict_role = "NONE"; |
| 61 | +Now test transitions not possible due to |
| 62 | +Slave SQL thread running |
| 63 | +start slave sql_thread; |
| 64 | +Slave_SQL_Running = 'Yes' |
| 65 | +From NONE |
| 66 | +set global ndb_slave_conflict_role = "NONE"; |
| 67 | +set global ndb_slave_conflict_role = "PRIMARY"; |
| 68 | +ERROR HY000: Error when executing command SET GLOBAL ndb_slave_conflict_role: Role change from NONE to PRIMARY failed : Cannot change role while Slave SQL thread is running. Use STOP SLAVE first. |
| 69 | +show global variables like 'ndb_slave_conflict_role'; |
| 70 | +Variable_name Value |
| 71 | +ndb_slave_conflict_role NONE |
| 72 | +set global ndb_slave_conflict_role = "SECONDARY"; |
| 73 | +ERROR HY000: Error when executing command SET GLOBAL ndb_slave_conflict_role: Role change from NONE to SECONDARY failed : Cannot change role while Slave SQL thread is running. Use STOP SLAVE first. |
| 74 | +show global variables like 'ndb_slave_conflict_role'; |
| 75 | +Variable_name Value |
| 76 | +ndb_slave_conflict_role NONE |
| 77 | +set global ndb_slave_conflict_role = "PASS"; |
| 78 | +ERROR HY000: Error when executing command SET GLOBAL ndb_slave_conflict_role: Role change from NONE to PASS failed : Cannot change role while Slave SQL thread is running. Use STOP SLAVE first. |
| 79 | +show global variables like 'ndb_slave_conflict_role'; |
| 80 | +Variable_name Value |
| 81 | +ndb_slave_conflict_role NONE |
| 82 | +stop slave sql_thread; |
| 83 | +From PRIMARY |
| 84 | +set global ndb_slave_conflict_role = "PRIMARY"; |
| 85 | +start slave sql_thread; |
| 86 | +set global ndb_slave_conflict_role = "PRIMARY"; |
| 87 | +set global ndb_slave_conflict_role = "SECONDARY"; |
| 88 | +ERROR HY000: Error when executing command SET GLOBAL ndb_slave_conflict_role: Role change from PRIMARY to SECONDARY failed : Cannot change role while Slave SQL thread is running. Use STOP SLAVE first. |
| 89 | +show global variables like 'ndb_slave_conflict_role'; |
| 90 | +Variable_name Value |
| 91 | +ndb_slave_conflict_role PRIMARY |
| 92 | +set global ndb_slave_conflict_role = "NONE"; |
| 93 | +ERROR HY000: Error when executing command SET GLOBAL ndb_slave_conflict_role: Role change from PRIMARY to NONE failed : Cannot change role while Slave SQL thread is running. Use STOP SLAVE first. |
| 94 | +show global variables like 'ndb_slave_conflict_role'; |
| 95 | +Variable_name Value |
| 96 | +ndb_slave_conflict_role PRIMARY |
| 97 | +set global ndb_slave_conflict_role = "PASS"; |
| 98 | +ERROR HY000: Error when executing command SET GLOBAL ndb_slave_conflict_role: Role change from PRIMARY to PASS failed : Invalid role change. |
| 99 | +show global variables like 'ndb_slave_conflict_role'; |
| 100 | +Variable_name Value |
| 101 | +ndb_slave_conflict_role PRIMARY |
| 102 | +stop slave sql_thread; |
| 103 | +From SECONDARY |
| 104 | +set global ndb_slave_conflict_role = "SECONDARY"; |
| 105 | +start slave sql_thread; |
| 106 | +set global ndb_slave_conflict_role = "SECONDARY"; |
| 107 | +set global ndb_slave_conflict_role = "PRIMARY"; |
| 108 | +ERROR HY000: Error when executing command SET GLOBAL ndb_slave_conflict_role: Role change from SECONDARY to PRIMARY failed : Cannot change role while Slave SQL thread is running. Use STOP SLAVE first. |
| 109 | +show global variables like 'ndb_slave_conflict_role'; |
| 110 | +Variable_name Value |
| 111 | +ndb_slave_conflict_role SECONDARY |
| 112 | +set global ndb_slave_conflict_role = "NONE"; |
| 113 | +ERROR HY000: Error when executing command SET GLOBAL ndb_slave_conflict_role: Role change from SECONDARY to NONE failed : Cannot change role while Slave SQL thread is running. Use STOP SLAVE first. |
| 114 | +show global variables like 'ndb_slave_conflict_role'; |
| 115 | +Variable_name Value |
| 116 | +ndb_slave_conflict_role SECONDARY |
| 117 | +set global ndb_slave_conflict_role = "PASS"; |
| 118 | +ERROR HY000: Error when executing command SET GLOBAL ndb_slave_conflict_role: Role change from SECONDARY to PASS failed : Invalid role change. |
| 119 | +show global variables like 'ndb_slave_conflict_role'; |
| 120 | +Variable_name Value |
| 121 | +ndb_slave_conflict_role SECONDARY |
| 122 | +stop slave sql_thread; |
| 123 | +From PASS |
| 124 | +set global ndb_slave_conflict_role = "NONE"; |
| 125 | +set global ndb_slave_conflict_role = "PASS"; |
| 126 | +start slave sql_thread; |
| 127 | +set global ndb_slave_conflict_role = "PASS"; |
| 128 | +set global ndb_slave_conflict_role = "PRIMARY"; |
| 129 | +ERROR HY000: Error when executing command SET GLOBAL ndb_slave_conflict_role: Role change from PASS to PRIMARY failed : Invalid role change. |
| 130 | +show global variables like 'ndb_slave_conflict_role'; |
| 131 | +Variable_name Value |
| 132 | +ndb_slave_conflict_role PASS |
| 133 | +set global ndb_slave_conflict_role = "SECONDARY"; |
| 134 | +ERROR HY000: Error when executing command SET GLOBAL ndb_slave_conflict_role: Role change from PASS to SECONDARY failed : Invalid role change. |
| 135 | +show global variables like 'ndb_slave_conflict_role'; |
| 136 | +Variable_name Value |
| 137 | +ndb_slave_conflict_role PASS |
| 138 | +set global ndb_slave_conflict_role = "NONE"; |
| 139 | +ERROR HY000: Error when executing command SET GLOBAL ndb_slave_conflict_role: Role change from PASS to NONE failed : Cannot change role while Slave SQL thread is running. Use STOP SLAVE first. |
| 140 | +show global variables like 'ndb_slave_conflict_role'; |
| 141 | +Variable_name Value |
| 142 | +ndb_slave_conflict_role PASS |
| 143 | +stop slave sql_thread; |
| 144 | +set global ndb_slave_conflict_role = "NONE"; |
| 145 | +Test some aliases for role names |
| 146 | +set global ndb_slave_conflict_role = PR; |
| 147 | +show global variables like 'ndb_slave_conflict_role'; |
| 148 | +Variable_name Value |
| 149 | +ndb_slave_conflict_role PRIMARY |
| 150 | +set global ndb_slave_conflict_role = S; |
| 151 | +show global variables like 'ndb_slave_conflict_role'; |
| 152 | +Variable_name Value |
| 153 | +ndb_slave_conflict_role SECONDARY |
| 154 | +set global ndb_slave_conflict_role = N; |
| 155 | +show global variables like 'ndb_slave_conflict_role'; |
| 156 | +Variable_name Value |
| 157 | +ndb_slave_conflict_role NONE |
| 158 | +set global ndb_slave_conflict_role = PA; |
| 159 | +show global variables like 'ndb_slave_conflict_role'; |
| 160 | +Variable_name Value |
| 161 | +ndb_slave_conflict_role PASS |
| 162 | +set global ndb_slave_conflict_role = 0; |
| 163 | +show global variables like 'ndb_slave_conflict_role'; |
| 164 | +Variable_name Value |
| 165 | +ndb_slave_conflict_role NONE |
| 166 | +set global ndb_slave_conflict_role = 2; |
| 167 | +show global variables like 'ndb_slave_conflict_role'; |
| 168 | +Variable_name Value |
| 169 | +ndb_slave_conflict_role PRIMARY |
| 170 | +set global ndb_slave_conflict_role = 1; |
| 171 | +show global variables like 'ndb_slave_conflict_role'; |
| 172 | +Variable_name Value |
| 173 | +ndb_slave_conflict_role SECONDARY |
| 174 | +set global ndb_slave_conflict_role = 0; |
| 175 | +show global variables like 'ndb_slave_conflict_role'; |
| 176 | +Variable_name Value |
| 177 | +ndb_slave_conflict_role NONE |
| 178 | +set global ndb_slave_conflict_role = 3; |
| 179 | +show global variables like 'ndb_slave_conflict_role'; |
| 180 | +Variable_name Value |
| 181 | +ndb_slave_conflict_role PASS |
| 182 | +set global ndb_slave_conflict_role = NON; |
| 183 | +start slave sql_thread; |
| 184 | +include/rpl_end.inc |
0 commit comments