Ignore only ErrnoException/fs::filesystem_error while moving parts to detached

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
Azat Khuzhin 2024-10-08 13:57:44 +02:00
parent 4f6c0c0b54
commit f51050d2c9

View File

@ -2033,7 +2033,23 @@ void IMergeTreeDataPart::renameToDetached(const String & prefix, bool ignore_err
{
renameTo(path_to_detach.value(), true);
}
catch (...)
/// This exceptions majority of cases:
/// - fsync
/// - mtime adjustment
catch (const ErrnoException &)
{
if (ignore_error)
{
// Don't throw when the destination is to the detached folder. It might be able to
// recover in some cases, such as fetching parts into multi-disks while some of the
// disks are broken.
tryLogCurrentException(__PRETTY_FUNCTION__);
}
else
throw;
}
/// - rename
catch (const fs::filesystem_error &)
{
if (ignore_error)
{