Commit d283051a authored by Vincenzo Liberatore's avatar Vincenzo Liberatore

Addresses #293

Addresses #307
Fixed the condition under which the border sweep would fail.


git-svn-id: file:///svn/tokudb@2081 c7de825b-a66e-492c-adef-691d508d4ae1
parent 5762a74d
...@@ -728,21 +728,22 @@ static int __toku_lt_preprocess(toku_lock_tree* tree, DB_TXN* txn, ...@@ -728,21 +728,22 @@ static int __toku_lt_preprocess(toku_lock_tree* tree, DB_TXN* txn,
return 0; return 0;
} }
static int __toku_lt_get_border(toku_lock_tree* tree, BOOL in_self, static int __toku_lt_get_border(toku_lock_tree* tree, BOOL in_borderwrite,
toku_range* pred, toku_range* succ, toku_range* pred, toku_range* succ,
BOOL* found_p, BOOL* found_s, BOOL* found_p, BOOL* found_s,
toku_range* to_insert) { toku_range* to_insert) {
assert(tree && pred && succ && found_p && found_s); assert(tree && pred && succ && found_p && found_s);
int r; int r;
toku_range_tree* rt; toku_range_tree* rt;
rt = in_self ? tree->borderwrite : rt = in_borderwrite ? tree->borderwrite :
__toku_lt_ifexist_selfwrite(tree, tree->buf[0].data); __toku_lt_ifexist_selfwrite(tree, tree->buf[0].data);
if (!rt) return __toku_lt_panic(tree); if (!rt) return __toku_lt_panic(tree);
r = toku_rt_predecessor(rt, to_insert->left, pred, found_p); r = toku_rt_predecessor(rt, to_insert->left, pred, found_p);
if (r!=0) return r; if (r!=0) return r;
r = toku_rt_successor (rt, to_insert->right, succ, found_s); r = toku_rt_successor (rt, to_insert->right, succ, found_s);
if (r!=0) return r; if (r!=0) return r;
if (*found_p && *found_s && pred->data == succ->data) { if (in_borderwrite && *found_p && *found_s && pred->data == succ->data &&
pred->data == to_insert->data) {
return __toku_lt_panic(tree); } return __toku_lt_panic(tree); }
return 0; return 0;
} }
...@@ -1090,7 +1091,7 @@ static int __toku_sweep_border(toku_lock_tree* tree, toku_range* range) { ...@@ -1090,7 +1091,7 @@ static int __toku_sweep_border(toku_lock_tree* tree, toku_range* range) {
BOOL found_p; BOOL found_p;
BOOL found_s; BOOL found_s;
r = __toku_lt_get_border(tree, FALSE, &pred, &succ, &found_p, &found_s, r = __toku_lt_get_border(tree, TRUE, &pred, &succ, &found_p, &found_s,
&buf[0]); &buf[0]);
if (r!=0) return r; if (r!=0) return r;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment