Less verbose logging

This commit is contained in:
alesapin 2020-02-13 15:03:30 +03:00
parent 45ebf08925
commit a6938cf5d9
2 changed files with 2 additions and 44 deletions

View File

@ -1756,60 +1756,35 @@ std::optional<std::pair<Int64, int>> ReplicatedMergeTreeMergePredicate::getDesir
/// the part (checked by querying queue.virtual_parts), we can confidently assign a mutation to
/// version X for this part.
LOG_DEBUG(queue.log, "LOOKING for desired mutation version for part:" << part->name);
if (last_quorum_parts.find(part->name) != last_quorum_parts.end()
|| part->name == inprogress_quorum_part)
{
LOG_DEBUG(queue.log, "PART " << part->name <<" NAME NOT IN QUORUM");
return {};
}
std::lock_guard lock(queue.state_mutex);
if (queue.virtual_parts.getContainingPart(part->info) != part->name)
{
LOG_DEBUG(queue.log, "VIRTUAL PARTS HAVE CONTAINING PART " << part->name);
return {};
}
auto in_partition = queue.mutations_by_partition.find(part->info.partition_id);
if (in_partition == queue.mutations_by_partition.end())
{
LOG_DEBUG(queue.log, "NO PARTITION FOR MUTATION FOR PART " << part->name);
return {};
}
Int64 current_version = queue.getCurrentMutationVersionImpl(part->info.partition_id, part->info.getDataVersion(), lock);
Int64 max_version = in_partition->second.rbegin()->first;
if (current_version >= max_version)
{
LOG_DEBUG(queue.log, "PART VERSION FOR " << part->name << " IS BIGGER THAN MAX");
//std::cerr << "But current version is:" << current_version << std::endl;
return {};
}
int alter_version = -1;
//std::cerr << "Looking for alter version for mutation\n";
String version;
for (auto [mutation_version, mutation_status] : in_partition->second)
{
max_version = mutation_version;
if (mutation_version > current_version && mutation_status->entry->alter_version != -1)
{
alter_version = mutation_status->entry->alter_version;
version = mutation_status->entry->znode_name;
break;
}
}
//std::cerr << "FOUND alter version:" << alter_version << " and mutation znode name:" << version << std::endl;
if (current_version >= max_version)
{
LOG_DEBUG(queue.log, "PART VERSION FOR " << part->name << " IS BIGGER THAN MAX AFTER ALTER");
return {};
}
if (current_version >= max_version)
return {};
return std::make_pair(max_version, alter_version);
}

View File

@ -2251,11 +2251,7 @@ BackgroundProcessingPoolTaskResult StorageReplicatedMergeTree::movePartsTask()
void StorageReplicatedMergeTree::mergeSelectingTask()
{
if (!is_leader)
{
LOG_DEBUG(log, "I'm not leader, I don't want to assign anything");
return;
}
LOG_DEBUG(log, "Merge selecting started");
const auto storage_settings_ptr = getSettings();
const bool deduplicate = false; /// TODO: read deduplicate option from table config
@ -2295,7 +2291,6 @@ void StorageReplicatedMergeTree::mergeSelectingTask()
if (max_source_parts_size_for_merge > 0 &&
merger_mutator.selectPartsToMerge(future_merged_part, false, max_source_parts_size_for_merge, merge_pred))
{
LOG_DEBUG(log, "ASSIGNING MERGE");
success = createLogEntryToMergeParts(zookeeper, future_merged_part.parts,
future_merged_part.name, deduplicate, force_ttl);
}
@ -2307,20 +2302,12 @@ void StorageReplicatedMergeTree::mergeSelectingTask()
DataPartsVector data_parts = getDataPartsVector();
for (const auto & part : data_parts)
{
LOG_DEBUG(log, "ASSIGNING MUTATIONS LOOKING AT PART " << part->name);
if (part->bytes_on_disk > max_source_part_size_for_mutation)
continue;
std::optional<std::pair<Int64, int>> desired_mutation_version = merge_pred.getDesiredMutationVersion(part);
if (!desired_mutation_version)
{
LOG_DEBUG(log, "NO Desired version found");
continue;
}
else
{
LOG_DEBUG(log, "Desired mutation version: " << desired_mutation_version->first << " alter version:" << desired_mutation_version->second);
}
if (createLogEntryToMutatePart(*part, desired_mutation_version->first, desired_mutation_version->second))
{
@ -2329,10 +2316,6 @@ void StorageReplicatedMergeTree::mergeSelectingTask()
}
}
}
else
{
LOG_DEBUG(log, "TOO MANY MUTATIONS IN QUEUE");
}
}
}
catch (...)