From bf37c3a2687e94f4df3c05eb7ba48ee773dfb767 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mar=C3=ADn?= Date: Mon, 25 Nov 2024 22:17:08 +0100 Subject: [PATCH 1/2] Remove obsolete usage of ABORT_ON_LOGICAL_ERROR --- src/Processors/Transforms/DeduplicationTokenTransforms.cpp | 2 +- src/Processors/Transforms/DeduplicationTokenTransforms.h | 2 +- src/Processors/Transforms/buildPushingToViewsChain.cpp | 6 +++--- src/Storages/MaterializedView/RefreshTask.cpp | 2 +- src/Storages/ObjectStorage/DataLakes/DeltaLakeMetadata.cpp | 2 +- src/Storages/WindowView/StorageWindowView.cpp | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Processors/Transforms/DeduplicationTokenTransforms.cpp b/src/Processors/Transforms/DeduplicationTokenTransforms.cpp index 841090f029e..79b5bb3be4a 100644 --- a/src/Processors/Transforms/DeduplicationTokenTransforms.cpp +++ b/src/Processors/Transforms/DeduplicationTokenTransforms.cpp @@ -142,7 +142,7 @@ size_t TokenInfo::getTotalSize() const return size + parts.size() - 1; } -#ifdef ABORT_ON_LOGICAL_ERROR +#ifdef DEBUG_OR_SANITIZER_BUILD void CheckTokenTransform::transform(Chunk & chunk) { auto token_info = chunk.getChunkInfos().get(); diff --git a/src/Processors/Transforms/DeduplicationTokenTransforms.h b/src/Processors/Transforms/DeduplicationTokenTransforms.h index 7e5a6101734..f22746f6705 100644 --- a/src/Processors/Transforms/DeduplicationTokenTransforms.h +++ b/src/Processors/Transforms/DeduplicationTokenTransforms.h @@ -93,7 +93,7 @@ namespace DeduplicationToken }; -#ifdef ABORT_ON_LOGICAL_ERROR +#ifdef DEBUG_OR_SANITIZER_BUILD /// use that class only with debug builds in CI for introspection class CheckTokenTransform : public ISimpleTransform { diff --git a/src/Processors/Transforms/buildPushingToViewsChain.cpp b/src/Processors/Transforms/buildPushingToViewsChain.cpp index 9d914149b4a..46440a2a953 100644 --- a/src/Processors/Transforms/buildPushingToViewsChain.cpp +++ b/src/Processors/Transforms/buildPushingToViewsChain.cpp @@ -378,7 +378,7 @@ std::optional generateViewChain( table_prefers_large_blocks ? settings[Setting::min_insert_block_size_bytes] : 0ULL)); } -#ifdef ABORT_ON_LOGICAL_ERROR +#ifdef DEBUG_OR_SANITIZER_BUILD out.addSource(std::make_shared("Before squashing", out.getInputHeader())); #endif @@ -424,7 +424,7 @@ std::optional generateViewChain( if (type == QueryViewsLogElement::ViewType::MATERIALIZED) { -#ifdef ABORT_ON_LOGICAL_ERROR +#ifdef DEBUG_OR_SANITIZER_BUILD out.addSource(std::make_shared("Right after Inner query", out.getInputHeader())); #endif @@ -434,7 +434,7 @@ std::optional generateViewChain( out.addSource(std::move(executing_inner_query)); -#ifdef ABORT_ON_LOGICAL_ERROR +#ifdef DEBUG_OR_SANITIZER_BUILD out.addSource(std::make_shared("Right before Inner query", out.getInputHeader())); #endif } diff --git a/src/Storages/MaterializedView/RefreshTask.cpp b/src/Storages/MaterializedView/RefreshTask.cpp index 7aa05ede737..27a2c28f26c 100644 --- a/src/Storages/MaterializedView/RefreshTask.cpp +++ b/src/Storages/MaterializedView/RefreshTask.cpp @@ -364,7 +364,7 @@ void RefreshTask::refreshTask() if (coordination.root_znode.last_attempt_replica == coordination.replica_name) { LOG_ERROR(log, "Znode {} indicates that this replica is running a refresh, but it isn't. Likely a bug.", coordination.path + "/running"); -#ifdef ABORT_ON_LOGICAL_ERROR +#ifdef DEBUG_OR_SANITIZER_BUILD abortOnFailedAssertion("Unexpected refresh lock in keeper"); #else coordination.running_znode_exists = false; diff --git a/src/Storages/ObjectStorage/DataLakes/DeltaLakeMetadata.cpp b/src/Storages/ObjectStorage/DataLakes/DeltaLakeMetadata.cpp index ef0adc15186..a50865994d0 100644 --- a/src/Storages/ObjectStorage/DataLakes/DeltaLakeMetadata.cpp +++ b/src/Storages/ObjectStorage/DataLakes/DeltaLakeMetadata.cpp @@ -209,7 +209,7 @@ struct DeltaLakeMetadataImpl if (!object) throw Exception(ErrorCodes::LOGICAL_ERROR, "Failed to parse metadata file"); -#ifdef ABORT_ON_LOGICAL_ERROR +#ifdef DEBUG_OR_SANITIZER_BUILD std::ostringstream oss; // STYLE_CHECK_ALLOW_STD_STRING_STREAM object->stringify(oss); LOG_TEST(log, "Metadata: {}", oss.str()); diff --git a/src/Storages/WindowView/StorageWindowView.cpp b/src/Storages/WindowView/StorageWindowView.cpp index 0739c03b963..b7b58887a4f 100644 --- a/src/Storages/WindowView/StorageWindowView.cpp +++ b/src/Storages/WindowView/StorageWindowView.cpp @@ -1596,7 +1596,7 @@ void StorageWindowView::writeIntoWindowView( return std::make_shared(stream_header); }); -#ifdef ABORT_ON_LOGICAL_ERROR +#ifdef DEBUG_OR_SANITIZER_BUILD builder.addSimpleTransform([&](const Block & stream_header) { return std::make_shared("StorageWindowView: Afrer tmp table before squashing", stream_header); @@ -1643,7 +1643,7 @@ void StorageWindowView::writeIntoWindowView( lateness_upper_bound); }); -#ifdef ABORT_ON_LOGICAL_ERROR +#ifdef DEBUG_OR_SANITIZER_BUILD builder.addSimpleTransform([&](const Block & stream_header) { return std::make_shared("StorageWindowView: Afrer WatermarkTransform", stream_header); @@ -1668,7 +1668,7 @@ void StorageWindowView::writeIntoWindowView( builder.addSimpleTransform([&](const Block & header_) { return std::make_shared(header_, convert_actions); }); } -#ifdef ABORT_ON_LOGICAL_ERROR +#ifdef DEBUG_OR_SANITIZER_BUILD builder.addSimpleTransform([&](const Block & stream_header) { return std::make_shared("StorageWindowView: Before out", stream_header); From 92a79b750e98d177d9b9327341001a0d72dd7f81 Mon Sep 17 00:00:00 2001 From: Konstantin Bogdanov Date: Wed, 27 Nov 2024 23:50:23 +0100 Subject: [PATCH 2/2] Fix --- src/Storages/MergeTree/FutureMergedMutatedPart.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Storages/MergeTree/FutureMergedMutatedPart.cpp b/src/Storages/MergeTree/FutureMergedMutatedPart.cpp index 959a0e50bca..83919e90569 100644 --- a/src/Storages/MergeTree/FutureMergedMutatedPart.cpp +++ b/src/Storages/MergeTree/FutureMergedMutatedPart.cpp @@ -88,7 +88,8 @@ void FutureMergedMutatedPart::assign(MergeTreeData::DataPartsVector parts_, Merg void FutureMergedMutatedPart::updatePath(const MergeTreeData & storage, const IReservation * reservation) { - path = storage.getFullPathOnDisk(reservation->getDisk()) + name + "/"; + path = fs::path(storage.getFullPathOnDisk(reservation->getDisk())) / name; + path += "/"; } }