mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-04 13:32:13 +00:00
mark piece as done if it is not present
This commit is contained in:
parent
03dfc32701
commit
0df165578b
@ -1065,6 +1065,26 @@ PartitionTaskStatus ClusterCopier::processPartitionPieceTaskImpl(
|
|||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// Exit if current piece is absent on this shard. Also mark it as finished, because we will check
|
||||||
|
/// whether each shard have processed each partitition (and its pieces).
|
||||||
|
if (partition_piece.is_absent_piece)
|
||||||
|
{
|
||||||
|
std::cout << "current partition piece is clean?? " << is_clean << std::endl;
|
||||||
|
std::cout << "######" << "Partition " << task_partition.name
|
||||||
|
<< " piece " + toString(current_piece_number) + " IS ABSENT ON CURRENT SHARD" << std::endl;
|
||||||
|
std::cout << "current_task_piece_status_path " << current_task_piece_status_path << std::endl;
|
||||||
|
String state_finished = TaskStateWithOwner::getData(TaskState::Finished, host_id);
|
||||||
|
auto res = zookeeper->tryCreate(current_task_piece_status_path, state_finished, zkutil::CreateMode::Persistent);
|
||||||
|
if (res == Coordination::ZNODEEXISTS)
|
||||||
|
LOG_DEBUG(log, "Partition " << task_partition.name << " piece "
|
||||||
|
+ toString(current_piece_number) + " is absent on current replica of a shard. But other replica has already marked it as done.");
|
||||||
|
if (res == Coordination::ZOK)
|
||||||
|
LOG_DEBUG(log, "Partition " << task_partition.name << " piece "
|
||||||
|
+ toString(current_piece_number) + " is absent on current replica of a shard. Will mark it as done. Other replicas will do the same.");
|
||||||
|
return PartitionTaskStatus::Finished;
|
||||||
|
}
|
||||||
|
|
||||||
/// Exit if task has been already processed;
|
/// Exit if task has been already processed;
|
||||||
/// create blocking node to signal cleaning up if it is abandoned
|
/// create blocking node to signal cleaning up if it is abandoned
|
||||||
{
|
{
|
||||||
@ -1376,8 +1396,6 @@ PartitionTaskStatus ClusterCopier::processPartitionPieceTaskImpl(
|
|||||||
|
|
||||||
/// TODO: LOG_INFO (Piece copied and moved to destination table)
|
/// TODO: LOG_INFO (Piece copied and moved to destination table)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return PartitionTaskStatus::Finished;
|
return PartitionTaskStatus::Finished;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user