-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Separate data storage abstraction for MergeTree #36555
Conversation
ErrorCodes::LOGICAL_ERROR); | ||
throw Exception( | ||
ErrorCodes::LOGICAL_ERROR, | ||
"Attempt to store uninitialized MinMax index for part {}. This is a bug.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trailing period.
class TemporaryFileOnDisk; | ||
|
||
/// This is an abstraction of storage for data part files. | ||
/// Generally, it contains read-only methods from IDisk. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
outdated comment? I see a lot of write methods...
virtual ~IDataPartStorage() = default; | ||
|
||
/// Methods to get path components of a data part. | ||
virtual std::string getFullPath() const = 0; /// '/var/lib/clickhouse/data/database/table/moving/all_1_5_1' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 for example in comment.
/// Generally, it contains read-only methods from IDisk. | ||
class IDataPartStorage | ||
{ | ||
private: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private: |
@@ -268,7 +268,7 @@ MergeTreeData::DataPart::Checksums Service::sendPartFromDisk( | |||
checksums.files[file_name] = {}; | |||
} | |||
|
|||
auto disk = part->volume->getDisk(); | |||
//auto disk = part->volume->getDisk(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove?
@@ -294,22 +294,26 @@ MergeTreeData::DataPart::Checksums Service::sendPartFromDisk( | |||
{ | |||
String file_name = it.first; | |||
|
|||
String path = fs::path(part->getFullRelativePath()) / file_name; | |||
//String path = fs::path(part->getRelativePath()) / file_name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove?
@@ -653,10 +654,11 @@ struct MutationContext | |||
MutationsInterpreter::MutationKind::MutationKindEnum mutation_kind | |||
= MutationsInterpreter::MutationKind::MutationKindEnum::MUTATE_UNKNOWN; | |||
|
|||
VolumePtr single_disk_volume; | |||
//VolumePtr single_disk_volume; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
@@ -137,7 +139,7 @@ bool MergeTreeDataPartCompact::hasColumnFiles(const NameAndTypePair & column) co | |||
void MergeTreeDataPartCompact::checkConsistency(bool require_part_metadata) const | |||
{ | |||
checkConsistencyBase(); | |||
String path = getFullRelativePath(); | |||
// String path = getRelativePath(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
src/Storages/StorageMergeTree.cpp
Outdated
@@ -1739,29 +1739,25 @@ CheckResults StorageMergeTree::checkData(const ASTPtr & query, ContextPtr local_ | |||
|
|||
for (auto & part : data_parts) | |||
{ | |||
auto disk = part->volume->getDisk(); | |||
String part_path = part->getFullRelativePath(); | |||
//auto disk = part->volume->getDisk(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
@@ -1479,8 +1497,8 @@ bool MutateTask::prepare() | |||
ctx->new_data_part->setSerializationInfos(new_infos); | |||
ctx->new_data_part->partition.assign(ctx->source_part->partition); | |||
|
|||
ctx->disk = ctx->new_data_part->volume->getDisk(); | |||
ctx->new_part_tmp_path = ctx->new_data_part->getFullRelativePath(); | |||
// ctx->disk = ctx->new_data_part->volume->getDisk(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
{ | ||
if (ctx->files_to_skip.contains(it->name())) | ||
continue; | ||
|
||
String destination = ctx->new_part_tmp_path; | ||
String destination; // = ctx->new_part_tmp_path; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String destination; // = ctx->new_part_tmp_path; | |
String destination; |
{ | ||
if (relative_path.empty()) | ||
throw Exception("Part relative_path cannot be empty. It's bug.", ErrorCodes::LOGICAL_ERROR); | ||
// String IMergeTreeDataPart::getFullPath() const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove commented code
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
.