I discovered what the behavior change is and it was subtle… Suppose you populated a value in the bucket:
curl -X PUT http://localhost:8098/riak/test/foobar -d '{"foo":"bar"}' In the 0.14.0 release if you did a curl -X DELETE http://localhost:8098/riak/test/foobar you could do: ObjectJSON = riak_object:get_value(Object), O = mochijson2:decode(ObjectJSON), you would get ObjectJSON with the contents of the deleted object: ObjectJSON = <<"{"foo":"bar"}">> O = {struct,[{<<"foo">>,<<"bar">>}]} In 1.2, if you did the same thing, however, you'd get the following: ObjectJSON = <<>> And mochijson2:decode will blow up trying to decode the empty object ** exception error: no match of right hand side value any in function mochijson2:tokenize/2 (src/mochijson2.erl, line 556) in call from mochijson2:decode1/2 (src/mochijson2.erl, line 312) in call from mochijson2:json_decode/2 (src/mochijson2.erl, line 307) So while the documentation is technically true, the behavior on the post-commit hook changed substantially in the case of DELETE. In our hook's case, this change was very significant as we were inspecting the contents of the deleted object to update cache objects in other buckets. It definitely makes life more difficult not knowing the contents of the deleted object :) Dave On Sep 18, 2012, at 1:16 AM, Jon Meredith wrote: > That's odd. It should still be firing. > > Are you seeing any increase in the postcommit_fail stats? It may spew a lot > of logging at you, but you could enable debug logging to see if it is being > fired or not. > > lager:set_loglevel(lager_file_backend, "console.log", debug). > > To reset back to info > > lager:set_loglevel(lager_file_backend, "console.log", info). > > Please let us know what you find. > > Jon. > > On Mon, Sep 17, 2012 at 12:52 PM, David Goehrig <dgoeh...@critical-media.com> > wrote: > Many moons ago (circa 0.14.0) when you did a curl -X DELETE to a riak bucket > with a post commit hook it would be invoked and you could use the > X-Riak-Deleted tag to process the file. I have just such a post commit hook > running on on a 0.14.0 build. > > We recently looked at upgrading to 1.2, but discovered that our post commit > hooks were no longer being fired at all on DELETE, only POST and PUT. > Looking through the offending bits of the code, it looks like the entire hook > invocation subsystem was rewritten since 0.14.0, but the documentation wiki: > http://wiki.basho.com/Commit-Hooks.html#Post-Commit-Hooks > > Still states that: > > As with pre-commit hooks, deletes are considered writes so post-commit hook > functions will need to inspect object metadata for the presence of > X-Riak-Deleted to determine when a delete has occurred. > > Any idea why this would no longer be true? > > Dave > > _______________________________________________ > riak-users mailing list > riak-users@lists.basho.com > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com > > > > > -- > Jon Meredith > Platform Engineering Manager > Basho Technologies, Inc. > jmered...@basho.com >
_______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com