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

Background Manager Integration with Handoff #484

Merged
merged 7 commits into from Dec 20, 2013

Commits on Dec 20, 2013

  1. Add a background lock and task manager module to riak core.

    * The goal is to allow riak sub-systems to coordinate use of shared resources,
    * e.g. protect from concurrent vnode folds on the same partition.
    * Locks and tokens have a settable maximum concurrency limit.
    * "Taken" locks and tokens are tracked in an ETS table.
    * max_concurrency is returned when the set limits are reached.
    * Processes that take locks are monitored.
    * Locks are released when the taking processes terminate.
    * Tokens are refreshed at a specified periodic rate.
    * Token processes are not monitored because tokens never "release".
    * A table manager is introduced to add persistence across process crashes,
    * and to allow proper table transfer to occur without losing the table.
    * An EQC test exercises the majority of the API. see test/bg_manager_eqc.erl
    * See the original PR for background manager here: #364
    buddhisthead committed Dec 20, 2013
    Configuration menu
    Copy the full SHA
    779273b View commit details
    Browse the repository at this point in the history
  2. Concurrency API should return 'undefined' for limits when the ETS tab…

    …le is unavailable * Allows callers to try again later
    buddhisthead committed Dec 20, 2013
    Configuration menu
    Copy the full SHA
    f29014b View commit details
    Browse the repository at this point in the history
  3. Clean up query API

    * Remove history API, use unregistered to signal unavailability of bg-mgr, fix set_token_rate bug.
    * Prune the query API down to a consistent set of commands and adjust tests.
    * Change query API to use named ETS table directly; is not threaded through the gen_server.
    buddhisthead committed Dec 20, 2013
    Configuration menu
    Copy the full SHA
    4eead17 View commit details
    Browse the repository at this point in the history
  4. Re-implement handoff integration.

    * rebase on latest background manager.
    * Add an optional callback entry point to the kv vnode: handoff_started/2
    * core_vnode will check for the optional function and call if present
    * returning max_concurrency will cause the handoff to be aborted and retried.
    buddhisthead committed Dec 20, 2013
    Configuration menu
    Copy the full SHA
    23f9464 View commit details
    Browse the repository at this point in the history
  5. Address remaining issues in PR

    * Remove lock defs file; it was moved to riak_kv_vnode.hrl since all these locks are KV-specific
    * The optional call to handoff_started/2 allows vnodes one last chance to abort the handoff process. the function is passed the source vnode's partition number and node name (this node) because the callback does not have access to the full vnode state at this time. In addition the worker pid is passed so the vnode may use that information in its decision to cancel the handoff or not (e.g. get a lock on behalf of the process)
    * Move code that calls handooff_started/2 into separate function and put the call inside the try/catch.
    buddhisthead committed Dec 20, 2013
    Configuration menu
    Copy the full SHA
    ae6b3f8 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    66a4f65 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    c770a72 View commit details
    Browse the repository at this point in the history