Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for strongly consistent Riak #441

Merged
merged 6 commits into from
Oct 26, 2013
Merged

Support for strongly consistent Riak #441

merged 6 commits into from
Oct 26, 2013

Conversation

jtuple
Copy link
Contributor

@jtuple jtuple commented Oct 24, 2013

This is the riak_core related pull-request for on-going work to add strong consistency to Riak.

First, this pull-request integrates Riak with riak_ensemble, pulling in riak_ensemble as an included-app dependency, hooking up riak_ensemble_sup into the riak_core_sup, and bootstrapping the root ensemble (root consensus group).

Second, this pull-request fixes some issues/extends the handoff/forwarding API exposed by riak_core_vnode to implementing vnode modules. This is needed in riak_kv to properly extend riak_kv_vnode for strong consistency.

See commit messages for more details.

Note: The riak_ensemble subsystem is disabled by default. Changing enable_consensus to true in top-level riak.conf or by defining the riak_core/enable_consensus environment variable is necessary for this system to be activated on start-up. When disabled, most of the code in this pull-request is intentionally not executed.

Sibling pull-requests: basho/riak_kv#710, basho/riak_ensemble#1

Fix issue where handoff_cancelled was not called on vnode modules
if handoff failed to start due to concurrency limit.

Add new optional set_vnode_forwarding callback that vnode modules
can implement to track riak_core's implicit forwarding behavior
that occurs between a primary handoff finishing and actual ownership
being changed.

All of the above changes are necessary for riak_kv_vnode to properly
support strongly consistent operations during handoff and ownership
transitions.
Conflicts:
	rebar.config
	src/riak_core.app.src
	src/riak_core_bucket.erl
	src/riak_core_claimant.erl
	src/riak_core_sup.erl
	src/riak_core_vnode.erl
RingID ->
{ok, Ring} = riak_core_ring_manager:get_raw_ring(),
maybe_bootstrap_root_ensemble(Ring),
maybe_force_ring_update(Ring),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jtuple this caught my attention because we no longer run maybe_force_ring_update in some cases. From my reading, these cases would always result in maybe_force_ring_update doing nothing, so its safe and one case I know hits this code path, ring resizing on a single node, acts the same w/ or w/o this change. Just wanted to double check.

@jrwest
Copy link
Contributor

jrwest commented Oct 25, 2013

Focused on the 3 areas that have changed when consensus_enabled =false (claimant tick, core_vnode, and core_sup). Made one comment but its a question for @jtuple that I think will result in no changes. make test passes and I've run several different riak tests, including verify_dynamic_ring & verify_build_cluster which cover the changed code paths. To run the tests I was using jdb-strong-2.0 in kv and jdb-wip-2.0 in ensemble but I have not looked at the code in those two branches.

+1 re: consensus_enabled=false

@jtuple
Copy link
Contributor Author

jtuple commented Oct 26, 2013

As discussed internally, going ahead and merging with the understanding that strong consistency and the consensus subsystem are disabled by default. Likewise, updated rebar.config to point directly to the work-in-progress feature branch of riak_ensemble that has not yet been fully/reviewed and merged. This is sufficient to build our upcoming tech preview.

A full review of basho/riak_ensemble#1 is forth coming, and will involve a more detailed review of the code paths in this PR that are hit when the consensus system is enabled.

jtuple added a commit that referenced this pull request Oct 26, 2013
@jtuple jtuple merged commit 19aeaba into develop Oct 26, 2013
@seancribbs seancribbs deleted the jdb-strong-2.0 branch April 1, 2015 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants