-
Notifications
You must be signed in to change notification settings - Fork 37
Add TypeDB Cluster support and failover #765
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
Draft
farost
wants to merge
35
commits into
typedb:cluster-support-feature-branch
Choose a base branch
from
farost:cluster-support
base: cluster-support-feature-branch
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Add TypeDB Cluster support and failover #765
farost
wants to merge
35
commits into
typedb:cluster-support-feature-branch
from
farost:cluster-support
Conversation
This file contains hidden or 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
…toring components to use server manager
…ase-related structs and the driver
…nect only to a single target replica
…ade not primary replica errors
farost
commented
Jul 9, 2025
``` | ||
|
||
These pointers are then used for further operations: | ||
```c | ||
char* dbName = "hello"; | ||
Driver *driver = driver_open_core("127.0.0.1:1729"); | ||
Driver *driver = driver_new_core("127.0.0.1:1729"); |
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.
Don't mind this for now
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.
Usage and product changes
Introduce TypeDB Cluster support. Including:
Multiple addresses and address translation
Drivers can be created using a single address, multiple addresses, or address translation (mapping between public user-facing addresses and internal cluster addresses for special needs). Address translation can be updated after the driver is created.
Server and replica statuses
Server version and distribution, as well as the list of active replicas, can be retrieved using TypeDB Driver.
Multiple consistency levels for read requests
Read operations can be executed using one of three strategies:
By default, all operations are executed using the strongest consistency level. However, all read operations now support consistency level specification. Read transactions can be configured through transaction options.
Failover customization
Driver options can be used to configure the failover strategies used with strong and eventual consistency levels.
primary_failover_retries
-- Limits the number of attempts to redirect a strongly consistent request to another primary replica in case of a failure due to the change of replica roles. Defaults to 1.replica_discovery_attempts
-- Limits the number of driver attempts to discover a single working replica to perform an operation in case of a replica unavailability. Every replica is tested once, which means that at most:- {limit} operations are performed if the limit <= the number of replicas.
- {number of replicas} operations are performed if the limit > the number of replicas.
- {number of replicas} operations are performed if the limit is None.
Affects every eventually consistent operation, including redirect failover, when the new primary replica is unknown. Defaults to None.
Implementation
Missing parts:
temp-cluster-server
(instructions below).clustering
integration test, which successfully boots up servers, but there are some missing functionalities of the server that prevent the testing progress. Once the PR referenced below is completed and merged, it can be completed, as well. More BDD tests should be added here Add cluster-specific steps typedb-behaviour#373This driver can be tested using the server from https://github.com/typedb/typedb-cluster/pull/608. To do so, run
cargo build
intypedb-cluster
, and then copy the resulting binary totypedb-driver
like:Then, test scripts like
./tool/test/temp-cluster-server/start-cluster-servers.sh 3
can be used.Note that it is a temporary directory, created to use the server while we are not able to use Cluster snapshots from Bazel.