Skip to content

Commit 0534ab2

Browse files
committed
Document box.info.replication[x].peer
closes gh-354
1 parent 9c38556 commit 0534ab2

File tree

4 files changed

+43
-40
lines changed

4 files changed

+43
-40
lines changed

doc/1.7/book/box/box_info.rst

Lines changed: 32 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ variables.
1717
* **vclock** corresponds to **replication.downstream.vclock** (see below).
1818
* **uptime** is the number of seconds since the instance started.
1919
This value can also be retrieved with :ref:`tarantool.uptime() <tarantool-build>`.
20-
* **lsn** corresponds to **replication.lsn** (see below).
20+
* **lsn** corresponds to **replication.lsn** (see below).
2121
* **vinyl** returns runtime statistics for vinyl storage engine.
2222
* **cluster.uuid** is the UUID of the replica set.
2323
Every instance in a replica set will have the same ``cluster.uuid`` value.
@@ -34,7 +34,7 @@ variables.
3434
.. _box_info_replication:
3535

3636
**replication** part contains statistics for all instances in the replica
37-
set in regard to the current instance (see an example in the section
37+
set in regard to the current instance (see also an example in the section
3838
:ref:`"Monitoring a replica set" <replication-monitoring>`):
3939

4040
* **replication.id** is a short numeric identifier of the instance within the
@@ -47,28 +47,30 @@ set in regard to the current instance (see an example in the section
4747
:ref:`write ahead log <index-box_persistence>` (WAL).
4848
* **replication.upstream** contains statistics for the replication data
4949
uploaded by the instance.
50-
* **replication.upstream.status** is the replication status of the instance.
50+
* **replication.upstream.status** is the replication status of the instance:
5151

52-
* ``auth`` means that the instance is getting :ref:`authenticated <authentication>` to connect to a
53-
replication source.
52+
* ``auth`` means that the instance is getting
53+
:ref:`authenticated <authentication>` to connect to a replication source.
5454
* ``connecting`` means that the instance is trying to connect to the
5555
replications source(s) listed
5656
in its :ref:`replication <cfg_replication-replication>` parameter.
5757
* ``disconnected`` means that the instance is not connected to the replica set
5858
(due to network problems, not replication errors).
59-
* ``follow`` means that the instance's :ref:`role <replication-roles>` is "replica" (read-only) and
60-
replication is in progress.
59+
* ``follow`` means that the instance's :ref:`role <replication-roles>`
60+
is "replica" (read-only) and replication is in progress.
6161
* ``running`` means the instance's role is "master" (non read-only) and
6262
replication is in progress.
6363
* ``stopped`` means that replication was stopped due to a replication error
6464
(e.g. :ref:`duplicate key <error_codes>`).
6565

6666
* **replication.upstream.idle** is the time (in seconds) since the instance
6767
received the last event from a master.
68+
* **replication.upstream.peer** contains the replication user name, host IP
69+
adress and port number used for the instance.
6870
* **replication.upstream.lag** is the time difference between the local time at
6971
the instance, recorded when the event was received, and the local time at
70-
another master recorded when the event was written to the :ref:`write ahead log <internals-wal>` on
71-
that master.
72+
another master recorded when the event was written to the
73+
:ref:`write ahead log <internals-wal>` on that master.
7274

7375
Since ``lag`` calculation uses operating system clock from two different
7476
machines, don’t be surprised if it’s negative: a time drift may lead to the
@@ -93,46 +95,40 @@ set in regard to the current instance (see an example in the section
9395

9496
**Example:**
9597

98+
This example is for a master-replica set that contains one master instance
99+
and one replica instance. The request was issued at the replica instance.
100+
96101
.. code-block:: tarantoolsession
97102
98103
tarantool> box.info
99104
---
100-
- version: 1.7.4-52-g980d30092
101-
id: 1
102-
ro: false
103-
vclock: {1: 8}
104-
uptime: 7280
105-
lsn: 8
105+
- version: 1.7.6-68-g51fcffb77
106+
id: 2
107+
ro: true
108+
vclock: {1: 5}
109+
uptime: 917
110+
lsn: 0
106111
vinyl: []
107112
cluster:
108-
uuid: f7c0c1c6-f9d8-4df7-82ff-d4bd00610a6c
109-
pid: 16162
113+
uuid: 783e2285-55b1-42d4-b93c-68dcbb7a8c18
114+
pid: 35341
110115
status: running
111-
signature: 8
116+
signature: 5
112117
replication:
113118
1:
114119
id: 1
115-
uuid: 1899631e-6369-40a1-81c9-7d170e909276
116-
lsn: 8
117-
2:
118-
id: 2
119-
uuid: bd949e5d-7ff9-413e-b4f2-c9b0149fdda6
120-
lsn: 0
120+
uuid: 471cd36e-cb2e-4447-ac66-2d28e9dd3b67
121+
lsn: 5
121122
upstream:
122123
status: follow
123-
idle: 7256.7571430206
124+
idle: 124.98795700073
125+
peer: [email protected]:3301
124126
lag: 0
125127
downstream:
126-
vclock: {1: 8}
127-
3:
128-
id: 3
129-
uuid: c5cb61d5-fa48-460d-abd7-3f13709d07a7
128+
vclock: {1: 5}
129+
2:
130+
id: 2
131+
uuid: ac45d5d2-8a16-4520-ad5e-1abba6baba0a
130132
lsn: 0
131-
upstream:
132-
status: follow
133-
idle: 7255.7510120869
134-
lag: 0
135-
downstream:
136-
vclock: {1: 8}
137-
uuid: 1899631e-6369-40a1-81c9-7d170e909276
133+
uuid: ac45d5d2-8a16-4520-ad5e-1abba6baba0a
138134
...

doc/1.7/book/replication/repl_duplicates.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,19 @@ report), because the downstream has encountered the same error:
7070
uuid: 7ab6dee7-dc0f-4477-af2b-0e63452573cf
7171
lsn: 9
7272
upstream:
73+
peer: [email protected]:3301
74+
lag: 0.00050592422485352
7375
status: stopped
7476
idle: 445.8626639843
7577
message: Duplicate key exists in unique index 'primary' in space 'tester'
76-
lag: 0.00050592422485352
7778
2:
7879
id: 2
7980
uuid: 9afbe2d9-db84-4d05-9a7b-e0cbbf861e28
8081
lsn: 1000000
8182
upstream:
8283
status: follow
8384
idle: 201.99915885925
85+
peer: [email protected]:3301
8486
lag: 0.0015020370483398
8587
downstream:
8688
vclock: {1: 8, 2: 1000000, 3: 3}

doc/1.7/book/replication/repl_monitoring.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ these instances, use ``box.info.replication`` request:
2323
upstream:
2424
status: follow
2525
idle: 43.187747001648
26+
peer: [email protected]:3301
2627
lag: 0
2728
downstream:
2829
vclock: {1: 31}
@@ -33,6 +34,7 @@ these instances, use ``box.info.replication`` request:
3334
upstream:
3435
status: follow
3536
idle: 43.187621831894
37+
peer: [email protected]:3301
3638
lag: 2
3739
downstream:
3840
vclock: {1: 54}

doc/1.7/book/replication/repl_recover.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@ replicas stating that the connection is lost:
3636
uuid: 70e8e9dc-e38d-4046-99e5-d25419267229
3737
lsn: 542
3838
upstream:
39+
peer: [email protected]:3301
40+
lag: 0.00026607513427734
3941
status: disconnected
4042
idle: 182.36929893494
4143
message: connect, called on fd 13, aka 192.168.0.101:58244
42-
lag: 0.00026607513427734
4344
2:
4445
id: 2
4546
uuid: fb252ac7-5c34-4459-84d0-54d248b8c87e
@@ -55,24 +56,26 @@ replicas stating that the connection is lost:
5556
.. code-block:: tarantoolsession
5657
5758
# report from replica #2
58-
box.info.replication
59+
tarantool> box.info.replication
5960
---
6061
- 1:
6162
id: 1
6263
uuid: 70e8e9dc-e38d-4046-99e5-d25419267229
6364
lsn: 542
6465
upstream:
66+
peer: [email protected]:3301
67+
lag: 0.00027203559875488
6568
status: disconnected
6669
idle: 186.76988101006
6770
message: connect, called on fd 13, aka 192.168.0.101:58253
68-
lag: 0.00027203559875488
6971
2:
7072
id: 2
7173
uuid: fb252ac7-5c34-4459-84d0-54d248b8c87e
7274
lsn: 0
7375
upstream:
7476
status: follow
7577
idle: 186.76960110664
78+
peer: [email protected]:3301
7679
lag: 0.00020599365234375
7780
3:
7881
id: 3

0 commit comments

Comments
 (0)