Skip to content

Commit

Permalink
Merge pull request #14194 from taosdata/enh/dingbo/TD-16753-2.4
Browse files Browse the repository at this point in the history
enh: change master/slave to leader/follower
  • Loading branch information
gccgdb1234 authored Jun 24, 2022
2 parents e2bb6e6 + 556957f commit 0c3c75b
Show file tree
Hide file tree
Showing 87 changed files with 303 additions and 303 deletions.
8 changes: 4 additions & 4 deletions src/plugins/monitor/src/monMain.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,8 +703,8 @@ static int32_t monBuildMnodesTotalSql(char *sql) {
for (int i = 0; i < num_fields; ++i) {
if (strcmp(fields[i].name, "role") == 0) {
int32_t charLen = monGetRowElemCharLen(fields[i], (char *)row[i]);
if (strncmp((char *)row[i], "master", charLen) == 0 ||
strncmp((char *)row[i], "slave", charLen) == 0) {
if (strncmp((char *)row[i], "leader", charLen) == 0 ||
strncmp((char *)row[i], "follower", charLen) == 0) {
totalMnodesAlive += 1;
}
}
Expand Down Expand Up @@ -794,8 +794,8 @@ static int32_t monGetVnodesTotalStats(char *ep, int32_t *totalVnodes,
for (int i = 0; i < num_fields; ++i) {
if (strcmp(fields[i].name, "status") == 0) {
int32_t charLen = monGetRowElemCharLen(fields[i], (char *)row[i]);
if (strncmp((char *)row[i], "master", charLen) == 0 ||
strncmp((char *)row[i], "slave", charLen) == 0) {
if (strncmp((char *)row[i], "leader", charLen) == 0 ||
strncmp((char *)row[i], "follower", charLen) == 0) {
*totalVnodesAlive += 1;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/sync/src/syncMain.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ char* syncRole[] = {
"offline",
"unsynced",
"syncing",
"slave",
"master"
"follower",
"leader"
};

char *syncStatus[] = {
Expand Down
4 changes: 2 additions & 2 deletions tests/pytest/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def run(self):

ret = tdSql.query('show mnodes')
tdSql.checkRows(1)
tdSql.checkData(0, 2, "master")
tdSql.checkData(0, 2, "leader")

role_time = tdSql.getData(0, 3)
create_time = tdSql.getData(0, 4)
Expand All @@ -72,7 +72,7 @@ def run(self):
ret = tdSql.query('show vnodes "{}"'.format(dnodeEndpoint))
tdSql.checkRows(1)
tdSql.checkData(0, 0, 2)
tdSql.checkData(0, 1, "master")
tdSql.checkData(0, 1, "leader")

def stop(self):
tdSql.close()
Expand Down
12 changes: 6 additions & 6 deletions tests/pytest/cluster/changeReplicaTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@ def run(self):
tdSql.execute("use %s" % ctest.dbName)
tdSql.query("show vgroups")
for i in range(10):
tdSql.checkData(i, 5, "master")
tdSql.checkData(i, 5, "leader")

tdSql.execute("alter database %s replica 2" % ctest.dbName)
tdLog.sleep(30)
tdSql.query("show vgroups")
for i in range(10):
tdSql.checkData(i, 5, "master")
tdSql.checkData(i, 7, "slave")
tdSql.checkData(i, 5, "leader")
tdSql.checkData(i, 7, "follower")

tdSql.execute("alter database %s replica 3" % ctest.dbName)
tdLog.sleep(30)
tdSql.query("show vgroups")
for i in range(10):
tdSql.checkData(i, 5, "master")
tdSql.checkData(i, 7, "slave")
tdSql.checkData(i, 9, "slave")
tdSql.checkData(i, 5, "leader")
tdSql.checkData(i, 7, "follower")
tdSql.checkData(i, 9, "follower")

ct = ClusterTestcase()
ct.run()
2 changes: 1 addition & 1 deletion tests/pytest/manualTest/TD-5114/checkClusterStatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def run(self):

tdSql.query("show mnodes")
tdSql.checkRows(3)
roles = "master slave"
roles = "leader follower"
for i in range(tdSql.queryRows):
if (tdSql.queryResult[i][2] in roles ):
ep = tdSql.queryResult[i][1]
Expand Down
10 changes: 5 additions & 5 deletions tests/script/general/db/alter_tables_d2.sim
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ sql show mnodes -x step1
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
if $data2_1 != leader then
goto step2
endi

Expand Down Expand Up @@ -186,7 +186,7 @@ sql show mnodes -x step3
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
if $data2_1 != leader then
goto step3
endi

Expand Down Expand Up @@ -323,7 +323,7 @@ sql show mnodes -x step9
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
if $data2_1 != leader then
goto step9
endi

Expand Down Expand Up @@ -419,7 +419,7 @@ sql show mnodes -x step10
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
if $data2_1 != leader then
goto step10
endi

Expand Down Expand Up @@ -482,7 +482,7 @@ sql show mnodes -x step1xx
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
if $data2_1 != leader then
goto step1xx
endi

Expand Down
12 changes: 6 additions & 6 deletions tests/script/general/db/alter_tables_v1.sim
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ sql show mnodes -x step2
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
if $data2_1 != leader then
goto step2
endi

Expand Down Expand Up @@ -115,7 +115,7 @@ sql show mnodes -x step5
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
if $data2_1 != leader then
goto step5
endi

Expand Down Expand Up @@ -185,7 +185,7 @@ sql show mnodes -x step7
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
if $data2_1 != leader then
goto step7
endi

Expand Down Expand Up @@ -240,7 +240,7 @@ sql show mnodes -x step9
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
if $data2_1 != leader then
goto step9
endi

Expand Down Expand Up @@ -314,7 +314,7 @@ sql show mnodes -x step10
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
if $data2_1 != leader then
goto step10
endi

Expand Down Expand Up @@ -369,7 +369,7 @@ sql show mnodes -x step12
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
if $data2_1 != leader then
goto step12
endi

Expand Down
10 changes: 5 additions & 5 deletions tests/script/general/db/alter_tables_v4.sim
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ sql show mnodes -x step3
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
if $data2_1 != leader then
goto step3
endi

Expand Down Expand Up @@ -155,7 +155,7 @@ sql show mnodes -x step5
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
if $data2_1 != leader then
goto step5
endi

Expand Down Expand Up @@ -287,7 +287,7 @@ sql show mnodes -x step9
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
if $data2_1 != leader then
goto step9
endi

Expand Down Expand Up @@ -381,7 +381,7 @@ sql show mnodes -x step10
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
if $data2_1 != leader then
goto step10
endi

Expand Down Expand Up @@ -441,7 +441,7 @@ sql show mnodes -x step12
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
if $data2_1 != leader then
goto step12
endi

Expand Down
2 changes: 1 addition & 1 deletion tests/script/general/db/delete.sim
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ step3:

sql show mnodes
print dnode1 role $data2_1
if $data2_1 != master then
if $data2_1 != leader then
goto step3
endi

Expand Down
6 changes: 3 additions & 3 deletions tests/script/general/wal/sync.sim
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ print mnode2Role $mnode2Role
$mnode3Role = $data2_3
print mnode3Role $mnode3Role

if $mnode1Role != master then
if $mnode1Role != leader then
goto show1
endi
if $mnode2Role != slave then
if $mnode2Role != follower then
goto show1
endi
if $mnode3Role != slave then
if $mnode3Role != follower then
goto show1
endi

Expand Down
6 changes: 3 additions & 3 deletions tests/script/issue/TD-2677.sim
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ print mnode2Role $mnode2Role
$mnode3Role = $data2_3
print mnode3Role $mnode3Role

if $mnode1Role != master then
if $mnode1Role != leader then
goto step1
endi
if $mnode2Role != slave then
if $mnode2Role != follower then
goto step1
endi
if $mnode3Role != slave then
if $mnode3Role != follower then
goto step1
endi

Expand Down
2 changes: 1 addition & 1 deletion tests/script/issue/TD-2680.sim
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ sql show mnodes
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
if $data2_1 != leader then
goto step1
endi

Expand Down
6 changes: 3 additions & 3 deletions tests/script/issue/TD-2713.sim
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ sql show mnodes
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
if $data2_1 != leader then
goto step1
endi
if $data2_2 != slave then
if $data2_2 != follower then
goto step1
endi
if $data2_3 != slave then
if $data2_3 != follower then
goto step1
endi

Expand Down
22 changes: 11 additions & 11 deletions tests/script/issue/TD-3300.sim
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ endi
if $data06 != 2 then
return -1
endi
if $data05 != master then
if $data05 != leader then
return -1
endi
if $data07 != slave then
if $data07 != follower then
return -1
endi

Expand Down Expand Up @@ -125,10 +125,10 @@ endi
if $data06 != 2 then
goto step4
endi
if $data05 != master then
if $data05 != leader then
goto step4
endi
if $data07 != slave then
if $data07 != follower then
goto step4
endi

Expand Down Expand Up @@ -189,7 +189,7 @@ endi
if $data05 != offline then
goto step5
endi
if $data07 != master then
if $data07 != leader then
goto step5
endi

Expand Down Expand Up @@ -251,10 +251,10 @@ endi
if $data06 != 2 then
goto step6
endi
if $data05 != slave then
if $data05 != follower then
goto step6
endi
if $data07 != master then
if $data07 != leader then
goto step6
endi

Expand Down Expand Up @@ -337,7 +337,7 @@ endi
if $data06 != 2 then
goto step7
endi
if $data05 != master then
if $data05 != leader then
goto step7
endi
if $data07 != offline then
Expand Down Expand Up @@ -422,10 +422,10 @@ endi
if $data06 != 2 then
goto step8
endi
if $data05 != master then
if $data05 != leader then
goto step8
endi
if $data07 != slave then
if $data07 != follower then
goto step8
endi

Expand Down Expand Up @@ -521,7 +521,7 @@ endi
if $data05 != offline then
goto step7
endi
if $data07 != master then
if $data07 != leader then
goto step7
endi

Expand Down
6 changes: 3 additions & 3 deletions tests/script/tmp/mnodes.sim
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ print mnode2Role $mnode2Role
$mnode3Role = $data2_3
print mnode3Role $mnode3Role

if $mnode1Role != master then
if $mnode1Role != leader then
goto step1
endi
if $mnode2Role != slave then
if $mnode2Role != follower then
goto step1
endi
if $mnode3Role != slave then
if $mnode3Role != follower then
goto step1
endi

Expand Down
Loading

0 comments on commit 0c3c75b

Please sign in to comment.