Skip to content

Comments

support database migration#297

Merged
aalexfvk merged 13 commits intoyandex:mainfrom
k-morozov:feature/database_migrate
Apr 10, 2025
Merged

support database migration#297
aalexfvk merged 13 commits intoyandex:mainfrom
k-morozov:feature/database_migrate

Conversation

@k-morozov
Copy link
Contributor

No description provided.

@k-morozov k-morozov force-pushed the feature/database_migrate branch 2 times, most recently from e8243c6 to 6c9b645 Compare March 27, 2025 11:57
support migrate cluster
@k-morozov k-morozov force-pushed the feature/database_migrate branch from 6c9b645 to 447b7b4 Compare March 28, 2025 12:26
@k-morozov k-morozov marked this pull request as ready for review March 31, 2025 16:19
@k-morozov k-morozov requested a review from aalexfvk March 31, 2025 16:20
mapping_table_to_metadata: dict,
) -> None:
zk_db_path = f"/clickhouse/{metadata_non_repl_db.database_name}"
first_replica_database_name = zk_db_path + "/first_replica_database_name"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Write a comment what we do in this function. What is purpose of first_replica_database_name node ?

Copy link
Contributor Author

@k-morozov k-morozov Apr 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Write a comment what we do in this function

Done

What is purpose of first_replica_database_name node ?

This is just a node as like replicas or metdata that we have to update. I think we don't need to describe the puroise of nodes: first_replica_database_name, metadata, replicas.

)

if match_str_ch_version(get_version(ctx), "25.1"):
metadata_path = CLICKHOUSE_PATH + "/" + metadata_path
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is specific in 25.1 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metdata path in 25.1 differs from previsous version. it doesn't contain full path.

create_table_query = create_table_query.replace(migrating_database, temp_db)
logging.info("after replacing create_table_query=[{}]", create_table_query)

execute_query(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I'm worried about the order in which the tables are created. They could be dependent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest checking this issue in the next PR.

@k-morozov k-morozov requested a review from aalexfvk April 10, 2025 09:57
@aalexfvk aalexfvk merged commit f901864 into yandex:main Apr 10, 2025
23 checks passed
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