@@ -36,11 +36,13 @@ namespace ErrorCodes
3636 extern const int CANNOT_ALLOCATE_MEMORY;
3737 extern const int CANNOT_MUNMAP;
3838 extern const int CANNOT_MREMAP;
39+ extern const int CANNOT_SCHEDULE_TASK;
3940 extern const int UNEXPECTED_FILE_IN_DATA_PART;
4041 extern const int NO_FILE_IN_DATA_PART;
4142 extern const int NETWORK_ERROR;
4243 extern const int SOCKET_TIMEOUT;
4344 extern const int BROKEN_PROJECTION;
45+ extern const int ABORTED;
4446}
4547
4648
@@ -85,7 +87,9 @@ bool isRetryableException(std::exception_ptr exception_ptr)
8587 {
8688 return isNotEnoughMemoryErrorCode (e.code ())
8789 || e.code () == ErrorCodes::NETWORK_ERROR
88- || e.code () == ErrorCodes::SOCKET_TIMEOUT;
90+ || e.code () == ErrorCodes::SOCKET_TIMEOUT
91+ || e.code () == ErrorCodes::CANNOT_SCHEDULE_TASK
92+ || e.code () == ErrorCodes::ABORTED;
8993 }
9094 catch (const Poco::Net::NetException &)
9195 {
@@ -329,16 +333,21 @@ static IMergeTreeDataPart::Checksums checkDataPart(
329333 projections_on_disk.erase (projection_file);
330334 }
331335
332- if (throw_on_broken_projection && !broken_projections_message. empty () )
336+ if (throw_on_broken_projection)
333337 {
334- throw Exception (ErrorCodes::BROKEN_PROJECTION, " {}" , broken_projections_message);
335- }
338+ if (!broken_projections_message.empty ())
339+ {
340+ throw Exception (ErrorCodes::BROKEN_PROJECTION, " {}" , broken_projections_message);
341+ }
336342
337- if (require_checksums && !projections_on_disk.empty ())
338- {
339- throw Exception (ErrorCodes::UNEXPECTED_FILE_IN_DATA_PART,
340- " Found unexpected projection directories: {}" ,
341- fmt::join (projections_on_disk, " ," ));
343+ // / This one is actually not broken, just redundant files on disk which
344+ // / MergeTree will never use.
345+ if (require_checksums && !projections_on_disk.empty ())
346+ {
347+ throw Exception (ErrorCodes::UNEXPECTED_FILE_IN_DATA_PART,
348+ " Found unexpected projection directories: {}" ,
349+ fmt::join (projections_on_disk, " ," ));
350+ }
342351 }
343352
344353 if (is_cancelled ())
0 commit comments