All, the issue is fixed now - the problem is that Riak precommit and
postcommit hooks seem to work only in root user mode. On AWS, switching
from ec2-user to root user fixed the precommit trigger issue.
That does raise the question of whether Riak should really be using root
user account. For example, Postgresql runs fine as non-root user.

On Mon, May 16, 2016 at 1:42 PM, Sanket Agrawal <sanket.agra...@gmail.com>
wrote:

> Luke, just tested and confirmed that precommit hooks are still not
> triggered for normal buckets. Objects get written but precommit hooks don't
> trigger. Manually simulating a trigger by executing the function on riak
> console works fine.
>
> Since sasl log is not being written despite being turned on, isn't that a
> sign that something is wrong with precommit/postcommit setup? This is what
> Douglar Rohrer said earlier in the thread:
>
>> Huh - I get a huge amount of logging when I turn on sasl using
>> advanced.config - specifically, I have:
>> {sasl,[{sasl_error_logger,{file, "/tmp/sasl-1.log"}}]}
>> in my advanced.config, and for just a startup/shutdown cycle I get
>> a 191555 byte file.
>
>
> On Mon, May 16, 2016 at 11:29 AM, Luke Bakken <lbak...@basho.com> wrote:
>
>> Sanket,
>>
>> I can't speak to the output of cluster-info with regard to the precomit
>> hook.
>>
>> If you save an object to the "test_kv" bucket, does
>> rtriggers:pre_all() get called?
>>
>> I have confirmed that precommit hooks are *NOT* triggered for buckets
>> where "write_once" is true, and filed the following docs issue:
>> https://github.com/basho/basho_docs/issues/2076
>>
>> --
>> Luke Bakken
>> Engineer
>> lbak...@basho.com
>>
>>
>> On Mon, May 16, 2016 at 8:20 AM, Sanket Agrawal
>> <sanket.agra...@gmail.com> wrote:
>> > Shouldn't precommit body show up in cluster-info first before we try to
>> test
>> > it with an object? I just set the precommit hook for test_kv bucket type
>> > which has no custom property set. Curl on props shows precommit, but
>> > cluster-info doesn't (took another dump after 5 minutes of precommit
>> hook
>> > creation). No sasl logging is triggered either though the debug mode is
>> on.
>> >
>> > Curl output for test_kv props:
>> >
>> >
>> >>
>> >> $ curl localhost:8098/types/test_kv/props
>> >>
>> >>
>> {"props":{"active":true,"allow_mult":true,"basic_quorum":false,"big_vclock":50,"chash_keyfun":{"mod":"riak_core_util","fun":"chash_std_keyfun"},"claimant":"
>> riak1@127.0.0.1
>> ","dvv_enabled":true,"dw":"quorum","last_write_wins":false,"linkfun":{"mod":"riak_kv_wm_link_walker","fun":"mapreduce_linkfun"},"n_val":3,"notfound_ok":true,"old_vclock":86400,"postcommit":[],"pr":0,"precommit":[{"mod":"rtriggers","fun":"pre_all"}],"pw":0,"r":"quorum","rw":"quorum","small_vclock":50,"w":"quorum","young_vclock":20}}
>> >>
>> >>
>> >
>> >
>> > Cluster-info dump after setting the props - precommit body is still
>> empty in
>> > the cluster-info for test_kv bucket type:
>> >
>> >>
>> >> grep -A15 test_kv cluster_info.txt |grep precommit
>> >>         {precommit,[]},
>> >>         {precommit,[]},
>> >>         {precommit,[]},
>> >>         {precommit,[]},
>> >>         {precommit,[]},
>> >>         {precommit,[]},
>> >>         {precommit,[]},
>> >>         {precommit,[]},
>> >>         {precommit,[]},
>> >>         {precommit,[]},
>> >>         {precommit,[]},
>> >>         {precommit,[]},
>> >
>> >
>> > On Mon, May 16, 2016 at 10:48 AM, Luke Bakken <lbak...@basho.com>
>> wrote:
>> >>
>> >> Hi Sanket,
>> >>
>> >> Thanks for providing that information, this is the first time that the
>> >> "write_once" bucket type property was mentioned.
>> >>
>> >> If you set the precommit hook on a different bucket type where there
>> >> are *no other* custom bucket type properties set, does the precommit
>> >> hook run successfully?
>> >>
>> >> --
>> >> Luke Bakken
>> >> Engineer
>> >> lbak...@basho.com
>> >>
>> >> On Mon, May 16, 2016 at 7:17 AM, Sanket Agrawal
>> >> <sanket.agra...@gmail.com> wrote:
>> >> > Hi Luke,
>> >> >
>> >> > More on the precommit hook debugging I just did - I might have a
>> handle
>> >> > on
>> >> > what the problem is. I took a cluster-info dump for all the nodes in
>> the
>> >> > cluster. In the dump, precommit is set to [] for all the buckets in
>> the
>> >> > cluster. The reason for that seems to be that the bucket type with
>> >> > "write-once" property where precommit hook is set, is not in the
>> cluster
>> >> > somehow!
>> >> >
>> >> > The bucket type name is "test_kv_wo". Let us grep for it in
>> >> > cluster_info.txt
>> >> > - it doesn't show up at all (another bucket type "test_kv" shows up
>> >> > instead):
>> >> >>
>> >> >> $ grep test_kv cluster_info.txt | sort -u
>> >> >>     [[{bucket,&lt;&lt;"test_kv">>}|
>> >> >>         {name,&lt;&lt;"test_kv">>},
>> >> >
>> >> >
>> >> > Now, let us verify we can get the props for the bucket type fine from
>> >> > curl:
>> >> >>
>> >> >> $ curl localhost:8098/types/test_kv_wo/buckets/uuid_log/props:
>> >> >>
>> >> >>
>> >> >>
>> {"props":{"name":"uuid_log","active":true,"allow_mult":true,"basic_quorum":false,"big_vclock":50,"chash_keyfun":{"mod":"riak_core_util","fun":"chash_std_keyfun"},"claimant":"
>> riak1@127.0.0.1
>> ","dvv_enabled":true,"dw":"quorum","last_write_wins":false,"linkfun":{"mod":"riak_kv_wm_link_walker","fun":"mapreduce_linkfun"},"n_val":3,"name":"uuid_log","notfound_ok":true,"old_vclock":86400,"postcommit":[],"pr":0,"precommit":[{"mod":"rtriggers","fun":"pre_uuid"}],"pw":0,"r":"quorum","rw":"quorum","small_vclock":50,"w":"quorum","write_once":true,"young_vclock":20}}
>> >> >
>> >> >
>> >> >
>> >> > So, the problem might be missing bucket types in the cluster since
>> they
>> >> > don't show up in cluster-info at all? The same thing happens with LWW
>> >> > bucket
>> >> > type that I created, test_kv_lww. It doesn't show up either. CRDT
>> bucket
>> >> > types show up fine.
>> >
>> >
>>
>
>
_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to