8000 rename ["master", "slave"] to ["leader", "follower"] (#12478) · adamjm/arangodb@970e12b · GitHub
[go: up one dir, main page]

Skip to content

Commit 970e12b

Browse files
authored
rename ["master", "slave"] to ["leader", "follower"] (arangodb#12478)
1 parent cba99fc commit 970e12b

32 files changed

+460
-455
lines changed

CHANGELOG

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,20 @@ devel
3939

4040
* Show optimizer rules with highest execution times in explain output.
4141

42+
* Renamed "master" to "leader" and "slave" to "follower" in replication messages.
43+
This will change the contents of replication log messages as well the string
44+
contents of replication-related error messages.
45+
46+
The messages of the error codes 1402, 1403 and 1404 were also changed accordingly,
47+
as well as the identifiers:
48+
- `TRI_ERROR_REPLICATION_MASTER_ERROR` renamed to `TRI_ERROR_REPLICATION_LEADER_ERROR`
49+
- `TRI_ERROR_REPLICATION_MASTER_INCOMPATIBLE` renamed to `TRI_ERROR_REPLICATION_LEADER_INCOMPATIBLE`
50+
- `TRI_ERROR_REPLICATION_MASTER_CHANGE` renamed to `TRI_ERROR_REPLICATION_LEADER_CHANGE`
51+
52+
This change also renames the API endpoint `/_api/replication/make-slave` to
53+
`/_api/replication/make-follower`. The API is still available under the old
54+
name, but using it is deprecated.
55+
4256
* Fixed that dropping a vanished follower works again. An exception response
4357
to the replication request is now handled properly.
4458

Documentation/DocuBlocks/Rest/Replication/put_api_replication_applier.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ following attributes may be present in the configuration:
4545

4646
- *includeSystem*: whether or not system collection operations will be applied
4747

48-
- *autoResync*: whether or not the slave should perform a full automatic
49-
resynchronization with the master in case the master cannot serve log data
50-
requested by the slave, or when the replication is started and no tick
48+
- *autoResync*: whether or not the follower should perform a full automatic
49+
resynchronization with the leader in case the leader cannot serve log data
50+
requested by the follower, or when the replication is started and no tick
5151
value
5252
can be found.
5353

@@ -58,40 +58,40 @@ following attributes may be present in the configuration:
5858
retries in case resynchronizations always fail.
5959

6060
- *initialSyncMaxWaitTime*: the maximum wait time (in seconds) that the initial
61-
synchronization will wait for a response from the master when fetching initial
61+
synchronization will wait for a response from the leader when fetching initial
6262
collection data.
6363
This wait time can be used to control after what time the initial synchronization
6464
will give up waiting for a response and fail. This value is relevant even
6565
for continuous replication when *autoResync* is set to *true* because this
66-
may re-start the initial synchronization when the master cannot provide
67-
log data the slave requires.
66+
may re-start the initial synchronization when the leader cannot provide
67+
log data the follwer requires.
6868
This value will be ignored if set to *0*.
6969

7070
- *connectionRetryWaitTime*: the time (in seconds) that the applier will
71-
intentionally idle before it retries connecting to the master in case of
71+
intentionally idle before it retries connecting to the leader in case of
7272
connection problems.
7373
This value will be ignored if set to *0*.
7474

7575
- *idleMinWaitTime*: the minimum wait time (in seconds) that the applier will
76-
intentionally idle before fetching more log data from the master in case
77-
the master has already sent all its log data. This wait time can be used
76+
intentionally idle before fetching more log data from the leader in case
77+
the leader has already sent all its log data. This wait time can be used
7878
to control the frequency with which the replication applier sends HTTP log
79-
fetch requests to the master in case there is no write activity on the master.
79+
fetch requests to the leader in case there is no write activity on the leader.
8080
This value will be ignored if set to *0*.
8181

8282
- *idleMaxWaitTime*: the maximum wait time (in seconds) that the applier will
83-
intentionally idle before fetching more log data from the master in case the
84-
master has already sent all its log data and there have been previous log
83+
intentionally idle before fetching more log data from the leader in case the
84+
leader has already sent all its log data and there have been previous log
8585
fetch attempts that resulted in no more log data. This wait time can be used
8686
to control the maximum frequency with which the replication applier sends HTTP
87-
log fetch requests to the master in case there is no write activity on the
88-
master for longer periods. This configuration value will only be used if the
87+
log fetch requests to the leader in case there is no write activity on the
88+
leader for longer periods. This configuration value will only be used if the
8989
option *adaptivePolling* is set to *true*.
9090
This value will be ignored if set to *0*.
9191

9292
- *requireFromPresent*: if set to *true*, then the replication applier will check
9393
at start whether the start tick from which it starts or resumes replication is
94-
still present on the master. If not, then there would be data loss. If
94+
still present on the leader. If not, then there would be data loss. If
9595
*requireFromPresent* is *true*, the replication applier will abort with an
9696
appropriate error message. If set to *false*, then the replication applier will
9797
still start, and ignore the data loss.

Documentation/DocuBlocks/Rest/Replication/put_api_replication_applier_adjust.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,9 @@ the logger server provides updates frequently or seldom.
6060
whether or not system collection operations will be applied
6161

6262
@RESTBODYPARAM{autoResync,boolean,optional,}
63-
whether or not the slave should perform a full automatic resynchronization
64-
with the master in case the master cannot serve log data requested by the
65-
slave,
66-
or when the replication is started and no tick value can be found.
63+
whether or not the follower should perform a full automatic resynchronization
64+
with the leader in case the leader cannot serve log data requested by the
65+
follower, or when the replication is started and no tick value can be found.
6766

6867
@RESTBODYPARAM{autoResyncRetries,integer,optional,int64}
6968
number of resynchronization retries that will be performed in a row when
@@ -76,43 +75,43 @@ in case resynchronizations always fail.
7675

7776
@RESTBODYPARAM{initialSyncMaxWaitTime,integer,optional,int64}
7877
the maximum wait time (in seconds) that the initial synchronization will
79-
wait for a response from the master when fetching initial collection data.
78+
wait for a response from the leader when fetching initial collection data.
8079
This wait time can be used to control after what time the initial
8180
synchronization
8281
will give up waiting for a response and fail. This value is relevant even
8382
for continuous replication when *autoResync* is set to *true* because this
84-
may re-start the initial synchronization when the master cannot provide
85-
log data the slave requires.
83+
may re-start the initial synchronization when the leader cannot provide
84+
log data the follower requires.
8685
This value will be ignored if set to *0*.
8786

8887
@RESTBODYPARAM{connectionRetryWaitTime,integer,optional,int64}
8988
the time (in seconds) that the applier will intentionally idle before
90-
it retries connecting to the master in case of connection problems.
89+
it retries connecting to the leader in case of connection problems.
9190
This value will be ignored if set to *0*.
9291

9392
@RESTBODYPARAM{idleMinWaitTime,integer,optional,int64}
9493
the minimum wait time (in seconds) that the applier will intentionally idle
95-
before fetching more log data from the master in case the master has
94+
before fetching more log data from the leader in case the leader has
9695
already sent all its log data. This wait time can be used to control the
9796
frequency with which the replication applier sends HTTP log fetch requests
98-
to the master in case there is no write activity on the master.
97+
to the leader in case there is no write activity on the leader.
9998
This value will be ignored if set to *0*.
10099

101100
@RESTBODYPARAM{idleMaxWaitTime,integer,optional,int64}
102101
the maximum wait time (in seconds) that the applier will intentionally idle
103-
before fetching more log data from the master in case the master has
102+
before fetching more log data from the leader in case the leader has
104103
already sent all its log data and there have been previous log fetch attempts
105104
that resulted in no more log data. This wait time can be used to control the
106105
maximum frequency with which the replication applier sends HTTP log fetch
107-
requests to the master in case there is no write activity on the master for
106+
requests to the leader in case there is no write activity on the leader for
108107
longer periods. This configuration value will only be used if the option
109108
*adaptivePolling* is set to *true*.
110109
This value will be ignored if set to *0*.
111110

112111
@RESTBODYPARAM{requireFromPresent,boolean,required,}
113112
if set to *true*, then the replication applier will check
114113
at start whether the start tick from which it starts or resumes replication is
115-
still present on the master. If not, then there would be data loss. If
114+
still present on the leader. If not, then there would be data loss. If
116115
*requireFromPresent* is *true*, the replication applier will abort with an
117116
appropriate error message. If set to *false*, then the replication applier will
118117
still start, and ignore the data loss.

Documentation/DocuBlocks/Rest/Replication/put_api_replication_makeSlave.md renamed to Documentation/DocuBlocks/Rest/Replication/put_api_replication_makeFollower.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11

2-
@startDocuBlock put_api_replication_makeSlave
3-
@brief Changes role to slave
2+
@startDocuBlock put_api_replication_makeFollower
3+
@brief Changes role to follower
44

5-
@RESTHEADER{PUT /_api/replication/make-slave, Turn the server into a slave of another, handleCommandMakeSlave}
5+
@RESTHEADER{PUT /_api/replication/make-follower, Turn the server into a follower of another, handleCommandMakeFollower}
66

77
@RESTBODYPARAM{endpoint,string,required,string}
8-
the master endpoint to connect to (e.g. "tcp://192.168.173.13:8529").
8+
the leader endpoint to connect to (e.g. "tcp://192.168.173.13:8529").
99

1010
@RESTBODYPARAM{database,string,required,string}
11-
the database name on the master (if not specified, defaults to the
11+
the database name on the leader (if not specified, defaults to the
1212
name of the local current database).
1313

1414
@RESTBODYPARAM{username,string,optional,string}
15-
an optional ArangoDB username to use when connecting to the master.
15+
an optional ArangoDB username to use when connecting to the leader.
1616

1717
@RESTBODYPARAM{password,string,required,string}
18-
the password to use when connecting to the master.
18+
the password to use when connecting to the leader.
1919

2020
@RESTBODYPARAM{includeSystem,boolean,required,}
2121
whether or not system collection operations will be applied
@@ -27,7 +27,7 @@ specified, the allowed values are *include* or *exclude*.
2727
@RESTBODYPARAM{restrictCollections,array,optional,string}
2828
an optional array of collections for use with *restrictType*.
2929
If *restrictType* is *include*, only the specified collections
30-
will be sychronised. If *restrictType* is *exclude*, all but the specified
30+
will be synchronized. If *restrictType* is *exclude*, all but the specified
3131
collections will be synchronized.
3232

3333
@RESTBODYPARAM{maxConnectRetries,integer,optional,int64}
@@ -50,8 +50,8 @@ is used when the endpoint is contacted.
5050
whether or not the replication applier will use adaptive polling.
5151

5252
@RESTBODYPARAM{autoResync,boolean,optional,}
53-
whether or not the slave should perform an automatic resynchronization with
54-
the master in case the master cannot serve log data requested by the slave,
53+
whether or not the follower should perform an automatic resynchronization with
54+
the leader in case the leader cannot serve log data requested by the follower,
5555
or when the replication is started and no tick value can be found.
5656

5757
@RESTBODYPARAM{autoResyncRetries,integer,optional,int64}
@@ -63,42 +63,42 @@ in case resynchronizations always fail.
6363

6464
@RESTBODYPARAM{initialSyncMaxWaitTime,integer,optional,int64}
6565
the maximum wait time (in seconds) that the initial synchronization will
66-
wait for a response from the master when fetching initial collection data.
66+
wait for a response from the leader when fetching initial collection data.
6767
This wait time can be used to control after what time the initial synchronization
6868
will give up waiting for a response and fail. This value is relevant even
6969
for continuous replication when *autoResync* is set to *true* because this
70-
may re-start the initial synchronization when the master cannot provide
71-
log data the slave requires.
70+
may re-start the initial synchronization when the leader cannot provide
71+
log data the follower requires.
7272
This value will be ignored if set to *0*.
7373

7474
@RESTBODYPARAM{connectionRetryWaitTime,integer,optional,int64}
7575
the time (in seconds) that the applier will intentionally idle before
76-
it retries connecting to the master in case of connection problems.
76+
it retries connecting to the leader in case of connection problems.
7777
This value will be ignored if set to *0*.
7878

7979
@RESTBODYPARAM{idleMinWaitTime,integer,optional,int64}
8080
the minimum wait time (in seconds) that the applier will intentionally idle
81-
before fetching more log data from the master in case the master has
81+
before fetching more log data from the leader in case the leader has
8282
already sent all its log data. This wait time can be used to control the
8383
frequency with which the replication applier sends HTTP log fetch requests
84-
to the master in case there is no write activity on the master.
84+
to the leader in case there is no write activity on the leader.
8585
This value will be ignored if set to *0*.
8686

8787
@RESTBODYPARAM{idleMaxWaitTime,integer,optional,int64}
8888
the maximum wait time (in seconds) that the applier will intentionally idle
89-
before fetching more log data from the master in case the master has
89+
before fetching more log data from the leader in case the leader has
9090
already sent all its log data and there have been previous log fetch attempts
9191
that resulted in no more log data. This wait time can be used to control the
9292
maximum frequency with which the replication applier sends HTTP log fetch
93-
requests to the master in case there is no write activity on the master for
93+
requests to the leader in case there is no write activity on the leader for
9494
longer periods. This configuration value will only be used if the option
9595
*adaptivePolling* is set to *true*.
9696
This value will be ignored if set to *0*.
9797

9898
@RESTBODYPARAM{requireFromPresent,boolean,optional,}
9999
if set to *true*, then the replication applier will check
100100
at start of its continuous replication if the start tick from the dump phase
101-
is still present on the master. If not, then there would be data loss. If
101+
is still present on the leader. If not, then there would be data loss. If
102102
*requireFromPresent* is *true*, the replication applier will abort with an
103103
appropriate error message. If set to *false*, then the replication applier will
104104
still start, and ignore the data loss.
@@ -209,15 +209,15 @@ Please note that all "tick" values returned do not have a specific unit. Tick
209209
values are only meaningful when compared to each other. Higher tick values mean
210210
"later in time" than lower tick values.
211211

212-
WARNING: calling this method will sychronize data from the collections found
213-
on the remote master to the local ArangoDB database. All data in the local
214-
collections will be purged and replaced with data from the master.
212+
WARNING: calling this method will synchronize data from the collections found
213+
on the remote leader to the local ArangoDB database. All data in the local
214+
collections will be purged and replaced with data from the leader.
215215

216216
Use with caution!
217217

218218
Please also keep in mind that this command may take a long time to complete
219219
and return. This is because it will first do a full data synchronization with
220-
the master, which will take time roughly proportional to the amount of data.
220+
the leader, which will take time roughly proportional to the amount of data.
221221

222222
**Note**: this method is not supported on a Coordinator in a cluster.
223223

Documentation/DocuBlocks/Rest/Replication/put_api_replication_synchronize.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
@RESTHEADER{PUT /_api/replication/sync, Synchronize data from a remote endpoint, handleCommandSync}
66

77
@RESTBODYPARAM{endpoint,string,required,string}
8-
the master endpoint to connect to (e.g. "tcp://192.168.173.13:8529").
8+
the leader endpoint to connect to (e.g. "tcp://192.168.173.13:8529").
99

1010
@RESTBODYPARAM{database,string,optional,string}
11-
the database name on the master (if not specified, defaults to the
11+
the database name on the leader (if not specified, defaults to the
1212
name of the local current database).
1313

1414
@RESTBODYPARAM{username,string,optional,string}
@@ -36,12 +36,12 @@ specified, the allowed values are *include* or *exclude*.
3636
@RESTBODYPARAM{restrictCollections,array,optional,string}
3737
an optional array of collections for use with
3838
*restrictType*. If *restrictType* is *include*, only the specified collections
39-
will be sychronised. If *restrictType* is *exclude*, all but the specified
39+
will be synchronized. If *restrictType* is *exclude*, all but the specified
4040
collections will be synchronized.
4141

4242
@RESTBODYPARAM{initialSyncMaxWaitTime,integer,optional,int64}
4343
the maximum wait time (in seconds) that the initial synchronization will
44-
wait for a response from the master when fetching initial collection data.
44+
wait for a response from the leader when fetching initial collection data.
4545
This wait time can be used to control after what time the initial synchronization
4646
will give up waiting for a response and fail.
4747
This value will be ignored if set to *0*.
@@ -70,7 +70,7 @@ attributes:
7070
was started. Use this value as the *from* value when starting the continuous
7171
synchronization later.
7272

73-
WARNING: calling this method will sychronize data from the collections found
73+
WARNING: calling this method will synchronize data from the collections found
7474
on the remote endpoint to the local ArangoDB database. All data in the local
7575
collections will be purged and replaced with data from the endpoint.
7676

arangod/Cluster/HeartbeatThread.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -589,9 +589,9 @@ void HeartbeatThread::getNewsFromAgencyForCoordinator() {
589589

590590
AgencyComm agency(_server);
591591

592-
auto updateMaster = agency.casValue("/Current/Foxxmaster", foxxmasterSlice,
592+
auto updateLeader = agency.casValue("/Current/Foxxmaster", foxxmasterSlice,
593593
myIdBuilder.slice(), 0, 10.0);
594-
if (updateMaster.successful()) {
594+
if (updateLeader.successful()) {
595595
// We won the race we are the master
596596
ServerState::instance()->setFoxxmaster(state->getId());
597597
}
@@ -983,8 +983,8 @@ void HeartbeatThread::runSingleServer() {
983983
LOG_TOPIC("94dbc", WARN, Logger::HEARTBEAT)
984984
<< "user stopped applier, please restart";
985985
continue;
986-
} else if (error.isNot(TRI_ERROR_REPLICATION_MASTER_INCOMPATIBLE) &&
987-
error.isNot(TRI_ERROR_REPLICATION_MASTER_CHANGE) &&
986+
} else if (error.isNot(TRI_ERROR_REPLICATION_LEADER_INCOMPATIBLE) &&
987+
error.isNot(TRI_ERROR_REPLICATION_LEADER_CHANGE) &&
988988
error.isNot(TRI_ERROR_REPLICATION_LOOP) &&
989989
error.isNot(TRI_ERROR_REPLICATION_NO_START_TICK) &&
990990
error.isNot(TRI_ERROR_REPLICATION_START_TICK_NOT_PRESENT)) {

arangod/Pregel/Algos/AsyncSCC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ GraphFormat<SCCValue, int8_t>* AsyncSCC::inputFormat() const {
188188
}
189189

190190
struct ASCCMasterContext : public MasterContext {
191-
ASCCMasterContext() {} // TODO use _threashold
191+
ASCCMasterContext() {} // TODO use _threshold
192192
void preGlobalSuperstep() override {
193193
if (globalSuperstep() == 0) {
194194
enterNextGlobalSuperstep();

arangod/Pregel/Algos/DMID/DMID.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ GraphFormat<DMIDValue, float>* DMID::inputFormat() const {
649649
}
650650

651651
struct DMIDMasterContext : public MasterContext {
652-
DMIDMasterContext() {} // TODO use _threashold
652+
DMIDMasterContext() {} // TODO use _threshold
653653

654654
void preGlobalSuperstep() override {
655655
/**

arangod/Pregel/Algos/SCC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ GraphFormat<SCCValue, int8_t>* SCC::inputFormat() const {
189189
}
190190

191191
struct SCCMasterContext : public MasterContext {
192-
SCCMasterContext() {} // TODO use _threashold
192+
SCCMasterContext() {} // TODO use _threshold
193193
void preGlobalSuperstep() override {
194194
if (globalSuperstep() == 0) {
195195
aggregate<uint32_t>(kPhase, SCCPhase::TRANSPOSE);

0 commit comments

Comments
 (0)
0