Commit f3806fa
Multi-database client implementation (#3784)
* MultiDbClient implementation (#3696)
* Added Database, Healthcheck, CircuitBreaker, FailureDetector
* Added DatabaseSelector, exceptions, refactored existing entities
* Added MultiDbConfig
* Added DatabaseConfig
* Added DatabaseConfig test coverage
* Renamed DatabaseSelector into FailoverStrategy
* Added CommandExecutor
* Updated healthcheck to close circuit on success
* Added thread-safeness
* Added missing thread-safeness
* Added missing thread-safenes for dispatcher
* Refactored client to keep databases in WeightedList
* Added database CRUD operations
* Added on-fly configuration
* Added background health checks
* Added background healthcheck + half-open event
* Refactored background scheduling
* Refactored healthchecks
* Removed code repetitions, fixed weight assignment, added loops enhancement, fixed data structure
* Refactored configuration
* Refactored failure detector
* Refactored retry logic
* Added scenario tests
* Added pybreaker optional dependency
* Added pybreaker to dev dependencies
* Rename tests directory
* Remove redundant checks
* Handle retries if default is not set
* Removed all Sentinel related
* Added support for Pipeline and transactions (#3707)
* Added Database, Healthcheck, CircuitBreaker, FailureDetector
* Added DatabaseSelector, exceptions, refactored existing entities
* Added MultiDbConfig
* Added DatabaseConfig
* Added DatabaseConfig test coverage
* Renamed DatabaseSelector into FailoverStrategy
* Added CommandExecutor
* Updated healthcheck to close circuit on success
* Added thread-safeness
* Added missing thread-safeness
* Added missing thread-safenes for dispatcher
* Refactored client to keep databases in WeightedList
* Added database CRUD operations
* Added on-fly configuration
* Added background health checks
* Added background healthcheck + half-open event
* Refactored background scheduling
* Added support for Active-Active pipeline
* Refactored healthchecks
* Added Pipeline testing
* Added support for transactions
* Removed code repetitions, fixed weight assignment, added loops enhancement, fixed data structure
* Added missing doc blocks
* Refactored configuration
* Refactored failure detector
* Refactored retry logic
* Added scenario tests
* Added pybreaker optional dependency
* Added pybreaker to dev dependencies
* Rename tests directory
* Added scenario tests for Pipeline and Transaction
* Added handling of ConnectionRefusedError, added timeouts so cluster could recover
* Increased timeouts
* Refactored integration tests
* Fixed property name
* Removed sentinels
* Removed unused method
* Added support for Pub/Sub mode in MultiDbClient (#3722)
* Added Database, Healthcheck, CircuitBreaker, FailureDetector
* Added DatabaseSelector, exceptions, refactored existing entities
* Added MultiDbConfig
* Added DatabaseConfig
* Added DatabaseConfig test coverage
* Renamed DatabaseSelector into FailoverStrategy
* Added CommandExecutor
* Updated healthcheck to close circuit on success
* Added thread-safeness
* Added missing thread-safeness
* Added missing thread-safenes for dispatcher
* Refactored client to keep databases in WeightedList
* Added database CRUD operations
* Added on-fly configuration
* Added background health checks
* Added background healthcheck + half-open event
* Refactored background scheduling
* Added support for Active-Active pipeline
* Refactored healthchecks
* Added Pipeline testing
* Added support for transactions
* Removed code repetitions, fixed weight assignment, added loops enhancement, fixed data structure
* Added missing doc blocks
* Added support for Pub/Sub in MultiDBClient
* Refactored configuration
* Refactored failure detector
* Refactored retry logic
* Added scenario tests
* Added pybreaker optional dependency
* Added pybreaker to dev dependencies
* Rename tests directory
* Added scenario tests for Pipeline and Transaction
* Added handling of ConnectionRefusedError, added timeouts so cluster could recover
* Increased timeouts
* Refactored integration tests
* Added scenario tests for Pub/Sub
* Updated healthcheck retry
* Increased timeout to avoid unprepared state before tests
* Added backoff retry and changed timeouts
* Added retry for healthchecks to avoid fluctuations
* Changed retry configuration for healthchecks
* Fixed property name
* Added check for thread results
* Refactored docblocks (#3744)
* Refactored healthcheck and failure detector to extend default one (#3747)
* Added MultiDbClient support with OSS Cluster API (#3734)
* Added Database, Healthcheck, CircuitBreaker, FailureDetector
* Added DatabaseSelector, exceptions, refactored existing entities
* Added MultiDbConfig
* Added DatabaseConfig
* Added DatabaseConfig test coverage
* Renamed DatabaseSelector into FailoverStrategy
* Added CommandExecutor
* Updated healthcheck to close circuit on success
* Added thread-safeness
* Added missing thread-safeness
* Added missing thread-safenes for dispatcher
* Refactored client to keep databases in WeightedList
* Added database CRUD operations
* Added on-fly configuration
* Added background health checks
* Added background healthcheck + half-open event
* Refactored background scheduling
* Added support for Active-Active pipeline
* Refactored healthchecks
* Added Pipeline testing
* Added support for transactions
* Removed code repetitions, fixed weight assignment, added loops enhancement, fixed data structure
* Added missing doc blocks
* Added support for Pub/Sub in MultiDBClient
* Refactored configuration
* Refactored failure detector
* Refactored retry logic
* Added scenario tests
* Added pybreaker optional dependency
* Added pybreaker to dev dependencies
* Rename tests directory
* Added scenario tests for Pipeline and Transaction
* Added handling of ConnectionRefusedError, added timeouts so cluster could recover
* Increased timeouts
* Refactored integration tests
* Added scenario tests for Pub/Sub
* Updated healthcheck retry
* Increased timeout to avoid unprepared state before tests
* Added backoff retry and changed timeouts
* Added retry for healthchecks to avoid fluctuations
* Changed retry configuration for healthchecks
* Fixed property name
* Added check for thread results
* Added MultiDbClient support with OSS Cluster API
* Removed database statuses
* Increased test timeouts
* Increased retry timeout
* Increased timeout retries
* Updated base threshold for retries
* Fixed flacky tests
* Added missing docblocks
* Added LagAwareHealthCheck for MultiDBClient (#3737)
* Added LagAwareHealthcheck
* Added testing for LagAwareHealthCheck
* Fixed timeouts
* Added lag tollerance parameter
* Decreased messages_count due to increased timeouts
* Added docblocks
* Added missing type hints
* Fixed url
* Refactored tests, URL and cluster support
* Use primary node to send an API request
* Added comment about RE bug
* Moved None type to the beginning
* Added health_check_url property to Database class
* Added lag_aware_tolerance parameter to LagAwareHealthcheck (#3752)
* Extract additional interfaces and abstract classes (#3754)
* Added async implementation of MultiDBClient (#3762)
* Extract additional interfaces and abstract classes
* Added base async components
* Added command executor
* Added recurring background tasks with event loop only
* Added MultiDBClient
* Added scenario and config tests
* Update redis/asyncio/multidb/healthcheck.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update tests/test_asyncio/test_scenario/test_active_active.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Added pipeline and transaction support for MultiDBClient (#3763)
* Extract additional interfaces and abstract classes
* Added base async components
* Added command executor
* Added recurring background tasks with event loop only
* Added MultiDBClient
* Added scenario and config tests
* Added pipeline and transaction support for MultiDBClient
* Updated scenario tests to check failover
* Added pub/sub support for MultiDBClient (#3764)
* Extract additional interfaces and abstract classes
* Added base async components
* Added command executor
* Added recurring background tasks with event loop only
* Added MultiDBClient
* Added scenario and config tests
* Added pipeline and transaction support for MultiDBClient
* Added pub/sub support for MultiDBClient
* Added check for couroutines methods for pub/sub
* Added support for Lag-Aware Healthcheck and OSS Cluster API (#3768)
* Extract additional interfaces and abstract classes
* Added base async components
* Added command executor
* Added recurring background tasks with event loop only
* Added MultiDBClient
* Added scenario and config tests
* Added pipeline and transaction support for MultiDBClient
* Added pub/sub support for MultiDBClient
* Added check for couroutines methods for pub/sub
* Added OSS Cluster API support for MultiDBCLient
* Added support for Lag-Aware Healthcheck and OSS Cluster API
* Increased timeouts between tests
* Fixed space
* Refactored Healthcheck and Failover strategy logic (#3771)
* Extract additional interfaces and abstract classes
* Added base async components
* Added command executor
* Added recurring background tasks with event loop only
* Added MultiDBClient
* Added scenario and config tests
* Added pipeline and transaction support for MultiDBClient
* Added pub/sub support for MultiDBClient
* Added check for couroutines methods for pub/sub
* Added OSS Cluster API support for MultiDBCLient
* Added support for Lag-Aware Healthcheck and OSS Cluster API
* Increased timeouts between tests
* [Sync] Refactored healthcheck
* [Async] Refactored healthcheck
* [Sync] Refactored Failover Strategy
* [Async] Refactored Failover Strategy
* Changed default values according to a design doc
* [Async] Added Strategy Executor
* [Sync] Added Strategy Executor
* Apply comments
* Removed redundant dependency
* Fixed async tests
* Increased lag-aware tolerance
* Fixed typing issue, increase health_check_interval, added timeout handling
* Decreased retry cap, increased failure delay
* Fixed async teardown
* Fixed tests
* Added graceful connection closing, added graceful hc tasks termination
* Make sure active connection will be disconnected on failover
* Close cluster connection on failover
* Refactored Failure Detector (#3775)
* Decreased timeouts
* Added missing fixture
* Fixed None exception
* Codestyle changes
* Codestyle changes
* Skip async scenario tests
* Codestyle change
* Fixed unused arguments
* Refactored bg scheduler
* Fixed tests
* Fixed tests
* Codestyle fixes
* Reduce timeouts to avoid overlaping with healthcheck
* Marked tests non-clsuter only
* Update timeouts
* Skip scenario tests
* Updated timeouts
* Increased timeout
* Refactored tests
* Codestyle changes
* Added documentation for Active-Active (#3753)
* Added Active-Active documentation page
* Added documentation for Active-Active
* Refactored docs
* Refactored pipeline and transaction section
* Updated docs
* Extended list of words
* Re-write documentation
* Fixed spelling
* Update docs/multi_database.rst
Co-authored-by: Elena Kolevska <elena-kolevska@users.noreply.github.com>
* Apply suggested comments
* Fixed spelling
* Update docs/multi_database.rst
Co-authored-by: Elena Kolevska <elena-kolevska@users.noreply.github.com>
* Update docs/multi_database.rst
Co-authored-by: Elena Kolevska <elena-kolevska@users.noreply.github.com>
* Update docs/multi_database.rst
Co-authored-by: Elena Kolevska <elena-kolevska@users.noreply.github.com>
---------
Co-authored-by: Elena Kolevska <elena-kolevska@users.noreply.github.com>
* Refactor unstable tests
* Marked tests as non-clustered
* Codestyle changes
* Skipped tests in validating workflow
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: petyaslavova <petya.slavova@redis.com>
Co-authored-by: Elena Kolevska <elena-kolevska@users.noreply.github.com>1 parent 3471e08 commit f3806fa
File tree
72 files changed
+11689
-26
lines changed- .github
- workflows
- docs
- redis
- asyncio
- http
- multidb
- http
- multidb
- tests
- test_asyncio
- test_multidb
- test_scenario
- test_http
- test_multidb
- test_scenario
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
72 files changed
+11689
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| 15 | + | |
13 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
14 | 20 | | |
15 | 21 | | |
| 22 | + | |
| 23 | + | |
16 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
17 | 29 | | |
18 | 30 | | |
19 | 31 | | |
20 | 32 | | |
21 | 33 | | |
22 | 34 | | |
23 | 35 | | |
| 36 | + | |
| 37 | + | |
24 | 38 | | |
25 | 39 | | |
| 40 | + | |
26 | 41 | | |
27 | 42 | | |
28 | 43 | | |
| |||
43 | 58 | | |
44 | 59 | | |
45 | 60 | | |
| 61 | + | |
46 | 62 | | |
47 | 63 | | |
48 | 64 | | |
| |||
52 | 68 | | |
53 | 69 | | |
54 | 70 | | |
| 71 | + | |
| 72 | + | |
55 | 73 | | |
56 | 74 | | |
57 | 75 | | |
| |||
91 | 109 | | |
92 | 110 | | |
93 | 111 | | |
| 112 | + | |
94 | 113 | | |
95 | 114 | | |
96 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
0 commit comments