Riak 2.1.3 hooks not invoked

Adam Kovari kovariadam at gmail.com
Mon Feb 22 10:39:48 EST 2016


I am trying to enable post commit hook for my bucket type, and I can see it is configured in the bucket-type:

➜  idvt-riak git:(master) ✗ riak-admin bucket-type status change_log
change_log is active

active: true
allow_mult: true
basic_quorum: false
big_vclock: 50
chash_keyfun: {riak_core_util,chash_std_keyfun}
claimant: 'riak at'
dvv_enabled: true
dw: quorum
last_write_wins: false
linkfun: {modfun,riak_kv_wm_link_walker,mapreduce_linkfun}
n_val: 3
notfound_ok: true
old_vclock: 86400
postcommit: [{struct,[{<<"mod">>,<<"idvt_hooks">>},
pr: 0
precommit: []
pw: 0
r: quorum
rw: quorum
small_vclock: 50
w: quorum
young_vclock: 20

The problem is that this hook never gets invoked.

The module with the hook looks like:



postcommit_batch(Object) ->
    Data = binary_to_term(riak_object:get_value(Object)),
    file:write_file("/tmp/riak.tmp", "test"),
    io:format(standard_error, "~p~n", [Data]),

And whenever I create an object in the bucket with this bucket type, no file is created and no log message written (not in console.log, nor in error.log, not even in erl when running riak attach). I am using riak-erlang-client to create an object remotely, using something like this:

Object = riakc_obj:new({BucketType, Bucket}, Id, Payload, ContentType),
riakc_pb_socket:put(Pid, Object),

I am wondering if anyone has experienced similar issue before or if someone might have any tips how to debug this problem.

This behaves the same way on os x 10.11.3, latest homebrew build of riak and also in debian linux, latest riak.


Adam Kovari

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20160222/637012c1/attachment.html>

More information about the riak-users mailing list