Incompatible word-length error
Closed this issue · 4 comments
wouterbeek commented
After the first merge, RocksDB gives the following error upon enumeration:
PL_recorded_external(): Incompatible word-length (64)
Here is a reproducible case (reproducible on the LOD machine):
:- use_module(library(filesex)).
:- use_module(library(ordsets)).
:- use_module(library(rocksdb)).
test :-
absolute_file_name(tmp, Dir, [access(write),file_type(directory)]),
delete_directory_contents(Dir),
setup_call_cleanup(
rocks_open(Dir, Db, [key(atom),merge(merge0),value(term)]),
(
rocks_merge(Db, x, [x]),
forall(
rocks_enum(Db, A, B),
writeln(A-B)
)
),
rocks_close(Db)
).
merge0(partial, _, A, B, C) :- ord_union(A, B, C).
JanWielemaker commented
You have no merge rule for full
. If we add (as the example states):
merge0(full, Key, Initial, Additions, Result) :-
append([Initial|Additions], List),
sort(List, Result).
All seems to work fine. Unfortunately (AFAIK), the merger cannot forward errors to RocksDB.
wouterbeek commented
@JanWielemaker Is it always required to define both? IIUC rocks_merge(Db, x, [x])
should only use the partial
variant?
JanWielemaker commented
On 06/14/2017 10:16 AM, Wouter Beek wrote:
@JanWielemaker <https://github.com/janwielemaker> Is it always required
to define both? IIUC |rocks_merge(Db, x, [x])| should only use the
|partial| variant?
AFAIK, yes. A simple writes says it calls the `full` one. I forgot
the rationale behind this in RocksDB.
…--- Jan
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AC7cqrhqABfDuczW2b0RymP4GgKG9mVLks5sD5bggaJpZM4N4tS2>.
wouterbeek commented
Thanks! That clears things up for me. I'll update the docs to reflect RocksDB's requirement.