Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@excitoon
Copy link
Contributor

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

Detailed description / Documentation draft:

Generic volume

By adding documentation, you'll allow users to try your new feature immediately, not when someone else will have time to document it later. Documentation is necessary for all features that affect user experience in any way. You can add brief documentation draft above, or add documentation right into your patch as Markdown files in docs folder.

If you are doing this for the first time, it's recommended to read the lightweight Contributing to ClickHouse Documentation guide first.

Copy link
Member

@alesapin alesapin left a comment

Choose a reason for hiding this comment

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

At least, we need to disable RAID1 for users until it will be ready.

};

using VolumeRAID1Ptr = std::shared_ptr<VolumeRAID1>;
using VolumesRAID1Ptr = std::vector<VolumeRAID1Ptr>;
Copy link
Member

Choose a reason for hiding this comment

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

Not a pointer: VolumesRAID1.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would remove that line completely.


void MultiDiskReservation::update(UInt64 new_size)
{
for (auto &r: reservations)
Copy link
Member

Choose a reason for hiding this comment

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

style

Copy link
Contributor Author

Choose a reason for hiding this comment

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

throw Exception("At least one reservation must be provided to MultiDiskReservation", ErrorCodes::NO_RESERVATIONS_PROVIDED);
}

for (auto &r: reservations)
Copy link
Member

Choose a reason for hiding this comment

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

style

Copy link
Contributor Author

Choose a reason for hiding this comment

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

return res;
}

MultiDiskReservation::MultiDiskReservation(Reservations &reservations_, UInt64 size_)
Copy link
Member

Choose a reason for hiding this comment

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

style

Copy link
Contributor Author

Choose a reason for hiding this comment

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

void Aggregator::writeToTemporaryFile(AggregatedDataVariants & data_variants)
{
return writeToTemporaryFile(data_variants, params.tmp_volume->getNextDisk()->getPath());
return writeToTemporaryFile(data_variants, params.tmp_volume->getDisk()->getPath());
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like a possible bug. @excitoon let's try copy logic from the link and check integration tests (I remember this was part of a test fix)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no such thing as getNextDisk() in IVolume. What shall we do? @NanoBjorn

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did as you advised, but that looks ugly. Can we use some of polymorphism here?

Copy link
Contributor

Choose a reason for hiding this comment

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

I did as you advised, but that looks ugly. Can we use some of polymorphism here?

I thought about it for a long time, this seems the best way, despite the fact it is a bit ugly. So leave it this way:)

for (const DiskPtr & disk : volume->getDisks())
for (const DiskPtr & disk : storage_policy->getDisks())
{
disk->reserve(0);
Copy link
Member

Choose a reason for hiding this comment

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

Why we need it now?

Copy link
Contributor

@NanoBjorn NanoBjorn Jul 27, 2020

Choose a reason for hiding this comment

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

I don't remember making these changes. @excitoon why are you moving back from volume as member class to storage_policy?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would it be better if I use reserve() from volume? @NanoBjorn
This is 1b3f5c9

Copy link
Contributor

Choose a reason for hiding this comment

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

I still don't understand why we needed to move back from volume as member to storage_policy, but maybe it is okay if it works. Why you need reserve here at all? It was fine without it, or not?

{"volume_name", std::make_shared<DataTypeString>()},
{"volume_priority", std::make_shared<DataTypeUInt64>()},
{"disks", std::make_shared<DataTypeArray>(std::make_shared<DataTypeString>())},
{"max_data_part_size", std::make_shared<DataTypeUInt64>()},
Copy link
Member

Choose a reason for hiding this comment

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

Why we lost it?

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess if we want it here then we should move max_data_part_size to IVolume. @alesapin do we want it in IVolume or not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes this is sad. @NanoBjorn

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've taken max_data_part_size back. @alesapin please check.

return std::make_shared<VolumeJBOD>(name, config, config_prefix, disk_selector);
}
String raid_type = config.getString(config_prefix + ".raid_type");
if (raid_type == "RAID 1" || raid_type == "RAID-1" || raid_type == "RAID1")
Copy link
Member

Choose a reason for hiding this comment

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

One more time: It shouldn't be possible to create RAID1 in config.xml. Also, we need to add a comment that it doesn't work yet.

Copy link
Member

Choose a reason for hiding this comment

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

Why do we support ambiguity in the name of RAID-1? Let's stick with only one variant.

Copy link
Contributor

Choose a reason for hiding this comment

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

@excitoon just remove all lines devoted to RAID 1, that was my mistake, we don't need it in this PR

Copy link
Member

Choose a reason for hiding this comment

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

It's been almost 2 years since it was added, and it hadn't been implemented yet.
Maybe it's time to remove it? (#36836)

@alexey-milovidov
Copy link
Member

Docs check — Found 1 errors

Broken by @blinkov

@excitoon excitoon requested a review from alesapin July 30, 2020 01:19
@alesapin alesapin mentioned this pull request Jul 30, 2020
alesapin added a commit that referenced this pull request Jul 31, 2020
@alesapin alesapin merged commit 724b7be into ClickHouse:master Jul 31, 2020

const auto & sharding_key = engine_args.size() >= 4 ? engine_args[3] : nullptr;
const auto & storage_policy = engine_args.size() >= 5 ? engine_args[4]->as<ASTLiteral &>().value.safeGet<String>() : "";
const auto & storage_policy = engine_args.size() >= 5 ? engine_args[4]->as<ASTLiteral &>().value.safeGet<String>() : "default";
Copy link
Member

Choose a reason for hiding this comment

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

Actually this wasn't the "redundant code" (f5af645), now it uses default storage policy even if the 5-th argument is not passed, while previous behavior creates separate volume with just path from config.xml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants