@@ -75,8 +75,8 @@ def create_restore_job(self):
75
75
self .import_tablespaces_in_target_db ()
76
76
self .hold_write_lock_on_myisam_tables ()
77
77
self .perform_myisam_file_operations ()
78
- self .perform_post_restoration_validation_and_fixes ()
79
78
self .unlock_all_tables ()
79
+ self .perform_post_restoration_validation_and_fixes ()
80
80
81
81
@step ("Validate Backup Files" )
82
82
def validate_backup_files (self ): # noqa: C901
@@ -294,7 +294,11 @@ def perform_post_restoration_validation_and_fixes(self):
294
294
"""
295
295
296
296
for table in innodb_tables_with_fts :
297
- if self .is_table_corrupted (table ) and not self .repair_table (table , "innodb" ):
297
+ """
298
+ No need to waste time on checking whether index is corrupted or not
299
+ Because, physical restoration will not work for FULLTEXT index.
300
+ """
301
+ if not self .repair_table (table , "innodb" ):
298
302
raise Exception (f"Failed to repair table { table } " )
299
303
300
304
"""
@@ -311,16 +315,6 @@ def perform_post_restoration_validation_and_fixes(self):
311
315
if self .is_table_corrupted (table ) and not self .repair_table (table , "myisam" ):
312
316
raise Exception (f"Failed to repair table { table } " )
313
317
314
- for table in self .innodb_tables :
315
- if table in innodb_tables_with_fts :
316
- continue
317
- """
318
- If other innodb tables are corrupted,
319
- We can't repair the table in running database
320
- """
321
- if self .is_table_corrupted (table ):
322
- raise Exception (f"Failed to repair table { table } " )
323
-
324
318
@step ("Unlock All Tables" )
325
319
def unlock_all_tables (self ):
326
320
self ._get_target_db ().execute_sql ("UNLOCK TABLES;" )
@@ -453,7 +447,7 @@ def is_table_corrupted(self, table_name: str) -> bool:
453
447
""" # noqa: E501
454
448
isError = False
455
449
for row in result :
456
- if row [2 ] == "error" :
450
+ if row [2 ] == "error" or ( row [ 2 ] == "warning" and table_name in self . myisam_tables ) :
457
451
isError = True
458
452
break
459
453
return isError
0 commit comments