Skip to content

Commit 2007eb7

Browse files
Fix bad test 01417_freeze_partition_verbose
1 parent 197719b commit 2007eb7

File tree

6 files changed

+12
-17
lines changed

6 files changed

+12
-17
lines changed

ci/jobs/scripts/check_style/aspell-ignore/en/aspell-dict.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
personal_ws-1.1 en 3238
1+
personal_ws-1.1 en 3238
22
AArch
33
ACLs
44
ALTERs
@@ -1850,7 +1850,6 @@ formatter
18501850
formatters
18511851
fqdn
18521852
frac
1853-
freezed
18541853
frictionless
18551854
fromDaysSinceYearZero
18561855
fromModifiedJulianDay

docs/en/sql-reference/statements/alter/partition.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ For more information about backups and restoring data, see the [Data Backup](/op
233233
ALTER TABLE table_name [ON CLUSTER cluster] UNFREEZE [PARTITION 'part_expr'] WITH NAME 'backup_name'
234234
```
235235

236-
Removes `freezed` partitions with the specified name from the disk. If the `PARTITION` clause is omitted, the query removes the backup of all partitions at once.
236+
Removes `frozen` partitions with the specified name from the disk. If the `PARTITION` clause is omitted, the query removes the backup of all partitions at once.
237237

238238
## CLEAR INDEX IN PARTITION {#clear-index-in-partition}
239239

docs/en/sql-reference/statements/system.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ SYSTEM START MOVES [ON CLUSTER cluster_name] [[db.]merge_tree_family_table_name]
339339
340340
### SYSTEM UNFREEZE {#query_language-system-unfreeze}
341341
342-
Clears freezed backup with the specified name from all the disks. See more about unfreezing separate parts in [ALTER TABLE table_name UNFREEZE WITH NAME ](/sql-reference/statements/alter/partition#unfreeze-partition)
342+
Clears a frozen backup with the specified name from all the disks. See more about unfreezing separate parts in [ALTER TABLE table_name UNFREEZE WITH NAME ](/sql-reference/statements/alter/partition#unfreeze-partition)
343343
344344
```sql
345345
SYSTEM UNFREEZE WITH NAME <backup_name>

src/Storages/Freeze.cpp

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -137,19 +137,17 @@ BlockIO Unfreezer::systemUnfreeze(const String & backup_name)
137137
config_key);
138138
}
139139

140-
auto disks_map = local_context->getDisksMap();
141-
Disks disks;
142-
for (auto & [name, disk]: disks_map)
143-
{
144-
disks.push_back(disk);
145-
}
146140
auto backup_path = fs::path(backup_directory_prefix) / escapeForFileName(backup_name);
147141
auto store_paths = {backup_path / "store", backup_path / "data"};
148142

149143
PartitionCommandsResultInfo result_info;
150144

151-
for (const auto & disk: disks)
145+
auto disks_map = local_context->getDisksMap();
146+
for (auto & [_, disk] : disks_map)
152147
{
148+
if (disk->isReadOnly() || disk->isWriteOnce())
149+
continue;
150+
153151
for (const auto & store_path : store_paths)
154152
{
155153
if (!disk->existsDirectory(store_path))
@@ -164,9 +162,7 @@ BlockIO Unfreezer::systemUnfreeze(const String & backup_name)
164162
auto current_result_info = unfreezePartitionsFromTableDirectory(
165163
[](const String &) { return true; }, backup_name, {disk}, table_directory);
166164
for (auto & command_result : current_result_info)
167-
{
168165
command_result.command_type = "SYSTEM UNFREEZE";
169-
}
170166
result_info.insert(
171167
result_info.end(),
172168
std::make_move_iterator(current_result_info.begin()),
@@ -190,7 +186,7 @@ BlockIO Unfreezer::systemUnfreeze(const String & backup_name)
190186
return result;
191187
}
192188

193-
bool Unfreezer::removeFreezedPart(DiskPtr disk, const String & path, const String & part_name, ContextPtr local_context, zkutil::ZooKeeperPtr zookeeper)
189+
bool Unfreezer::removeFrozenPart(DiskPtr disk, const String & path, const String & part_name, ContextPtr local_context, zkutil::ZooKeeperPtr zookeeper)
194190
{
195191
if (disk->supportZeroCopyReplication())
196192
{
@@ -231,7 +227,7 @@ PartitionCommandsResultInfo Unfreezer::unfreezePartitionsFromTableDirectory(Merg
231227

232228
const auto & path = it->path();
233229

234-
bool keep_shared = removeFreezedPart(disk, path, partition_directory, local_context, zookeeper);
230+
bool keep_shared = removeFrozenPart(disk, path, partition_directory, local_context, zookeeper);
235231

236232
result.push_back(PartitionCommandResultInfo{
237233
.command_type = "UNFREEZE PART",

src/Storages/Freeze.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Unfreezer
4040
zkutil::ZooKeeperPtr zookeeper;
4141
LoggerPtr log = getLogger("Unfreezer");
4242
static constexpr std::string_view backup_directory_prefix = "shadow";
43-
static bool removeFreezedPart(DiskPtr disk, const String & path, const String & part_name, ContextPtr local_context, zkutil::ZooKeeperPtr zookeeper);
43+
static bool removeFrozenPart(DiskPtr disk, const String & path, const String & part_name, ContextPtr local_context, zkutil::ZooKeeperPtr zookeeper);
4444
};
4545

4646
}

src/Storages/MergeTree/MergeTreeData.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,7 @@ class MergeTreeData : public IStorage, public WithMutableContext
11601160
/// Overridden in StorageReplicatedMergeTree
11611161
virtual MutableDataPartPtr tryToFetchIfShared(const IMergeTreeDataPart &, const DiskPtr &, const String &) { return nullptr; }
11621162

1163-
/// Check shared data usage on other replicas for detached/freezed part
1163+
/// Check shared data usage on other replicas for detached/frozen part
11641164
/// Remove local files and remote files if needed
11651165
virtual bool removeDetachedPart(DiskPtr disk, const String & path, const String & part_name);
11661166

0 commit comments

Comments
 (0)