Skip to content

Commit 5836cfc

Browse files
committed
MB-37955: Forestdb does not return erroron read failure
When a corruption is detected, forestdb does not pass the error all the way up. The fix is to handle the error returned and pass it up. Change-Id: I123f59d4c0f2010bd6a34c6a6b596c13c28cc83e Reviewed-on: http://review.couchbase.org/122826 Tested-by: Build Bot <[email protected]> Well-Formed: Wayne Siu <[email protected]> Well-Formed: Build Bot <[email protected]> Reviewed-by: Srinath Duvuru <[email protected]>
1 parent 4c3b2f9 commit 5836cfc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/hbtrie.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,9 @@ static hbtrie_result _hbtrie_next(struct hbtrie_iterator *it,
801801
// if next sub b-tree exists
802802
item_new = _get_entry(e, struct btreeit_item, le);
803803
hr = _hbtrie_next(it, item_new, key_buf, keylen, value_buf, flag);
804+
if (hr == HBTRIE_CORRUPTED_RECOVERING_ERR) {
805+
return HBTRIE_CORRUPTED_RECOVERING_ERR;
806+
}
804807
if (hr != HBTRIE_RESULT_SUCCESS) {
805808
it->keylen = (item->chunkno+1) * trie->chunksize;
806809
}

0 commit comments

Comments
 (0)