-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Client side caching refactoring #3350
Merged
Merged
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
Right now the client side caching code is implemented mostly on the level of Connections, which is too low. We need to have a shared cache across several connections. Move the cache implementation higher, while trying to encapsulate it better, into a `CacheMixin` class. This is work in progress, many details still need to be taken care of!
vladvildanov
force-pushed
the
client-side-caching-improvements
branch
from
August 9, 2024 14:06
01d82f5
to
2c50adc
Compare
vladvildanov
force-pushed
the
client-side-caching-improvements
branch
from
August 15, 2024 14:30
edde84c
to
64fb176
Compare
…edis-py into client-side-caching-improvements
…edis-py into client-side-caching-improvements
uglide
reviewed
Sep 27, 2024
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.
See my suggestions in the inline comments.
uglide
approved these changes
Sep 27, 2024
vladvildanov
added a commit
that referenced
this pull request
Sep 27, 2024
* Restructure client side caching code Right now the client side caching code is implemented mostly on the level of Connections, which is too low. We need to have a shared cache across several connections. Move the cache implementation higher, while trying to encapsulate it better, into a `CacheMixin` class. This is work in progress, many details still need to be taken care of! * Temporary refactor * Finished CacheProxyConnection implementation, added comments * Added test cases and scheduler dependency * Added support for RedisCluster and multi-threaded test cases * Added support for BlockingConnectionPool * Fixed docker-compose command * Revert port changes * Initial take on Sentinel support * Remove keys option after usage * Added condition to remove keys entry on async * Added same keys entry removal in pipeline * Added caching support for Sentinel * Added locking when accesing cache object * Rmoved keys option from options * Removed redundant entities * Added cache support for SSLConnection * Moved ssl argument handling to cover cluster case * Revert local test changes * Fixed bug with missing async operator * Revert accidental changes * Added API to return cache object * Added eviction policy configuration * Added mark to skip test on cluster * Removed test case that makes no sense * Skip tests in RESP2 * Added scheduler to dev_requirements * Codestyle changes * Fixed characters per line restriction * Fixed line length * Removed blank lines in imports * Fixed imports codestyle * Added CacheInterface abstraction * Removed redundant references * Moved hardcoded values to constants, restricted dependency versions * Changed defaults to correct values * Added custom background scheduler, added unit testing * Codestyle changes * Updated RESP2 restriction * Cahnged typing to more generic * Restrict pytest-asyncio version to 0.23 * Added upper version limit * Removed usntable multithreaded tests * Removed more flacky multithreaded tests * Fixed issue with Sentinel killing healthcheck thread before execution * Removed cachetools dependency, added custom cache implementation * Updated test cases * Updated typings * Updated types * Revert changes * Removed use_cache, make health_check configurable, removed retry logic around can_read() * Revert test skip * Added documentation and codestyle fixes * Updated excluded wordlist * Added health_check thread cancelling in BlockingPool * Revert argument rename, extended documentation * Updated NodesManager to create shared cache between all nodes * Codestyle fixes * Updated docs * Added version restrictions * Added missing property getter * Updated Redis server version * Skip on long exception message * Removed keys entry as it's csc specific * Updated exception message for CSC * Updated condition by adding server name check * Added test coverage for decoded responses * Codestyle changes * Removed background healthcheck, use connection reference approach instead * Removed unused imports * Fixed broken tests * Codestyle changes * Fixed additional broken tests * Codestyle changes * Increased timer to avoid flackiness * Restrict tests cause of PyPy * Codestyle changes * Updated docs, convert getters function to properties, added dataclasses --------- Co-authored-by: Gabriel Erzse <[email protected]>
vladvildanov
added a commit
that referenced
this pull request
Sep 27, 2024
* Restructure client side caching code Right now the client side caching code is implemented mostly on the level of Connections, which is too low. We need to have a shared cache across several connections. Move the cache implementation higher, while trying to encapsulate it better, into a `CacheMixin` class. This is work in progress, many details still need to be taken care of! * Temporary refactor * Finished CacheProxyConnection implementation, added comments * Added test cases and scheduler dependency * Added support for RedisCluster and multi-threaded test cases * Added support for BlockingConnectionPool * Fixed docker-compose command * Revert port changes * Initial take on Sentinel support * Remove keys option after usage * Added condition to remove keys entry on async * Added same keys entry removal in pipeline * Added caching support for Sentinel * Added locking when accesing cache object * Rmoved keys option from options * Removed redundant entities * Added cache support for SSLConnection * Moved ssl argument handling to cover cluster case * Revert local test changes * Fixed bug with missing async operator * Revert accidental changes * Added API to return cache object * Added eviction policy configuration * Added mark to skip test on cluster * Removed test case that makes no sense * Skip tests in RESP2 * Added scheduler to dev_requirements * Codestyle changes * Fixed characters per line restriction * Fixed line length * Removed blank lines in imports * Fixed imports codestyle * Added CacheInterface abstraction * Removed redundant references * Moved hardcoded values to constants, restricted dependency versions * Changed defaults to correct values * Added custom background scheduler, added unit testing * Codestyle changes * Updated RESP2 restriction * Cahnged typing to more generic * Restrict pytest-asyncio version to 0.23 * Added upper version limit * Removed usntable multithreaded tests * Removed more flacky multithreaded tests * Fixed issue with Sentinel killing healthcheck thread before execution * Removed cachetools dependency, added custom cache implementation * Updated test cases * Updated typings * Updated types * Revert changes * Removed use_cache, make health_check configurable, removed retry logic around can_read() * Revert test skip * Added documentation and codestyle fixes * Updated excluded wordlist * Added health_check thread cancelling in BlockingPool * Revert argument rename, extended documentation * Updated NodesManager to create shared cache between all nodes * Codestyle fixes * Updated docs * Added version restrictions * Added missing property getter * Updated Redis server version * Skip on long exception message * Removed keys entry as it's csc specific * Updated exception message for CSC * Updated condition by adding server name check * Added test coverage for decoded responses * Codestyle changes * Removed background healthcheck, use connection reference approach instead * Removed unused imports * Fixed broken tests * Codestyle changes * Fixed additional broken tests * Codestyle changes * Increased timer to avoid flackiness * Restrict tests cause of PyPy * Codestyle changes * Updated docs, convert getters function to properties, added dataclasses --------- Co-authored-by: Gabriel Erzse <[email protected]>
vladvildanov
added a commit
that referenced
this pull request
Sep 27, 2024
* Restructure client side caching code Right now the client side caching code is implemented mostly on the level of Connections, which is too low. We need to have a shared cache across several connections. Move the cache implementation higher, while trying to encapsulate it better, into a `CacheMixin` class. This is work in progress, many details still need to be taken care of! * Temporary refactor * Finished CacheProxyConnection implementation, added comments * Added test cases and scheduler dependency * Added support for RedisCluster and multi-threaded test cases * Added support for BlockingConnectionPool * Fixed docker-compose command * Revert port changes * Initial take on Sentinel support * Remove keys option after usage * Added condition to remove keys entry on async * Added same keys entry removal in pipeline * Added caching support for Sentinel * Added locking when accesing cache object * Rmoved keys option from options * Removed redundant entities * Added cache support for SSLConnection * Moved ssl argument handling to cover cluster case * Revert local test changes * Fixed bug with missing async operator * Revert accidental changes * Added API to return cache object * Added eviction policy configuration * Added mark to skip test on cluster * Removed test case that makes no sense * Skip tests in RESP2 * Added scheduler to dev_requirements * Codestyle changes * Fixed characters per line restriction * Fixed line length * Removed blank lines in imports * Fixed imports codestyle * Added CacheInterface abstraction * Removed redundant references * Moved hardcoded values to constants, restricted dependency versions * Changed defaults to correct values * Added custom background scheduler, added unit testing * Codestyle changes * Updated RESP2 restriction * Cahnged typing to more generic * Restrict pytest-asyncio version to 0.23 * Added upper version limit * Removed usntable multithreaded tests * Removed more flacky multithreaded tests * Fixed issue with Sentinel killing healthcheck thread before execution * Removed cachetools dependency, added custom cache implementation * Updated test cases * Updated typings * Updated types * Revert changes * Removed use_cache, make health_check configurable, removed retry logic around can_read() * Revert test skip * Added documentation and codestyle fixes * Updated excluded wordlist * Added health_check thread cancelling in BlockingPool * Revert argument rename, extended documentation * Updated NodesManager to create shared cache between all nodes * Codestyle fixes * Updated docs * Added version restrictions * Added missing property getter * Updated Redis server version * Skip on long exception message * Removed keys entry as it's csc specific * Updated exception message for CSC * Updated condition by adding server name check * Added test coverage for decoded responses * Codestyle changes * Removed background healthcheck, use connection reference approach instead * Removed unused imports * Fixed broken tests * Codestyle changes * Fixed additional broken tests * Codestyle changes * Increased timer to avoid flackiness * Restrict tests cause of PyPy * Codestyle changes * Updated docs, convert getters function to properties, added dataclasses --------- Co-authored-by: Gabriel Erzse <[email protected]>
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.
Pull Request check-list
Please make sure to review and check all of these items:
NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.
Description of change
Refactor for existing CSC implementation. The core changes is: