Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are Riak Post-Commit Hooks run?

I'm trying to evaluate using Riak's Post-Commit Hooks to build a distributed, incremental MapReduce-based index, but was wondering which Riak nodes the Post-Commit Hooks actually run on. Are they run on the nodes the client used to put the commits, or on the primary nodes where the data is persisted? If it's the latter, I'm thinking I can from there efficiently do a map or reduce and put additional records from the output.

like image 508
pixelcort Avatar asked Nov 21 '11 17:11

pixelcort


People also ask

Where do pre-commit hooks go?

All git hooks are stored in the . git/hooks/ directory under your project root. A pre-commit hook is just an executable file stored in this folder with the magic name pre-commit .

What is post-commit hook?

The post-commit hook is called immediately after the commit-msg hook. It can't change the outcome of the git commit operation, so it's used primarily for notification purposes. The script takes no parameters and its exit status does not affect the commit in any way.

How do you run a pre-commit hook?

If you want to manually run all pre-commit hooks on a repository, run pre-commit run --all-files . To run individual hooks use pre-commit run <hook_id> . The first time pre-commit runs on a file it will automatically download, install, and run the hook.

What is post-commit?

Description. The post-commit hook is run after the transaction is committed and a new revision is created. Most people use this hook to send out descriptive emails about the commit or to notify some other tool (such as an issue tracker) that a commit has happened.


1 Answers

From the docs

Post-commit hooks are run after the write has completed successfully.
Specifically,the hook function is called by riak_kv_put_fsm immediately
before the calling process is notified of the successful write 

riak_kv_put_fsm handles "coordination of Riak PUT requests", so the post commit hook is run on the co-ordinator node, i.e. the node that the client sent the put to.

like image 109
sbridges Avatar answered Sep 19 '22 21:09

sbridges