{"action":"closed","number":106,"pull_request":{"state":"closed","created_at":"2011-10-31T19:58:10Z","review_comments":2,"changed_files":10,"_links":{"review_comments":{"href":"https://api.github.com/repos/basho/riak_core/pulls/106/comments"},"comments":{"href":"https://api.github.com/repos/basho/riak_core/issues/106/comments"},"html":{"href":"https://github.com/basho/riak_core/pull/106"},"self":{"href":"https://api.github.com/repos/basho/riak_core/pulls/106"}},"updated_at":"2011-12-13T03:28:10Z","patch_url":"https://github.com/basho/riak_core/pull/106.patch","issue_url":"https://github.com/basho/riak_core/issues/106","user":{"gravatar_id":"5f1086a52e504fa025e138c6924903e1","id":618624,"url":"https://api.github.com/users/jtuple","login":"jtuple","avatar_url":"https://secure.gravatar.com/avatar/5f1086a52e504fa025e138c6924903e1?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"comments":10,"merged":true,"body":"Move vnode spawning and pid tracking logic from riak_core_master to\r\nriak_core_manager. This change sets the stage for future work that will\r\nmake the vnodes more pure, with state transitions coordinated by the\r\nvnode manager. A side-effect is that there is now a central process\r\nmanaging pids for all registered vnode modules, rather than one master\r\nper vnode module.\r\n\r\nAdd registered and supervised vnode proxy processes. Requests can be\r\nsent directly to a vnode proxy process for a desired node/index/module\r\nand the request will be forwarded to the proper vnode. The proxy process\r\ncoordinates with the vnode manager to know the proper pid for routing,\r\nand monitors the vnode pid in order to clean-up on shutdown/crashes. While\r\nvnodes may be spun up and down on demand by the vnode manager, the relevant\r\nproxy processes are always alive and can be counted on for direct routing.\r\n\r\nChange riak_core_vnode_master to use the new vnode proxy support in most\r\ncases. All requests that are routed through a vnode master process will\r\nnow use the proxy logic to dispatch requests. Likewise, the non-sync API\r\nexposed by the vnode master module no longer routes through the master\r\nitself, but directly dispatches requests to the proxy processes. Sync\r\ncommands still route through the master, which then routes through the\r\nproxy in handle_call. A side-effect is that sync commands now require\r\nthree local hops (master, proxy, vnode-pid) rather than two (master,\r\nvnode-pid).\r\n\r\nA few notes. You need to add {legacy_vnode_routing, false} to the riak_core portion of app.config if you want the direct routing (ie. bypassing vnode_master) behavior. This is necessary for rolling upgrade support. With or with the setting, vnode master will always route through the proxies, but the setting determines if non-sync requests are sent directly to a proxy or first through vnode master (the second case being safe for old nodes that have a vnode master but no proxies). \r\n\r\nThe changes effect the underlying vnode behavior of riak_core, so for testing I just went with basho_expect using this branch for stage injection. basho_expect individual node tests seem to pass the same as they do on master (ie. the same tests fail that fail on master for me). The cluster tests are hit or miss. A few failed, but I think it may have been an issue with the stage beam clobbering approach. Re-running with a package containing my changes to test things out.\r\n\r\nI'll likely add an automated integration test that monitors trace messages to determine that requests are proxied as desired. For now, I've manually done similar with redbug (monitoring master, manager, and proxy process handle_calls/casts) and everything looks good.\r\n","deletions":162,"commits":4,"mergeable":null,"id":450017,"base":{"user":{"gravatar_id":"ce5141b78d2fe237e8bfba49d6aff405","id":176293,"url":"https://api.github.com/users/basho","login":"basho","avatar_url":"https://secure.gravatar.com/avatar/ce5141b78d2fe237e8bfba49d6aff405?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png"},"repo":{"created_at":"2010-07-22T14:11:49Z","pushed_at":"2011-12-13T03:28:08Z","clone_url":"https://github.com/basho/riak_core.git","private":false,"updated_at":"2011-12-13T03:28:09Z","watchers":177,"master_branch":null,"name":"riak_core","svn_url":"https://svn.github.com/basho/riak_core","language":"Erlang","forks":47,"owner":{"gravatar_id":"ce5141b78d2fe237e8bfba49d6aff405","id":176293,"url":"https://api.github.com/users/basho","login":"basho","avatar_url":"https://secure.gravatar.com/avatar/ce5141b78d2fe237e8bfba49d6aff405?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png"},"id":790938,"homepage":"","description":"Distributed systems infrastructure used by Riak.","git_url":"git://github.com/basho/riak_core.git","html_url":"https://github.com/basho/riak_core","open_issues":12,"url":"https://api.github.com/repos/basho/riak_core","size":988,"ssh_url":"git@github.com:basho/riak_core.git","fork":false},"sha":"e783b1801ef09ca280b6a66304f340d141d6d812","ref":"master","label":"basho:master"},"number":106,"additions":403,"merged_by":{"gravatar_id":"5f1086a52e504fa025e138c6924903e1","id":618624,"url":"https://api.github.com/users/jtuple","login":"jtuple","avatar_url":"https://secure.gravatar.com/avatar/5f1086a52e504fa025e138c6924903e1?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"head":{"user":{"gravatar_id":"ce5141b78d2fe237e8bfba49d6aff405","id":176293,"url":"https://api.github.com/users/basho","login":"basho","avatar_url":"https://secure.gravatar.com/avatar/ce5141b78d2fe237e8bfba49d6aff405?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png"},"repo":{"created_at":"2010-07-22T14:11:49Z","pushed_at":"2011-12-13T03:28:08Z","clone_url":"https://github.com/basho/riak_core.git","private":false,"updated_at":"2011-12-13T03:28:09Z","watchers":177,"master_branch":null,"name":"riak_core","svn_url":"https://svn.github.com/basho/riak_core","language":"Erlang","forks":47,"owner":{"gravatar_id":"ce5141b78d2fe237e8bfba49d6aff405","id":176293,"url":"https://api.github.com/users/basho","login":"basho","avatar_url":"https://secure.gravatar.com/avatar/ce5141b78d2fe237e8bfba49d6aff405?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png"},"id":790938,"homepage":"","description":"Distributed systems infrastructure used by Riak.","git_url":"git://github.com/basho/riak_core.git","html_url":"https://github.com/basho/riak_core","open_issues":12,"url":"https://api.github.com/repos/basho/riak_core","size":988,"ssh_url":"git@github.com:basho/riak_core.git","fork":false},"sha":"5d1fa1ba3c2ab8ca9f60a45113e7a2ff88bbea8f","ref":"az886-vnode-manager-rewrite","label":"basho:az886-vnode-manager-rewrite"},"title":"Refactor riak_core vnode management (part 1)","closed_at":"2011-12-13T03:28:10Z","html_url":"https://github.com/basho/riak_core/pull/106","diff_url":"https://github.com/basho/riak_core/pull/106.diff","url":"https://api.github.com/repos/basho/riak_core/pulls/106","merged_at":"2011-12-13T03:28:10Z"}}