Merge pull request #4683 from amosbird/fixempty

Do not wait when there is not log entry.
This commit is contained in:
alexey-milovidov 2019-03-14 04:16:02 +03:00 committed by GitHub
commit 1cd7c91404
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3080,7 +3080,8 @@ bool StorageReplicatedMergeTree::optimize(const ASTPtr & query, const ASTPtr & p
}
/// TODO: Bad setting name for such purpose
if (query_context.getSettingsRef().replication_alter_partitions_sync != 0)
if (merge_entry.type != ReplicatedMergeTreeLogEntryData::Type::EMPTY
&& query_context.getSettingsRef().replication_alter_partitions_sync != 0)
waitForAllReplicasToProcessLogEntry(merge_entry);
return true;