Skip to content
Snippets Groups Projects
Commit 8d46a85e authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

Merge branch '1.6' of github.com:tarantool/tarantool into 1.6

parents 2d266be4 1dbb316d
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
......@@ -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
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment