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
The bitcask backend wraps the key transformation function KT() in a try/catch each time it is called:
K = try KT(K0) catch TxErr -> {key_tx_error, TxErr} end,
However, the TxErr will only match explicitly thrown exceptions. In the case of riak_kv_bitcask_backend:key_transform_to_1/1, if an invalid key is encountered the exception thrown is:
Proper fix is to rework every instances where a key transform is called to use the Class:Exception pattern so exceptions are actually caught.
As an interim workaround, adding a catch-all clause to the transform functions that explicitly throws an exception would allow the existing catch pattern to match for many cases:
The text was updated successfully, but these errors were encountered:
Basho-JIRA
changed the title
Operation aborts if any file contains a corrupt key
Operation aborts if any file contains a corrupt key [JIRA: RIAK-2371]
Feb 2, 2016
The bitcask backend wraps the key transformation function
KT()
in a try/catch each time it is called:K = try KT(K0) catch TxErr -> {key_tx_error, TxErr} end,
However, the
TxErr
will only match explicitly thrown exceptions. In the case of riak_kv_bitcask_backend:key_transform_to_1/1, if an invalid key is encountered the exception thrown is:{error,function_clause,[{riak_kv_bitcask_backend,key_transform_to_1,[<<>>],[{file,"src/riak_kv_bitcask_backend.erl"},{line,99}]}
which is not caught by the above pattern.
Proper fix is to rework every instances where a key transform is called to use the
Class:Exception
pattern so exceptions are actually caught.As an interim workaround, adding a catch-all clause to the transform functions that explicitly throws an exception would allow the existing catch pattern to match for many cases:
The text was updated successfully, but these errors were encountered: