Skip to content

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
wants to merge 25 commits into
base: cluster-support-feature-branch
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
0f1bdd0
Generalise server management. Add configurable addresses. Start refac…
farost Jun 18, 2025
b567dae
Finished the first dirty version fo the server manager. Updated datab…
farost Jun 19, 2025
42f8217
Finish the first dirty version, it builds
farost Jun 20, 2025
3a4a4a3
Enhance connection error
farost Jun 20, 2025
a4cf6a5
Improve error messages, refactor driver options, add an option to con…
farost Jun 20, 2025
9b3df4c
Introduce consistency levels. Refactor server manager execution. Upgr…
farost Jun 24, 2025
ee03d53
Remove excessive deps. Progress on server manager cleanup and redesign
farost Jun 25, 2025
604e929
Simplified error processing
farost Jun 25, 2025
f51daee
Implement execute_strongly_consistent (it might even work)
farost Jun 25, 2025
d2f1066
Cleanups, expose replica interfaces in Rust
farost Jun 25, 2025
615713f
Provide FFI for the new calls. Add example usages in Java
farost Jun 26, 2025
59547fa
Make methods Send
farost Jun 27, 2025
502543a
Fix bdds in Rust
farost Jun 27, 2025
611bc11
Add new driver options for retries
farost Jun 27, 2025
d670e80
Update refs
farost Jun 30, 2025
86d66a1
Temporarily update test server scripts. Enhance errors. Fix encryptio…
farost Jul 1, 2025
8b9c4de
Introduce cluster bdd tests to Rust with encryption
farost Jul 1, 2025
9a4a448
Refactor address translation
farost Jul 1, 2025
8afa2cd
Refactor the c package. Introduce additional constructors to C and Java
farost Jul 1, 2025
883cfd0
Refactor driver options. Propagated it to Java, not working yet
farost Jul 2, 2025
f98315c
Fix java bbds
farost Jul 2, 2025
57292e1
Propagate new additional structs from Rust to Java
farost Jul 2, 2025
2347a88
Propagate almost everything to Python
farost Jul 2, 2025
8438aa6
Propagate consistency levels to Python, use it more
farost Jul 3, 2025
c70a01f
Update protocol, introduce new calls (rust only), add missing fields …
farost Jul 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 18 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -831,32 +831,32 @@ workflows:
- deploy-snapshot-linux-arm64:
filters:
branches:
only: [development, master, "3.0"]
only: [development, master]

- deploy-snapshot-linux-x86_64:
filters:
branches:
only: [development, master, "3.0"]
only: [development, master]

- deploy-snapshot-mac-arm64:
filters:
branches:
only: [development, master, "3.0"]
only: [development, master]

- deploy-snapshot-mac-x86_64:
filters:
branches:
only: [development, master, "3.0"]
only: [development, master]

- deploy-snapshot-windows-x86_64:
filters:
branches:
only: [development, master, "3.0"]
only: [development, master]

- deploy-snapshot-any:
filters:
branches:
only: [development, master, "3.0"]
only: [development, master]
requires:
- deploy-snapshot-linux-arm64
- deploy-snapshot-linux-x86_64
Expand All @@ -878,7 +878,7 @@ workflows:
- test-snapshot-linux-arm64:
filters:
branches:
only: [master, "3.0"]
only: [master]
requires:
- deploy-snapshot-linux-arm64
- deploy-snapshot-any
Expand All @@ -887,7 +887,7 @@ workflows:
- test-snapshot-linux-x86_64:
filters:
branches:
only: [master, "3.0"]
only: [master]
requires:
- deploy-snapshot-linux-x86_64
- deploy-snapshot-any
Expand All @@ -896,7 +896,7 @@ workflows:
- test-snapshot-mac-arm64:
filters:
branches:
only: [master, "3.0"]
only: [master]
requires:
- deploy-snapshot-mac-arm64
- deploy-snapshot-any
Expand All @@ -905,27 +905,26 @@ workflows:
- test-snapshot-mac-x86_64:
filters:
branches:
only: [master, "3.0"]
only: [master]
requires:
- deploy-snapshot-mac-x86_64
- deploy-snapshot-any
# - deploy-snapshot-dotnet-any

# TODO: Windows typedb artifact is not ready
# - test-snapshot-windows-x86_64:
# filters:
# branches:
# only: [master, "3.0"]
# requires:
# - deploy-snapshot-windows-x86_64
# - deploy-snapshot-any
- test-snapshot-windows-x86_64:
filters:
branches:
only: [master]
requires:
- deploy-snapshot-windows-x86_64
- deploy-snapshot-any
# - deploy-snapshot-dotnet-any

# TODO: npm is not ready
# - test-snapshot-any:
# filters:
# branches:
# only: [master, "3.0"]
# only: [master]
# requires:
# - deploy-snapshot-any

Expand Down
108 changes: 54 additions & 54 deletions .factory/automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ build:
tool/docs/update_readme.sh
git add .
git diff --exit-code || {
echo "Failed to verify README files: plese update it manually and verify the changes"
echo "Failed to verify README files: please update it manually and verify the changes"
exit 1
}

Expand All @@ -111,7 +111,7 @@ build:
if [[ -n "$COMMUNITY_FAILED" ]]; then exit 1; fi

# TODO: Use cluster server artifact with 3 nodes for the same common tests when available
# tool/test/start-cluster-servers.sh 3 &&
# source tool/test/start-cluster-servers.sh 3 &&
# bazel test //rust/tests/integration:all --test_output=streamed --test_arg=--nocapture &&
# export CLUSTER_FAILED= || export CLUSTER_FAILED=1
# tool/test/stop-cluster-servers.sh
Expand All @@ -133,22 +133,22 @@ build:
tool/test/stop-community-server.sh
exit $TEST_SUCCESS

# TODO: Use cluster server artifact with 3 nodes when available (it would do the same thing as community now)
# test-rust-behaviour-cluster:
# image: typedb-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against
# dependencies:
# - build
# command: |
# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME
# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD
# bazel run @typedb_dependencies//tool/bazelinstall:remote_cache_setup.sh
# bazel run @typedb_dependencies//distribution/artifact:create-netrc
#
# tool/test/start-cluster-servers.sh 3 &&
# bazel test //rust/tests/behaviour/... --//rust/tests/behaviour/config:mode=cluster --test_output=streamed --jobs=1 &&
# export TEST_SUCCESS=0 || export TEST_SUCCESS=1
# tool/test/stop-cluster-servers.sh
# exit $TEST_SUCCESS
# TODO: Use cluster server artifact with 3 nodes when available (it currently uses 1)
test-rust-behaviour-cluster:
image: typedb-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against
dependencies:
- build
command: |
export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME
export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD
bazel run @typedb_dependencies//tool/bazelinstall:remote_cache_setup.sh
bazel run @typedb_dependencies//distribution/artifact:create-netrc

source tool/test/start-cluster-servers.sh 1 &&
bazel test //rust/tests/behaviour/... --test_env=ROOT_CA=$ROOT_CA --//rust/tests/behaviour/config:mode=cluster --test_output=streamed --jobs=1 &&
export TEST_SUCCESS=0 || export TEST_SUCCESS=1
tool/test/stop-cluster-servers.sh
exit $TEST_SUCCESS

# test-c-integration:
# image: typedb-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against
Expand Down Expand Up @@ -182,7 +182,7 @@ build:
if [[ -n "$COMMUNITY_FAILED" ]]; then exit 1; fi

# TODO: Use cluster server artifact with 3 nodes for the same common tests when available
# tool/test/start-cluster-servers.sh 3 &&
# source tool/test/start-cluster-servers.sh 3 &&
# bazel test //java/test/integration:all --test_output=streamed --jobs=1 &&
# export CLUSTER_FAILED= || export CLUSTER_FAILED=1
# tool/test/stop-cluster-servers.sh
Expand All @@ -204,22 +204,22 @@ build:
tool/test/stop-community-server.sh
exit $TEST_SUCCESS

# TODO: Use cluster server artifact with 3 nodes when available (it would do the same thing as community now)
# test-java-behaviour-cluster:
# image: typedb-ubuntu-22.04
# dependencies:
# - build
# command: |
# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME
# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD
# bazel run @typedb_dependencies//tool/bazelinstall:remote_cache_setup.sh
# bazel run @typedb_dependencies//distribution/artifact:create-netrc
#
# tool/test/start-cluster-servers.sh 3 &&
# .factory/test-cluster.sh //java/test/behaviour/... --test_output=streamed --jobs=1 &&
# export TEST_SUCCESS=0 || export TEST_SUCCESS=1
# tool/test/stop-cluster-servers.sh
# exit $TEST_SUCCESS
# TODO: Use cluster server artifact with 3 nodes when available (it currently uses 1)
test-java-behaviour-cluster:
image: typedb-ubuntu-22.04
dependencies:
- build
command: |
export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME
export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD
bazel run @typedb_dependencies//tool/bazelinstall:remote_cache_setup.sh
bazel run @typedb_dependencies//distribution/artifact:create-netrc
source tool/test/start-cluster-servers.sh 1 &&
.factory/test-cluster.sh //java/test/behaviour/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 &&
export TEST_SUCCESS=0 || export TEST_SUCCESS=1
tool/test/stop-cluster-servers.sh
exit $TEST_SUCCESS

test-python-integration:
image: typedb-ubuntu-22.04
Expand All @@ -240,7 +240,7 @@ build:
if [[ -n "$COMMUNITY_FAILED" ]]; then exit 1; fi

# TODO: Use cluster server artifact with 3 nodes when available
# tool/test/start-cluster-servers.sh 3 &&
# source tool/test/start-cluster-servers.sh 3 &&
# bazel test //python/tests/integration:all --test_output=streamed --jobs=1 &&
# export CLUSTER_FAILED= || export CLUSTER_FAILED=1
# tool/test/stop-cluster-servers.sh
Expand All @@ -264,24 +264,24 @@ build:
tool/test/stop-community-server.sh
exit $TEST_SUCCESS

# TODO: Use cluster server artifact with 3 nodes when available (it would do the same thing as community now)
# test-python-behaviour-cluster:
# image: typedb-ubuntu-22.04
# dependencies:
# - build
# type: foreground
# command: |
# export PATH="$HOME/.local/bin:$PATH"
# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME
# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD
# bazel run @typedb_dependencies//tool/bazelinstall:remote_cache_setup.sh
# bazel run @typedb_dependencies//distribution/artifact:create-netrc
#
# tool/test/start-cluster-servers.sh 3 &&
# .factory/test-cluster.sh //python/tests/behaviour/... --test_output=streamed --jobs=1 &&
# export TEST_SUCCESS=0 || export TEST_SUCCESS=1
# tool/test/stop-cluster-servers.sh
# exit $TEST_SUCCESS
# TODO: Use cluster server artifact with 3 nodes when available (it currently uses 1)
test-python-behaviour-cluster:
image: typedb-ubuntu-22.04
dependencies:
- build
type: foreground
command: |
export PATH="$HOME/.local/bin:$PATH"
export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME
export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD
bazel run @typedb_dependencies//tool/bazelinstall:remote_cache_setup.sh
bazel run @typedb_dependencies//distribution/artifact:create-netrc
source tool/test/start-cluster-servers.sh 1 &&
.factory/test-cluster.sh //python/tests/behaviour/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 &&
export TEST_SUCCESS=0 || export TEST_SUCCESS=1
tool/test/stop-cluster-servers.sh
exit $TEST_SUCCESS

# test-nodejs-integration:
# image: typedb-ubuntu-22.04
Expand Down
Loading