Skip to content

MergeOperator Support #69

@pablofrommars

Description

@pablofrommars

Hi,

The current implementation for merging throws a RocksDbSharp.RocksDbException: 'Corruption: Error: Could not perform merge.'

After some investigation, I believe it happens because the parameters success and newValueLength of the methods PartialMerge and FullMerge are required to be set by the user:

public interface MergeOperator
{
string Name { get; }
IntPtr PartialMerge(IntPtr key, UIntPtr keyLength, IntPtr operandsList, IntPtr operandsListLength, int numOperands, IntPtr success, IntPtr newValueLength);
IntPtr FullMerge(IntPtr key, UIntPtr keyLength, IntPtr existingValue, UIntPtr existingValueLength, IntPtr operandsList, IntPtr operandsListLength, int numOperands, IntPtr success, IntPtr newValueLength);
void DeleteValue(IntPtr value, UIntPtr valueLength);
}

I got rid off the exception by adding the out paramater modifiers to the parameters mentioned above.

Do you accept contributions? As mentioned in commit 32f2ea7, the interface can certainly be more helpful to users ;)

Thanks to anyone involved with the project!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions