Skip to content
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

Merged
merged 41 commits into from
Jun 22, 2022

Conversation

KochetovNicolai
Copy link
Member

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

.

ErrorCodes::LOGICAL_ERROR);
throw Exception(
ErrorCodes::LOGICAL_ERROR,
"Attempt to store uninitialized MinMax index for part {}. This is a bug.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailing period.

@robot-ch-test-poll robot-ch-test-poll added the pr-not-for-changelog This PR should not be mentioned in the changelog label Apr 26, 2022
@KochetovNicolai KochetovNicolai marked this pull request as ready for review June 20, 2022 18:18
@alesapin alesapin self-assigned this Jun 21, 2022
class TemporaryFileOnDisk;

/// This is an abstraction of storage for data part files.
/// Generally, it contains read-only methods from IDisk.
Copy link
Member

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'
Copy link
Member

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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private:

@@ -268,7 +268,7 @@ MergeTreeData::DataPart::Checksums Service::sendPartFromDisk(
checksums.files[file_name] = {};
}

auto disk = part->volume->getDisk();
//auto disk = part->volume->getDisk();
Copy link
Member

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;
Copy link
Member

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;
Copy link
Member

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();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

@@ -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();
Copy link
Member

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();
Copy link
Member

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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
String destination; // = ctx->new_part_tmp_path;
String destination;

@alesapin alesapin changed the title Refactor something in part volumes Separate data storage abstraction for MergeTree Jun 21, 2022
@KochetovNicolai KochetovNicolai merged commit cc6fdfe into master Jun 22, 2022
@KochetovNicolai KochetovNicolai deleted the refactor-something-in-part-volumes branch June 22, 2022 09:13
alesapin added a commit that referenced this pull request Jun 27, 2022
…in-part-volumes"

This reverts commit cc6fdfe, reversing
changes made to da578ec.
{
if (relative_path.empty())
throw Exception("Part relative_path cannot be empty. It's bug.", ErrorCodes::LOGICAL_ERROR);
// String IMergeTreeDataPart::getFullPath() const
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove commented code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-not-for-changelog This PR should not be mentioned in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants