You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My custom merge operator is able to realise that these two operations, actually reduce down to nothing i.e. no operation needs to be performed.
If I clear the output by calling new_value->clear(). The problem I see is that subsequent calls to MergeOperator::FullMergeV2 then have empty operands in the operand_list.
Whilst I could handle empty operands in my FullMergeV2, this seems like an unnecessary memory and processing overhead (especially if I have a large operand list, where all the operands are effectively empty).
I tried modifying db/merge_helper.cc (around line 341), so that if PartialMergeMulti results in an empty merge_result, then the result is ignored:
if (merge_success) {
// Merging of operands (associative merge) was successful.// Replace operands with the merge result
merge_context_.Clear();
if (!merge_result.empty()) {
merge_context_.PushOperand(merge_result);
}
keys_.erase(keys_.begin(), keys_.end() - 1);
}
However I get assertion failures with regards to keys and values size. After further study it seems such a change is perhaps non-trivial to implement with the current design.
I do think that PartialMergeMulti being able to return nothing, is a valid state (as demonstrated by my custom MergeOperator above). Please advise as to the best way to move forward with this...
The text was updated successfully, but these errors were encountered:
It seems at the moment that
MergeOperator::PartialMergeMulti
must always produce a value.However, consider that I have an operand list like so:
My custom merge operator is able to realise that these two operations, actually reduce down to nothing i.e. no operation needs to be performed.
If I clear the output by calling
new_value->clear()
. The problem I see is that subsequent calls toMergeOperator::FullMergeV2
then have empty operands in theoperand_list
.Whilst I could handle empty operands in my FullMergeV2, this seems like an unnecessary memory and processing overhead (especially if I have a large operand list, where all the operands are effectively empty).
I tried modifying
db/merge_helper.cc
(around line 341), so that ifPartialMergeMulti
results in an emptymerge_result
, then the result is ignored:However I get assertion failures with regards to keys and values size. After further study it seems such a change is perhaps non-trivial to implement with the current design.
I do think that
PartialMergeMulti
being able to return nothing, is a valid state (as demonstrated by my custom MergeOperator above). Please advise as to the best way to move forward with this...The text was updated successfully, but these errors were encountered: