@@ -38,11 +38,13 @@ namespace ErrorCodes
3838 extern const int CANNOT_ALLOCATE_MEMORY;
3939 extern const int CANNOT_MUNMAP;
4040 extern const int CANNOT_MREMAP;
41+ extern const int CANNOT_SCHEDULE_TASK;
4142 extern const int UNEXPECTED_FILE_IN_DATA_PART;
4243 extern const int NO_FILE_IN_DATA_PART;
4344 extern const int NETWORK_ERROR;
4445 extern const int SOCKET_TIMEOUT;
4546 extern const int BROKEN_PROJECTION;
47+ extern const int ABORTED;
4648}
4749
4850
@@ -88,11 +90,11 @@ bool isRetryableException(std::exception_ptr exception_ptr)
8890 }
8991 catch (const Exception & e)
9092 {
91- if ( isNotEnoughMemoryErrorCode (e.code () ))
92- return true ;
93-
94- if (e. code () == ErrorCodes::NETWORK_ERROR || e.code () == ErrorCodes::SOCKET_TIMEOUT)
95- return true ;
93+ return isNotEnoughMemoryErrorCode (e.code ())
94+ || e. code () == ErrorCodes::NETWORK_ERROR
95+ || e. code () == ErrorCodes::SOCKET_TIMEOUT
96+ || e.code () == ErrorCodes::CANNOT_SCHEDULE_TASK
97+ || e. code () == ErrorCodes::ABORTED ;
9698 }
9799 catch (const Poco::Net::NetException &)
98100 {
@@ -335,16 +337,21 @@ static IMergeTreeDataPart::Checksums checkDataPart(
335337 projections_on_disk.erase (projection_file);
336338 }
337339
338- if (throw_on_broken_projection && !broken_projections_message. empty () )
340+ if (throw_on_broken_projection)
339341 {
340- throw Exception (ErrorCodes::BROKEN_PROJECTION, " {}" , broken_projections_message);
341- }
342+ if (!broken_projections_message.empty ())
343+ {
344+ throw Exception (ErrorCodes::BROKEN_PROJECTION, " {}" , broken_projections_message);
345+ }
342346
343- if (require_checksums && !projections_on_disk.empty ())
344- {
345- throw Exception (ErrorCodes::UNEXPECTED_FILE_IN_DATA_PART,
346- " Found unexpected projection directories: {}" ,
347- fmt::join (projections_on_disk, " ," ));
347+ // / This one is actually not broken, just redundant files on disk which
348+ // / MergeTree will never use.
349+ if (require_checksums && !projections_on_disk.empty ())
350+ {
351+ throw Exception (ErrorCodes::UNEXPECTED_FILE_IN_DATA_PART,
352+ " Found unexpected projection directories: {}" ,
353+ fmt::join (projections_on_disk, " ," ));
354+ }
348355 }
349356
350357 if (is_cancelled ())
0 commit comments