提交 8fb452e9 编写于 作者: A Alexey Milovidov

Fixed wrong log message when removing temporary part after merge, that is not...

Fixed wrong log message when removing temporary part after merge, that is not byte-identical than same part on replicas; added profile event; added fail-safe logic [#MTRSADMIN-3175].
上级 700d4e09
......@@ -122,6 +122,8 @@
M(DictCacheRequests) \
M(DictCacheLockWriteNs) \
M(DictCacheLockReadNs) \
\
M(DataAfterMergeDiffersFromReplica)
namespace ProfileEvents
......
......@@ -374,6 +374,9 @@ size_t MergeTreeDataPart::getExactSizeRows() const
String MergeTreeDataPart::getFullPath() const
{
if (relative_path.empty())
throw Exception("Part relative_path cannot be empty. This is bug.", ErrorCodes::LOGICAL_ERROR);
return storage.full_path + relative_path + "/";
}
......@@ -431,7 +434,10 @@ size_t MergeTreeDataPart::calcTotalSize(const String & from)
void MergeTreeDataPart::remove() const
{
String from = storage.full_path + name;
if (relative_path.empty())
throw Exception("Part relative_path cannot be empty. This is bug.", ErrorCodes::LOGICAL_ERROR);
String from = storage.full_path + relative_path;
String to = storage.full_path + "tmp_delete_" + name;
Poco::File from_dir{from};
......
......@@ -56,6 +56,7 @@ namespace ProfileEvents
extern const Event ReplicatedPartFetchesOfMerged;
extern const Event ObsoleteReplicatedParts;
extern const Event ReplicatedPartFetches;
extern const Event DataAfterMergeDiffersFromReplica;
}
namespace DB
......@@ -1093,6 +1094,8 @@ bool StorageReplicatedMergeTree::executeLogEntry(const LogEntry & entry)
do_fetch = true;
part->remove();
ProfileEvents::increment(ProfileEvents::DataAfterMergeDiffersFromReplica);
LOG_ERROR(log, getCurrentExceptionMessage(false) << ". "
"Data after merge is not byte-identical to data on another replicas. "
"There could be several reasons: "
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册