Skip to content

Commit

Permalink
Limit insert dedup info query log length
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillgarbar committed Jun 6, 2024
1 parent 7df0b56 commit 7ce0491
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 5 additions & 1 deletion ch_backup/clickhouse/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,16 @@ def query(
post_data: dict = None,
settings: dict = None,
timeout: float = None,
log_entry_length: int = None,
) -> Any:
"""
Execute query.
"""
try:
logging.debug("Executing query: {}", query)
logging.debug(
"Executing query: {}",
query if not log_entry_length else query[:log_entry_length] + "...",
)

if timeout is None:
timeout = self.timeout
Expand Down
6 changes: 4 additions & 2 deletions ch_backup/clickhouse/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,8 @@ def insert_deduplication_info(self, batch: List[str]) -> None:
system_db=escape(self._backup_config["system_database"]),
table="_deduplication_info",
batch=",".join(batch),
)
),
log_entry_length=150,
)

def get_deduplication_info(
Expand All @@ -959,7 +960,8 @@ def get_deduplication_info(
system_db=escape(self._backup_config["system_database"]),
table="_deduplication_info_current",
batch=",".join(batch),
)
),
log_entry_length=150,
)
result_json = self._ch_client.query(
GET_DEDUPLICATED_PARTS_SQL.format(
Expand Down

0 comments on commit 7ce0491

Please sign in to comment.