Skip to content

Separate data storage abstraction for MergeTree#36555

Merged
KochetovNicolai merged 41 commits intomasterfrom
refactor-something-in-part-volumes
Jun 22, 2022
Merged

Separate data storage abstraction for MergeTree#36555
KochetovNicolai merged 41 commits intomasterfrom
refactor-something-in-part-volumes

Conversation

@KochetovNicolai
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
private:

}

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

Choose a reason for hiding this comment

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

remove?

String file_name = it.first;

String path = fs::path(part->getFullRelativePath()) / file_name;
//String path = fs::path(part->getRelativePath()) / file_name;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove?

= MutationsInterpreter::MutationKind::MutationKindEnum::MUTATE_UNKNOWN;

VolumePtr single_disk_volume;
//VolumePtr single_disk_volume;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove

{
checkConsistencyBase();
String path = getFullRelativePath();
// String path = getRelativePath();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove

{
auto disk = part->volume->getDisk();
String part_path = part->getFullRelativePath();
//auto disk = part->volume->getDisk();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove


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
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove

continue;

String destination = ctx->new_part_tmp_path;
String destination; // = ctx->new_part_tmp_path;
Copy link
Copy Markdown
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
Copy Markdown
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.

5 participants