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

Set fixed restore method for table engines and refactor #171

Merged
merged 8 commits into from
Jul 16, 2024

Conversation

MikhailBurdukov
Copy link
Contributor

No description provided.

return self._make_table(result[0])

return None
tables = self.get_tables(db_name, [table_name], short_query)
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add an exception if it is returned > 1

"""
A static method for determining whether an engine is replicated or not.
"""
return Table("", "", engine, [], [], "", "", None).is_replicated()
Copy link
Contributor

Choose a reason for hiding this comment

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

Must be adjusted on every change of Table constructor.
Why not just "MergeTree" in engine and "Replicated" in engine and reuse it in is_replicated()

# Fix https://github.com/ClickHouse/ClickHouse/pull/55540 is pesented since 23.8.
if not maybe_table_short.is_merge_tree():
logging.debug(
'Skiptable "{}.{}" data restore, because it is not MergeTree like.',
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
'Skiptable "{}.{}" data restore, because it is not MergeTree like.',
'Skip table "{}.{}" data restore, because it is not MergeTree family.',

maybe_table_short = context.ch_ctl.get_table(
table_meta.database, table_meta.name, short_query=True
)
assert (
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use if and an exception instead of assert. maybe_table_short can be None, but asserts can be disabled in runtime

ch_backup/clickhouse/control.py Outdated Show resolved Hide resolved
@aalexfvk aalexfvk merged commit 73f7dd8 into main Jul 16, 2024
15 checks passed
@aalexfvk aalexfvk deleted the MDB-27689-deterministic_restore_and_refactoring branch July 16, 2024 18:13
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.

3 participants