Skip to content

Commit

Permalink
Ignore unknown experimental settings on restore
Browse files Browse the repository at this point in the history
Just in case we're running against an older CH version, ignore an
experimental setting we cannot enable.
  • Loading branch information
dmitry-potepalov committed Oct 9, 2024
1 parent 982de56 commit 7b29af8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions astacus/coordinator/plugins/clickhouse/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ async def execute(self, query: bytes, timeout: float | None = None, session_id:
class ClickHouseClientQueryError(Exception):
# If we have to handle more error types, we might consider adding proper
# rich error types and not display numeric values to the end user.
UNKNOWN_SETTING = 115
SETTING_CONSTRAINT_VIOLATION = 452

def __init__(
Expand Down
4 changes: 2 additions & 2 deletions astacus/coordinator/plugins/clickhouse/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,9 +666,9 @@ def _create_dbs(client: ClickHouseClient) -> Iterator[Awaitable[None]]:
try:
await self.clients[0].execute(query, session_id=session_id)
except ClickHouseClientQueryError as error:
if error.exception_code == error.SETTING_CONSTRAINT_VIOLATION:
if error.exception_code in (error.SETTING_CONSTRAINT_VIOLATION, error.UNKNOWN_SETTING):
# If we can't set the option, that's fine, either it's not needed or it will fail later anyway
pass
logger.info("Could not enable experimental setting, skipped; full error: %s", error)
else:
raise

Expand Down

0 comments on commit 7b29af8

Please sign in to comment.