Skip to content

Conversation

vladvildanov
Copy link
Collaborator

Pull Request check-list

Please make sure to review and check all of these items:

  • Do tests and lints pass with this change?
  • Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Is there an example added to the examples folder (if applicable)?

NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.

Description of change

Following feature provides a client to communicate with multiple eventually consistent database, whereas one active and N passive databases. Client is able to failover and fallback between databases in seamless way and provides a variety of configuration options depends on client application preferences

vladvildanov and others added 30 commits August 11, 2025 11:12
* 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 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 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 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

* 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
* 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 <[email protected]>

* Update tests/test_asyncio/test_scenario/test_active_active.py

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
* 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
* 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
* 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
* 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
Copy link

jit-ci bot commented Oct 2, 2025

Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset.

In case there are security findings, they will be communicated to you as a comment inside the PR.

Hope you’ll enjoy using Jit.

Questions? Comments? Want to learn more? Get in touch with us.

@vladvildanov vladvildanov added the feature New feature label Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants