From 8da9f150de807e5d8181c32ddd50e7250ffcb1d2 Mon Sep 17 00:00:00 2001 From: alesapin Date: Tue, 9 Feb 2021 11:51:17 +0300 Subject: [PATCH] Fix race in system.parts --- src/Storages/System/StorageSystemParts.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Storages/System/StorageSystemParts.cpp b/src/Storages/System/StorageSystemParts.cpp index bc5a96c6159..45e1663cb93 100644 --- a/src/Storages/System/StorageSystemParts.cpp +++ b/src/Storages/System/StorageSystemParts.cpp @@ -193,8 +193,9 @@ void StorageSystemParts::processNextStorage(MutableColumns & columns_, const Sto add_ttl_info_map(part->ttl_infos.rows_where_ttl); /// _state column should be the latest. + /// Do not use part->getState*, it can be changed from different thread if (has_state_column) - columns_[i++]->insert(part->stateString()); + columns_[i++]->insert(IMergeTreeDataPart::stateToString(part_state)); } }