Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MergeOperator Support #69

Open
pablofrommars opened this issue Dec 3, 2019 · 0 comments
Open

MergeOperator Support #69

pablofrommars opened this issue Dec 3, 2019 · 0 comments

Comments

@pablofrommars
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant