This commit is contained in:
kssenii 2023-12-08 19:11:47 +01:00
parent 0621b79d1a
commit 23bde28ac4
3 changed files with 7 additions and 7 deletions

View File

@ -677,7 +677,7 @@ void IMergeTreeDataPart::loadColumnsChecksumsIndexes(bool require_columns_checks
if (!parent_part) if (!parent_part)
{ {
loadTTLInfos(); loadTTLInfos();
has_broken_projections = !loadProjections(require_columns_checksums, check_consistency, false /* if_not_loaded */); loadProjections(require_columns_checksums, check_consistency, has_broken_projections, false /* if_not_loaded */);
} }
if (check_consistency && !has_broken_projections) if (check_consistency && !has_broken_projections)
@ -742,10 +742,9 @@ void IMergeTreeDataPart::addProjectionPart(
projection_parts[projection_name] = std::move(projection_part); projection_parts[projection_name] = std::move(projection_part);
} }
bool IMergeTreeDataPart::loadProjections(bool require_columns_checksums, bool check_consistency, bool if_not_loaded) void IMergeTreeDataPart::loadProjections(bool require_columns_checksums, bool check_consistency, bool & has_broken_projection, bool if_not_loaded)
{ {
auto metadata_snapshot = storage.getInMemoryMetadataPtr(); auto metadata_snapshot = storage.getInMemoryMetadataPtr();
bool has_broken_projection = false;
for (const auto & projection : metadata_snapshot->projections) for (const auto & projection : metadata_snapshot->projections)
{ {
auto path = projection.name + ".proj"; auto path = projection.name + ".proj";
@ -782,7 +781,6 @@ bool IMergeTreeDataPart::loadProjections(bool require_columns_checksums, bool ch
} }
} }
} }
return has_broken_projection;
} }
void IMergeTreeDataPart::loadIndexGranularity() void IMergeTreeDataPart::loadIndexGranularity()

View File

@ -434,7 +434,7 @@ public:
bool hasBrokenProjection(const String & projection_name) const; bool hasBrokenProjection(const String & projection_name) const;
/// Return true, if all projections were loaded successfully and none was marked as broken. /// Return true, if all projections were loaded successfully and none was marked as broken.
bool loadProjections(bool require_columns_checksums, bool check_consistency, bool if_not_loaded = false); void loadProjections(bool require_columns_checksums, bool check_consistency, bool & has_broken_projection, bool if_not_loaded = false);
void setBrokenReason(const String & message, int code) const; void setBrokenReason(const String & message, int code) const;

View File

@ -870,7 +870,8 @@ void finalizeMutatedPart(
new_data_part->modification_time = time(nullptr); new_data_part->modification_time = time(nullptr);
/// Load rest projections which are hardlinked /// Load rest projections which are hardlinked
new_data_part->loadProjections(false, false, true /* if_not_loaded */); bool noop;
new_data_part->loadProjections(false, false, noop, true /* if_not_loaded */);
/// All information about sizes is stored in checksums. /// All information about sizes is stored in checksums.
/// It doesn't make sense to touch filesystem for sizes. /// It doesn't make sense to touch filesystem for sizes.
@ -1570,8 +1571,9 @@ private:
void finalize() void finalize()
{ {
bool noop;
ctx->new_data_part->minmax_idx = std::move(ctx->minmax_idx); ctx->new_data_part->minmax_idx = std::move(ctx->minmax_idx);
ctx->new_data_part->loadProjections(false, false, true /* if_not_loaded */); ctx->new_data_part->loadProjections(false, false, noop, true /* if_not_loaded */);
ctx->mutating_executor.reset(); ctx->mutating_executor.reset();
ctx->mutating_pipeline.reset(); ctx->mutating_pipeline.reset();