Skip to content
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

DWH-788: Multi-cluster support #3

Open
wants to merge 4 commits into
base: dap-main
Choose a base branch
from

Conversation

canbekley
Copy link
Collaborator

@canbekley canbekley commented Dec 6, 2024

pr contains

  1. implements creation of remote (distributed) tables by providing a remote_clusters section in the profile target such as following:
clickhouse:
  target: test
  outputs:
    test:
      type: clickhouse
      ...
      remote_clusters:
        - name: cluster02
          database_engine: Replicated('/clickhouse/databases/{uuid}', '{shard}', '{replica}')
        - name: cluster03
  1. fixes current issues with existing database_engine profile target credential

currently work in following cases:

  • when current cluster db engine is Atomic and remote cluster db engine is Atomic
  • when current cluster db engine is Replicated and remote cluster db engine is Atomic

not supported by this mr:

  • remote cluster db engine is Replicated
  • checking existing database engines (if exists, engine is just ignored)

how to test this pr

  1. setup environment as described in CONTRIBUTING.MD
  2. create the following .env file:
DBT_CH_TEST_USE_DOCKER=True
DBT_CH_TEST_CLUSTER_MODE=True
DBT_CH_TEST_CLUSTER=test_shard
DBT_CH_TEST_REMOTE_CLUSTERS=test_remote_cluster
  1. run pytest tests/integration/adapter/remote_clusters/.

@canbekley canbekley marked this pull request as ready for review December 12, 2024 08:06
@Magicbeanbuyer
Copy link
Collaborator

I tried to run the tests locally but they hang for a long time and then all failed...

@canbekley
Copy link
Collaborator Author

@Magicbeanbuyer it is currently failing, because we couldn't figure a clickhouse keeper setup that would allow us to create databases/tables in other clusters. With a common keeper cluster (like we have currently in prod), we run into issues of "table already exists" when trying to create tables with the same name. With a separate keeper cluster (like in this repo test setup), the ON CLUSTER test_remote_cluster ddl's never reach test_remote_cluster, hence get stuck on the initial host.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants