mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 10:02:01 +00:00
Revert "Prohibit CREATE on static storages (ATTACH should be used instead)"
CREATE is used by Replicated database even for ATTACH, and anyway ATTACH creates format_version.txt as well (without previuos patch). This reverts commit 323f1f320ebe7e588d443abf78efa2c60193e7a9. Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
parent
7ba31bf55c
commit
90ab986be6
@ -115,14 +115,12 @@ StorageMergeTree::StorageMergeTree(
|
||||
, writer(*this)
|
||||
, merger_mutator(*this)
|
||||
{
|
||||
if (!attach && isStaticStorage())
|
||||
throw Exception(ErrorCodes::TABLE_IS_READ_ONLY, "Creating data on static storage is prohibited, use ATTACH instead");
|
||||
|
||||
initializeDirectoriesAndFormatVersion(relative_data_path_, attach, date_column_name);
|
||||
|
||||
|
||||
loadDataParts(has_force_restore_data_flag, std::nullopt);
|
||||
|
||||
if (!attach && !getDataPartsForInternalUsage().empty())
|
||||
if (!attach && !getDataPartsForInternalUsage().empty() && !isStaticStorage())
|
||||
throw Exception(ErrorCodes::INCORRECT_DATA,
|
||||
"Data directory for table already containing data parts - probably "
|
||||
"it was unclean DROP table or manual intervention. "
|
||||
|
@ -338,9 +338,6 @@ StorageReplicatedMergeTree::StorageReplicatedMergeTree(
|
||||
, replicated_fetches_throttler(std::make_shared<Throttler>(getSettings()->max_replicated_fetches_network_bandwidth, getContext()->getReplicatedFetchesThrottler()))
|
||||
, replicated_sends_throttler(std::make_shared<Throttler>(getSettings()->max_replicated_sends_network_bandwidth, getContext()->getReplicatedSendsThrottler()))
|
||||
{
|
||||
if (!attach && isStaticStorage())
|
||||
throw Exception(ErrorCodes::TABLE_IS_READ_ONLY, "Creating data on static storage is prohibited, use ATTACH instead");
|
||||
|
||||
initializeDirectoriesAndFormatVersion(relative_data_path_, attach, date_column_name);
|
||||
/// We create and deactivate all tasks for consistency.
|
||||
/// They all will be scheduled and activated by the restarting thread.
|
||||
|
Loading…
Reference in New Issue
Block a user