mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 09:02:00 +00:00
"Atomically" remove parts on destroy.
This commit is contained in:
parent
4363ce6976
commit
3f11569d94
@ -345,6 +345,10 @@ MergeTreeDataPart::~MergeTreeDataPart()
|
||||
}
|
||||
}
|
||||
|
||||
/// "Atomically" remove directory, leaving no inconsistent state.
|
||||
Poco::Path source_path(path);
|
||||
Poco::Path destination_path(path, "../stale_" + source_path.getBaseName());
|
||||
dir.renameTo(destination_path.toString());
|
||||
dir.remove(true);
|
||||
|
||||
if (state == State::DeleteOnDestroy)
|
||||
|
Loading…
Reference in New Issue
Block a user