Skip to content
Snippets Groups Projects
Commit 068a9953 authored by Dmitry E. Oboukhov's avatar Dmitry E. Oboukhov
Browse files

Merge branch 'master' of github.com:tarantool/tarantool

parents 48d4313d 8be1988a
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@ macro(sophia_build)
add_custom_command(OUTPUT ${PROJECT_SOURCE_DIR}/third_party/sophia/db/libsophia.a
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/third_party/sophia
COMMAND $(MAKE) -C db
DEPENDS ${CMAKE_SOURCE_DIR}/CMakeCache.txt
)
else()
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/third_party/sophia
......
......@@ -490,6 +490,7 @@ iproto_enqueue_batch(struct iproto_connection *con, struct ibuf *in)
const char *pos = reqstart;
/* Read request length. */
if (mp_typeof(*pos) != MP_UINT) {
invalid_length:
tnt_raise(IllegalParams,
"Invalid MsgPack - packet length");
}
......@@ -497,7 +498,17 @@ iproto_enqueue_batch(struct iproto_connection *con, struct ibuf *in)
break;
uint32_t len = mp_decode_uint(&pos);
/* Skip fixheader */
/*
* A hack to support padding after packet length.
*/
ptrdiff_t need_bytes = IPROTO_FIXHEADER_SIZE - (pos - reqstart);
if (need_bytes > 0 && mp_typeof(*pos) == MP_STR) {
uint32_t padding;
mp_decode_str(&pos, &padding);
if (padding + 1 != need_bytes)
goto invalid_length;
}
const char *reqend = pos + len;
if (reqend > in->end)
break;
......
# encoding: tarantool
import os
import time
import re
import time
from lib.tarantool_server import TarantoolServer
# master server
master = server
# replica server
replica = TarantoolServer()
replica.deploy("replication/cfg/replica.cfg",
replica.find_exe(self.args.builddir),
os.path.join(self.args.vardir, "replica"))
replica.script = "replication/replica.lua"
replica.rpl_master = master
replica.vardir = os.path.join(master.vardir, 'replica')
replica.deploy()
replica.get_param("lsn")
status = replica.admin.execute_no_reconnect("lua box.info.status", True)
cycles = 0
status = replica.admin.execute_no_reconnect("box.info.status", True)
while (re.search(r'replica/.*/(connecting|connected)\n', status) == None and cycles < 500):
time.sleep(0.01)
status = replica.admin.execute_no_reconnect("box.info.status", True)
cycles += 1
print(re.search(r'replica/.*/(connecting|connected)\n', status) != None)
server.stop()
status = replica.admin.execute_no_reconnect("lua box.info.status", True)
master.stop()
cycles = 0
while (re.search(r'replica/.*/(connecting|failed)\n', status) == None and cycles < 500):
time.sleep(0.01)
status = replica.admin.execute_no_reconnect("box.info.status", True)
cycles += 1
print(re.search(r'replica/.*/(connecting|failed)\n', status) != None)
# Cleanup.
replica.stop()
replica.cleanup(True)
server.deploy(self.suite_ini["config"])
# vim: syntax=python
master.deploy()
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