Skip to content

Commit

Permalink
FEATURE: Remove attribute compatibility check in smget.
Browse files Browse the repository at this point in the history
The btree attribute compatibility check was added
in the first smget implementation in order to avoid
any abnormal smget on btrees having different attributes.
Now, we think the abnormal case will not exist
even if the btrees have different attributes.
So, we remove the attribute compatibility check.
  • Loading branch information
jhpark816 committed Jun 5, 2018
1 parent 1257150 commit d3e9d6f
Showing 1 changed file with 0 additions and 42 deletions.
42 changes: 0 additions & 42 deletions engines/default/items.c
Original file line number Diff line number Diff line change
Expand Up @@ -5025,13 +5025,9 @@ static ENGINE_ERROR_CODE do_btree_smget_scan_sort_old(struct default_engine *eng
int mid, left, right;
bool ascending = (bkrtype != BKEY_RANGE_TYPE_DSC ? true : false);
bool is_first;
bkey_t maxbkeyrange;
int32_t maxelemcount = 0;
uint8_t overflowactn = OVFL_SMALLEST_TRIM;

*missed_key_count = 0;

maxbkeyrange.len = BKEY_NULL;
for (k = 0; k < key_count; k++) {
ret = do_btree_item_find(engine, key_array[k].value, key_array[k].length, DO_UPDATE, &it);
if (ret != ENGINE_SUCCESS) {
Expand Down Expand Up @@ -5059,23 +5055,6 @@ static ENGINE_ERROR_CODE do_btree_smget_scan_sort_old(struct default_engine *eng
}
assert(info->root != NULL);

if (sort_count == 0) {
/* save the b+tree attributes */
maxbkeyrange = info->maxbkeyrange;
maxelemcount = info->mcnt;
overflowactn = info->ovflact;
} else {
/* check if the b+trees have same attributes */
if (maxelemcount != info->mcnt || overflowactn != info->ovflact ||
maxbkeyrange.len != info->maxbkeyrange.len ||
(maxbkeyrange.len != BKEY_NULL &&
BKEY_ISNE(maxbkeyrange.val, maxbkeyrange.len, info->maxbkeyrange.val, maxbkeyrange.len)))
{
do_item_release(engine, it);
ret = ENGINE_EBADATTR; break;
}
}

elem = do_btree_find_first(info->root, bkrtype, bkrange, &posi, false);
if (elem == NULL) { /* No elements within the bkey range */
if ((info->mflags & COLL_META_FLAG_TRIMMED) != 0) {
Expand Down Expand Up @@ -5243,11 +5222,7 @@ do_btree_smget_scan_sort(struct default_engine *engine,
int mid, left, right;
bool ascending = (bkrtype != BKEY_RANGE_TYPE_DSC ? true : false);
bool is_first;
bkey_t maxbkeyrange;
int32_t maxelemcount = 0;
uint8_t overflowactn = OVFL_SMALLEST_TRIM;

maxbkeyrange.len = BKEY_NULL;
for (k = 0; k < key_count; k++) {
ret = do_btree_item_find(engine, key_array[k].value, key_array[k].length, DO_UPDATE, &it);
if (ret != ENGINE_SUCCESS) {
Expand All @@ -5273,23 +5248,6 @@ do_btree_smget_scan_sort(struct default_engine *engine,
}
assert(info->root != NULL);

if (sort_count == 0) {
/* save the b+tree attributes */
maxbkeyrange = info->maxbkeyrange;
maxelemcount = info->mcnt;
overflowactn = info->ovflact;
} else {
/* check if the b+trees have same attributes */
if (maxelemcount != info->mcnt || overflowactn != info->ovflact ||
maxbkeyrange.len != info->maxbkeyrange.len ||
(maxbkeyrange.len != BKEY_NULL &&
BKEY_ISNE(maxbkeyrange.val, maxbkeyrange.len, info->maxbkeyrange.val, maxbkeyrange.len)))
{
do_item_release(engine, it);
ret = ENGINE_EBADATTR; break;
}
}

elem = do_btree_find_first(info->root, bkrtype, bkrange, &posi, false);
if (elem == NULL) { /* No elements within the bkey range */
if ((info->mflags & COLL_META_FLAG_TRIMMED) != 0 &&
Expand Down

0 comments on commit d3e9d6f

Please sign in to comment.