Skip to content
Snippets Groups Projects
Commit 72f1a582 authored by Roman Tsisyk's avatar Roman Tsisyk
Browse files

Fix #707: Master crashes on JOIN if it doesn't have snapshot files

parent d7ae76b2
No related branches found
No related tags found
No related merge requests found
......@@ -144,6 +144,7 @@ struct errcode_record {
/* 90 */_(ER_ROLE_GRANTED, 2, "User '%s' already has role '%s'") \
/* 91 */_(ER_PRIV_NOT_GRANTED, 2, "User '%s' does not have %s access on %s '%s'") \
/* 92 */_(ER_ROLE_NOT_GRANTED, 2, "User '%s' does not have role '%s'") \
/* 93 */_(ER_MISSING_SNAPSHOT, 2, "Can't find snapshot") \
/*
* !IMPORTANT! Please follow instructions at start of the file
......
......@@ -354,6 +354,8 @@ recover_snap(struct recovery_state *r)
* have created it from a bootstrap copy.
*/
struct vclock *res = vclockset_last(&r->snap_dir.index);
if (res == NULL)
tnt_raise(ClientError, ER_MISSING_SNAPSHOT);
int64_t signature = vclock_signature(res);
struct xlog *snap = xlog_open(&r->snap_dir, signature, NONE);
......
......@@ -22,6 +22,10 @@ box.schema.user.grant('guest', 'replication')
---
...
ok - join with granted role
-------------------------------------------------------------
gh-707: Master crashes on JOIN if it does not have snapshot files
-------------------------------------------------------------
ok - join without snapshots
box.schema.user.revoke('guest', 'replication')
---
...
......
......@@ -3,6 +3,7 @@ import sys
import re
import yaml
import uuid
import glob
from lib.tarantool_server import TarantoolServer
## Get cluster uuid
......@@ -68,6 +69,18 @@ server.admin("box.schema.user.grant('guest', 'replication')")
server.sql.py_con.close() # re-connect with new permissions
server_id = check_join('join with granted role')
server.sql.py_con.space('_cluster').delete(server_id)
print '-------------------------------------------------------------'
print 'gh-707: Master crashes on JOIN if it does not have snapshot files'
print '-------------------------------------------------------------'
for k in glob.glob(os.path.join(server.vardir, '*.snap')):
os.unlink(k)
rows = list(server.sql.py_con.join(replica_uuid))
print len(rows) == 1 and rows[0].return_message.find('snapshot') >= 0 and \
'ok' or 'not ok', '-', 'join without snapshots'
server.admin("box.schema.user.revoke('guest', 'replication')")
server.admin('box.snapshot()')
......
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