@@ -35,11 +35,13 @@ namespace ErrorCodes
3535 extern const int CANNOT_ALLOCATE_MEMORY;
3636 extern const int CANNOT_MUNMAP;
3737 extern const int CANNOT_MREMAP;
38+ extern const int CANNOT_SCHEDULE_TASK;
3839 extern const int UNEXPECTED_FILE_IN_DATA_PART;
3940 extern const int NO_FILE_IN_DATA_PART;
4041 extern const int NETWORK_ERROR;
4142 extern const int SOCKET_TIMEOUT;
4243 extern const int BROKEN_PROJECTION;
44+ extern const int ABORTED;
4345}
4446
4547
@@ -84,7 +86,9 @@ bool isRetryableException(std::exception_ptr exception_ptr)
8486 {
8587 return isNotEnoughMemoryErrorCode (e.code ())
8688 || e.code () == ErrorCodes::NETWORK_ERROR
87- || e.code () == ErrorCodes::SOCKET_TIMEOUT;
89+ || e.code () == ErrorCodes::SOCKET_TIMEOUT
90+ || e.code () == ErrorCodes::CANNOT_SCHEDULE_TASK
91+ || e.code () == ErrorCodes::ABORTED;
8892 }
8993 catch (const Poco::Net::NetException &)
9094 {
@@ -328,16 +332,21 @@ static IMergeTreeDataPart::Checksums checkDataPart(
328332 projections_on_disk.erase (projection_file);
329333 }
330334
331- if (throw_on_broken_projection && !broken_projections_message. empty () )
335+ if (throw_on_broken_projection)
332336 {
333- throw Exception (ErrorCodes::BROKEN_PROJECTION, " {}" , broken_projections_message);
334- }
337+ if (!broken_projections_message.empty ())
338+ {
339+ throw Exception (ErrorCodes::BROKEN_PROJECTION, " {}" , broken_projections_message);
340+ }
335341
336- if (require_checksums && !projections_on_disk.empty ())
337- {
338- throw Exception (ErrorCodes::UNEXPECTED_FILE_IN_DATA_PART,
339- " Found unexpected projection directories: {}" ,
340- fmt::join (projections_on_disk, " ," ));
342+ // / This one is actually not broken, just redundant files on disk which
343+ // / MergeTree will never use.
344+ if (require_checksums && !projections_on_disk.empty ())
345+ {
346+ throw Exception (ErrorCodes::UNEXPECTED_FILE_IN_DATA_PART,
347+ " Found unexpected projection directories: {}" ,
348+ fmt::join (projections_on_disk, " ," ));
349+ }
341350 }
342351
343352 if (is_cancelled ())
0 commit comments