-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
router: introduce router.callbro and callbre
Load-balancing is a common task speaking of cluster-wide tasks. Sometimes it is required to do some heavy read-only operations, for example, with Vinyl, and no one wants to send them all on one instance despite is it a master or the nearest replica. This commit introduces automatic load-balancing by user's request. Router can't balance read-write requests since officially router does not support master-master. Read-only requests can be balanced in two ways: just over the whole replicaset, or over slaves only if at least one is available. Closes #168 @TarantoolBot document Title: [vshard] document router.callbro, callbre, and new router.call option VShard router now supports load-balancing. Only read-only requests can be balanced because VShard officially does not support master-master. It is possible to balance requests over the whole replicaset, or prefer slaves. The load-balancing is a simple round-robin. To balance over the whole replicaset vshard.router.callbro can be used. To prefer slaves vshard.router.callbre works. Callbre balances over slaves only, but if there are no active slaves, then it uses master. Also, a new option is added to the second version of vshard.router.call: balance = boolean. Example: vshard.router.call(bucket_id, {mode = 'read', balance = true, prefer_slaves = true}, func, args, opts)
- Loading branch information
Showing
5 changed files
with
335 additions
and
17 deletions.
There are no files selected for viewing
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
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
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
Oops, something went wrong.