Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
tarantool
Commits
8d46a85e
Commit
8d46a85e
authored
9 years ago
by
Konstantin Osipov
Browse files
Options
Downloads
Plain Diff
Merge branch '1.6' of github.com:tarantool/tarantool into 1.6
parents
2d266be4
1dbb316d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/box/replica.cc
+5
-0
5 additions, 0 deletions
src/box/replica.cc
test/replication/status.result
+25
-3
25 additions, 3 deletions
test/replication/status.result
test/replication/status.test.lua
+11
-3
11 additions, 3 deletions
test/replication/status.test.lua
with
41 additions
and
6 deletions
src/box/replica.cc
+
5
−
0
View file @
8d46a85e
...
...
@@ -116,6 +116,7 @@ replica_connect(struct replica *replica)
coio_connect
(
coio
,
uri
,
&
replica
->
addr
,
&
replica
->
addr_len
);
assert
(
coio
->
fd
>=
0
);
coio_readn
(
coio
,
greetingbuf
,
IPROTO_GREETING_SIZE
);
replica
->
last_row_time
=
ev_now
(
loop
());
/* Decode server version and name from greeting */
struct
greeting
greeting
;
...
...
@@ -149,6 +150,7 @@ replica_connect(struct replica *replica)
uri
->
password_len
);
replica_write_row
(
coio
,
&
row
);
replica_read_row
(
coio
,
iobuf
,
&
row
);
replica
->
last_row_time
=
ev_now
(
loop
());
if
(
row
.
type
!=
IPROTO_OK
)
xrow_decode_error
(
&
row
);
/* auth failed */
...
...
@@ -177,6 +179,7 @@ replica_join(struct replica *replica, struct recovery *r)
while
(
true
)
{
replica_read_row
(
coio
,
iobuf
,
&
row
);
replica
->
last_row_time
=
ev_now
(
loop
());
if
(
row
.
type
==
IPROTO_OK
)
{
/* End of stream */
say_info
(
"done"
);
...
...
@@ -408,6 +411,8 @@ replica_new(const char *uri)
/* URI checked by box_check_replication_source() */
assert
(
rc
==
0
&&
replica
->
uri
.
service
!=
NULL
);
(
void
)
rc
;
replica
->
last_row_time
=
ev_now
(
loop
());
return
replica
;
}
...
...
This diff is collapsed.
Click to expand it.
test/replication/status.result
+
25
−
3
View file @
8d46a85e
...
...
@@ -92,6 +92,9 @@ control_ch:put(true)
---
- true
...
require('fiber').sleep(0) -- wait replica to send auth request
---
...
r = box.info.replication
---
...
...
...
@@ -103,7 +106,10 @@ r.lag < 1
---
- true
...
-- r.idle < 1 -- broken
r.idle < 1
---
- true
...
--
-- gh-480: check replica reconnect on socket error
--
...
...
@@ -118,11 +124,11 @@ control_ch:put("goodbye")
r = box.info.replication
---
...
r.status == "disconnected"
r.status == "disconnected"
and r.message:match("socket") ~= nil or r.status == 'auth'
---
- true
...
r.
message:match("socket") ~= nil
r.
idle < 1
---
- true
...
...
...
@@ -151,6 +157,22 @@ control_ch:put("goodbye")
---
- true
...
source = box.cfg.replication_source
---
...
box.cfg { replication_source = "" }
---
...
box.cfg { replication_source = source }
---
...
r = box.info.replication
---
...
r.idle < 1
---
- true
...
--# stop server replica
--# cleanup server replica
--# set connection default
...
...
This diff is collapsed.
Click to expand it.
test/replication/status.test.lua
+
11
−
3
View file @
8d46a85e
...
...
@@ -48,10 +48,11 @@ r.status == "connect"
control_ch
:
put
(
true
)
require
(
'fiber'
).
sleep
(
0
)
-- wait replica to send auth request
r
=
box
.
info
.
replication
r
.
status
==
"auth"
r
.
lag
<
1
--
r.idle < 1
-- broken
r
.
idle
<
1
--
-- gh-480: check replica reconnect on socket error
...
...
@@ -59,8 +60,8 @@ r.lag < 1
slowpoke
:
close
()
control_ch
:
put
(
"goodbye"
)
r
=
box
.
info
.
replication
r
.
status
==
"disconnected"
r
.
message
:
match
(
"socket"
)
~=
nil
r
.
status
==
"disconnected"
and
r
.
message
:
match
(
"socket"
)
~=
nil
or
r
.
status
==
'auth'
r
.
idle
<
1
slowpoke
=
require
(
'socket'
).
tcp_server
(
uri
.
host
,
uri
.
port
,
slowpoke_loop
)
control_ch
:
put
(
true
)
...
...
@@ -71,6 +72,13 @@ r.status == 'connecting' or r.status == 'auth'
slowpoke
:
close
()
control_ch
:
put
(
"goodbye"
)
source
=
box
.
cfg
.
replication_source
box
.
cfg
{
replication_source
=
""
}
box
.
cfg
{
replication_source
=
source
}
r
=
box
.
info
.
replication
r
.
idle
<
1
--# stop server replica
--# cleanup server replica
--# set connection default
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment