-
Notifications
You must be signed in to change notification settings - Fork 38
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
Cabol.122.riak backend config enhancement #124
Merged
elbrujohalcon
merged 4 commits into
master
from
cabol.122.riak_backend_config_enhancement
Mar 12, 2015
Merged
Cabol.122.riak backend config enhancement #124
elbrujohalcon
merged 4 commits into
master
from
cabol.122.riak_backend_config_enhancement
Mar 12, 2015
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…e backend. Also, R/W quorums can be configured now within the store.
… the backend. 1st workaround was modify the 'get_connection' function in the backend to return a new connection. 2nd workaround was add 'checkin' and 'checkout' functions to simulate a simple connection pool in LIFO mode (but is not a real pool), but they still have some problems.
-type r_param() :: r | pr | notfound_ok. | ||
-type w_param() :: w | pw | dw | returnbody. | ||
|
||
-record(state, {backend, conn :: pid(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
backend
is missing its type declaration.
… workaround to 1st approach - when the store invokes , a new Riak connection is returned - one to one model (between connection and store).
@@ -205,12 +237,12 @@ doc_id(Doc) -> | |||
sumo_internal:get_field(IdField, Doc). | |||
|
|||
%% @private | |||
new_doc(Doc, #state{conn = Conn, bucket = Bucket}) -> | |||
new_doc(Doc, #state{conn = Conn, bucket = Bucket, write_quorum = W}) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W
should be Wq
to match the rest of the functions
elbrujohalcon
pushed a commit
that referenced
this pull request
Mar 12, 2015
…ncement Cabol.122.riak backend config enhancement
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Workaround 1:
when the store callsget_connection
, a new Riak connection is returned - one to one model (between connection and store).Workaround 2:
A simple list (LIFO) was added to hold a set of connections that are created in thesumo_backend_riak:init
function. When the store needs a connection, must callsumo_backend_riak:checkout_conn
to get the Pid, and when it finish, must callsumo_backend_riakcheckin_conn
. These operations have some problems, for instance, the don't consider an overflow, so the amount of new connection are not watched, so in case of high concurrency, exist the risk of have so many connection hitting the DB and causing contention.