Commit f855ce35 authored by Vincenzo Liberatore's avatar Vincenzo Liberatore

Addresses #293

Addresses #307
Fixed failure conditions in sweep borders

git-svn-id: file:///svn/tokudb@2082 c7de825b-a66e-492c-adef-691d508d4ae1
parent 99b53007
...@@ -742,9 +742,6 @@ static int __toku_lt_get_border(toku_lock_tree* tree, BOOL in_borderwrite, ...@@ -742,9 +742,6 @@ static int __toku_lt_get_border(toku_lock_tree* tree, BOOL in_borderwrite,
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 (in_borderwrite && *found_p && *found_s && pred->data == succ->data &&
pred->data == to_insert->data) {
return __toku_lt_panic(tree); }
return 0; return 0;
} }
...@@ -846,6 +843,8 @@ static int __toku_lt_borderwrite_insert(toku_lock_tree* tree, ...@@ -846,6 +843,8 @@ static int __toku_lt_borderwrite_insert(toku_lock_tree* tree,
if (r!=0) return __toku_lt_panic(tree); if (r!=0) return __toku_lt_panic(tree);
if (numfound == 0) { if (numfound == 0) {
if (found_p && found_s && pred.data == succ.data) {
return __toku_lt_panic(tree); }
r = __toku_lt_expand_border(tree, to_insert, &pred, &succ, r = __toku_lt_expand_border(tree, to_insert, &pred, &succ,
found_p, found_s); found_p, found_s);
if (r!=0) return __toku_lt_panic(tree); if (r!=0) return __toku_lt_panic(tree);
...@@ -1094,6 +1093,8 @@ static int __toku_sweep_border(toku_lock_tree* tree, toku_range* range) { ...@@ -1094,6 +1093,8 @@ static int __toku_sweep_border(toku_lock_tree* tree, toku_range* range) {
r = __toku_lt_get_border(tree, TRUE, &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;
if (found_p && found_s && pred.data == succ.data &&
pred.data == buf[0].data) { return __toku_lt_panic(tree); }
/* If both found and pred.data=succ.data, merge pred and succ (expand?) /* If both found and pred.data=succ.data, merge pred and succ (expand?)
free_points */ free_points */
......
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