mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-11 17:02:25 +00:00
Merge pull request #41263 from ClickHouse/vdimir/quorum-log-msg-fix
This commit is contained in:
commit
00d0b37cd0
@ -203,11 +203,11 @@ void ReplicatedMergeTreeSink::consume(Chunk chunk)
|
|||||||
}
|
}
|
||||||
|
|
||||||
block_id = temp_part.part->getZeroLevelPartBlockID(block_dedup_token);
|
block_id = temp_part.part->getZeroLevelPartBlockID(block_dedup_token);
|
||||||
LOG_DEBUG(log, "Wrote block with ID '{}', {} rows on {} replicas", block_id, current_block.block.rows(), replicas_num);
|
LOG_DEBUG(log, "Wrote block with ID '{}', {} rows{}", block_id, current_block.block.rows(), quorumLogMessage(replicas_num));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOG_DEBUG(log, "Wrote block with {} rows on {} replicas", current_block.block.rows(), replicas_num);
|
LOG_DEBUG(log, "Wrote block with {} rows{}", current_block.block.rows(), quorumLogMessage(replicas_num));
|
||||||
}
|
}
|
||||||
|
|
||||||
UInt64 elapsed_ns = watch.elapsed();
|
UInt64 elapsed_ns = watch.elapsed();
|
||||||
@ -639,7 +639,7 @@ void ReplicatedMergeTreeSink::waitForQuorum(
|
|||||||
size_t replicas_num) const
|
size_t replicas_num) const
|
||||||
{
|
{
|
||||||
/// We are waiting for quorum to be satisfied.
|
/// We are waiting for quorum to be satisfied.
|
||||||
LOG_TRACE(log, "Waiting for quorum '{}' for part {} on {} replicas", quorum_path, part_name, replicas_num);
|
LOG_TRACE(log, "Waiting for quorum '{}' for part {}{}", quorum_path, part_name, quorumLogMessage(replicas_num));
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -684,6 +684,13 @@ void ReplicatedMergeTreeSink::waitForQuorum(
|
|||||||
LOG_TRACE(log, "Quorum '{}' for part {} satisfied", quorum_path, part_name);
|
LOG_TRACE(log, "Quorum '{}' for part {} satisfied", quorum_path, part_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String ReplicatedMergeTreeSink::quorumLogMessage(size_t replicas_num) const
|
||||||
|
{
|
||||||
|
if (!isQuorumEnabled())
|
||||||
|
return "";
|
||||||
|
return fmt::format(" (quorum {} of {} replicas)", getQuorumSize(replicas_num), replicas_num);
|
||||||
|
}
|
||||||
|
|
||||||
size_t ReplicatedMergeTreeSink::getQuorumSize(size_t replicas_num) const
|
size_t ReplicatedMergeTreeSink::getQuorumSize(size_t replicas_num) const
|
||||||
{
|
{
|
||||||
if (!isQuorumEnabled())
|
if (!isQuorumEnabled())
|
||||||
|
@ -96,6 +96,7 @@ private:
|
|||||||
|
|
||||||
size_t getQuorumSize(size_t replicas_num) const;
|
size_t getQuorumSize(size_t replicas_num) const;
|
||||||
bool isQuorumEnabled() const;
|
bool isQuorumEnabled() const;
|
||||||
|
String quorumLogMessage(size_t replicas_num) const; /// Used in logs for debug purposes
|
||||||
|
|
||||||
size_t quorum_timeout_ms;
|
size_t quorum_timeout_ms;
|
||||||
size_t max_parts_per_block;
|
size_t max_parts_per_block;
|
||||||
|
@ -3649,7 +3649,7 @@ void StorageReplicatedMergeTree::updateQuorum(const String & part_name, bool is_
|
|||||||
if (quorum_entry.replicas.size() >= quorum_entry.required_number_of_replicas)
|
if (quorum_entry.replicas.size() >= quorum_entry.required_number_of_replicas)
|
||||||
{
|
{
|
||||||
/// The quorum is reached. Delete the node, and update information about the last part that was successfully written with quorum.
|
/// The quorum is reached. Delete the node, and update information about the last part that was successfully written with quorum.
|
||||||
LOG_TRACE(log, "Got {} (of {}) replicas confirmed quorum {}, going to remove node",
|
LOG_TRACE(log, "Got {} (of {} required) replicas confirmed quorum {}, going to remove node",
|
||||||
quorum_entry.replicas.size(), quorum_entry.required_number_of_replicas, quorum_status_path);
|
quorum_entry.replicas.size(), quorum_entry.required_number_of_replicas, quorum_status_path);
|
||||||
|
|
||||||
Coordination::Requests ops;
|
Coordination::Requests ops;
|
||||||
|
Loading…
Reference in New Issue
Block a user