Hi Luke,

I renamed precommit to pre_triggers, and then re-associated the hook to
bucket type instead of bucket as you suggested. Also, started redbug on all
three consoles, and confirmed that it started. Then, I made the call that
should trigger the hooks, but nothing triggered. The module shows up fine
in each of the consoles. This is the output I got after redbug timed out
(after the testing):

redbug done, timeout - 0


Also, sasl-error log is still not being created, just in case this matters
(if the log is supposed to be created when enabled). I added this
configuration in advanced.config (with different paths for each of the
nodes):
{sasl,[sasl_error_logger,{file, "/home/ec2-user/riak/riak1/log/sasl.log"}]}

On Fri, May 13, 2016 at 10:07 AM, Luke Bakken <lbak...@basho.com> wrote:

> Sanket -
>
> One other thought. Could you please change the name of your module to
> something other than "precommit"? That is the atom being used for
> precommit hooks and maybe that's causing an issue.
>
> --
> Luke Bakken
> Engineer
> lbak...@basho.com
>
>
> On Fri, May 13, 2016 at 7:05 AM, Luke Bakken <lbak...@basho.com> wrote:
> > Hi Sanket -
> >
> > Could you please try *removing* the precommit hook from the "uuid_log"
> > bucket and define it on the "test_kv_wo" bucket type instead?
> >
> > Removal:
> > curl -4vvv -H 'Content-Type: application/json' -X PUT
> > localhost:8098/types/test_kv_wo/buckets/uuid_log/props -d
> > '{"props":{"precommit":[]}}'
> >
> > Confirm:
> > curl -4vvv localhost:8098/types/test_kv_wo/buckets/uuid_log/props
> >
> > Add precommit hook to bucket type:
> > curl -4vvv -H 'Content-Type: application/json' -X PUT
> > localhost:8098/types/test_kv_wo/props -d
> > '{"props":{"precommit":[{"mod":"precommit","fun":"pre_uuid"}]}}'
> >
> > Confirm:
> > curl -4vvv localhost:8098/types/test_kv_wo/props
> >
> > You can then use redbug to trace calls within Erlang:
> >
> > riak attach
> >
> > The following statement will wait for up to 10 minutes and will
> > display up to 10 calls to your pre_uuid function. Note that the period
> > is significant:
> >
> > redbug:start(600000, 10, "precommit:pre_uuid/1->return").
> >
> > If you run the above redbug statement on all nodes, you should see one
> > or more outputs showing that it was called. You can confirm that
> > redbug is working by tracing calls to now():
> >
> > redbug:start("erlang:now/0").
> >
> > --
> > Luke Bakken
> > Engineer
> > lbak...@basho.com
> >
> > On Tue, May 10, 2016 at 6:49 PM, Sanket Agrawal
> > <sanket.agra...@gmail.com> wrote:
> >> One more thing - I set up the hooks by bucket, not bucket type. The
> >> documentation for 2.1.4 says that hooks are defined on the bucket level.
> >> Here is how I set up precommit hook (derived from "Riak Handbook" p95):
> >>
> >> curl -X PUT localhost:8098/types/test_kv_wo/buckets/uuid_log/props -H
> >> 'Content-Type: application/json' -d '{ "props": { "precommit": [{"mod":
> >> "precommit", "fun": "pre_uuid"}]}}' -v
> >>
> >>
> >> On Tue, May 10, 2016 at 9:15 PM, Sanket Agrawal <
> sanket.agra...@gmail.com>
> >> wrote:
> >>>
> >>> I just set up a precommit hook function in dev environment (KV 2.1.4)
> >>> which doesn't seem to be triggering off at all. The object is being
> stored
> >>> in the bucket, but the precommit logic is not kicking off. I checked
> couple
> >>> of things as listed below but came up with no error - so, it is a
> >>> head-scratcher why precommit hook is not triggering:
>
_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to