Skip to content

Commit

Permalink
Merge pull request #20240 from ClickHouse/backport/20.12/19743
Browse files Browse the repository at this point in the history
Backport #19743 to 20.12: Drop helping tables when the whole table is done in clickhouse-copier
  • Loading branch information
nikitamikhaylov authored Feb 10, 2021
2 parents b2207b1 + 9ad2b18 commit b6d52f6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions programs/copier/ClusterCopier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,6 @@ void ClusterCopier::process(const ConnectionTimeouts & timeouts)
}
}

/// Delete helping tables in both cases (whole table is done or not)
dropHelpingTables(task_table);

if (!table_is_done)
{
throw Exception("Too many tries to process table " + task_table.table_id + ". Abort remaining execution",
Expand Down Expand Up @@ -1040,6 +1037,11 @@ bool ClusterCopier::tryProcessTable(const ConnectionTimeouts & timeouts, TaskTab
{
LOG_INFO(log, "Table {} is not processed yet.Copied {} of {}, will retry", task_table.table_id, finished_partitions, required_partitions);
}
else
{
/// Delete helping tables in case that whole table is done
dropHelpingTables(task_table);
}

return table_is_done;
}
Expand Down

0 comments on commit b6d52f6

Please sign in to comment.