-
Notifications
You must be signed in to change notification settings - Fork 1
Cluster mode draft PR #2 #4
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
base: master
Are you sure you want to change the base?
Conversation
Reformated files and sorted imports and static arrays.
…n' to override the Connection's class on_connect function. 2. Replaced CLusterConnection and SSLClusterConnection classes in RedisCluster.on_connect function that would be responsable of establishing readonly connection and setting the connection's parser to ClusterParser. 3. Added support in reading from replicas with Round-Robin load balancing. 4. Added readonly and readwrite commands.
2) Commands class divided into smaller categories
2) Commands class divided into smaller categories
…and 1 replica. Added Makefile target 'test-cluster' to run all the cluster's tests.
2. Fixed bugs related to moved/cluster down error. 2. Added another replica for the cluster's docker env.
docker-entry.sh
Outdated
@@ -15,5 +15,7 @@ if [ "${GITHUB_ACTIONS}" = true ] ; then | |||
fi | |||
|
|||
# use the wait-for-it util to ensure the server is running before invoking Tox | |||
util/wait-for-it.sh ${REDIS_MASTER} -- tox -- --redis-url=redis://"${REDIS_MASTER}"/9 | |||
util/wait-for-it.sh ${REDIS_MASTER} -- tox -- --redis-url=redis://"${REDIS_MASTER}"/${DB} | |||
#util/wait-for-it.sh ${REDIS_MASTER} -- tox -- tests/test_cluster.py::TestRedisClusterObj::test_moved_redirection_after_failover --redis-url=redis://"${REDIS_MASTER}"/${DB} |
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.
For debug purposes, will be deleted.
tests/conftest.py
Outdated
@@ -16,7 +16,7 @@ | |||
|
|||
|
|||
REDIS_INFO = {} | |||
default_redis_url = "redis://localhost:6379/9" | |||
default_redis_url = "redis://localhost:6379/0" |
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.
For debug purposes, will be deleted
@@ -123,6 +127,7 @@ def test_acl_getuser_setuser(self, r, request): | |||
|
|||
def teardown(): | |||
r.acl_deluser(username) | |||
|
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.
I used autopep8 on this file so it was reformatted, I can roll it back to remove all the unrelated changes in future PR.
def test_reset(cluster, sentinel): | ||
cluster.master['is_odown'] = True | ||
assert sentinel.sentinel_reset('mymaster') | ||
def test_discover_master(sentinel, master_ip): |
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.
I moved all tests to be under a class so I could use 'skip_if_cluster_mode' on all together.
…ill cover both strict and cluster redis) and suppressed the user warnings.
closes redis#1539 Part of redis#1546 (cherry picked from commit febede1) cr: https://code.amazon.com/reviews/CR-57987360
…we will execute 'COMMAND GETKEYS' command to get from the server the key positions. if is a pubsub command, we'll use the hardcoded positions. else, we will use the start/last key and step count of 'COMMAND's output.
…h set to True by default. With this changes, RedisCluster creation doesn't need to run cluster_require_full_coverage() by default, which didn't work with clusters without the CONFIG command, and will be called only if require_full_coverage was set to False by the user and the slots are not fully covered.
…er which will be called by RedisCluster function 'on_connect' when connection is getting established
2. Fixed the cluster's response_callbacks to be called only with cluster commands
…CAS, ALL_NODES and RANDOM. It intends to replace executing commands with specifying directly target nodes (for example r.ping(r.get_primaries())), so the nodes will be internally resolved and the client will be able to retry after a topology change.
…ation check for 'cluster-require-full-coverage' if the user requested that the cluster won't require full coverage.
…stead of slot to server_idx. Added debug mode to print the executed command and target node.
…le docker that will create all nodes locally.
Codecov Report
@@ Coverage Diff @@
## master #4 +/- ##
=========================================
Coverage ? 49.10%
=========================================
Files ? 59
Lines ? 13740
Branches ? 0
=========================================
Hits ? 6747
Misses ? 6993
Partials ? 0 Continue to review full report at Codecov.
|
Pull Request check-list
Please make sure to review and check all of these items:
$ tox
pass with this change (including linting)?NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.
Description of change
Please provide a description of the change here.