[Commits] Rev 4285: MDEV-6456: No progress indication for "Reading tablespace information from the .ibd files" in file:///home/psergey/dev2/10.0-cp2a/

Sergey Petrunya psergey at askmonty.org
Fri Jul 18 01:53:23 EEST 2014


At file:///home/psergey/dev2/10.0-cp2a/

------------------------------------------------------------
revno: 4285
revision-id: psergey at askmonty.org-20140717225321-ulz8n1vsd86e9xzr
parent: psergey at askmonty.org-20140709090941-ulrqiburtae3d7e1
committer: Sergey Petrunya <psergey at askmonty.org>
branch nick: 10.0-cp2a
timestamp: Fri 2014-07-18 02:53:21 +0400
message:
  MDEV-6456: No progress indication for "Reading tablespace information from the .ibd files"
  - Add progress indication: print # processed files every 15 sec.
=== modified file 'storage/xtradb/fil/fil0fil.cc'
--- a/storage/xtradb/fil/fil0fil.cc	2014-07-03 11:55:03 +0000
+++ b/storage/xtradb/fil/fil0fil.cc	2014-07-17 22:53:21 +0000
@@ -4611,6 +4611,7 @@ fil_file_readdir_next_file(
 	return(-1);
 }
 
+#define CHECK_TIME_EVERY_N_FILES   10
 /********************************************************************//**
 At the server startup, if we need crash recovery, scans the database
 directories under the MySQL datadir, looking for .ibd files. Those files are
@@ -4627,6 +4628,9 @@ fil_load_single_table_tablespaces(void)
 	int		ret;
 	char*		dbpath		= NULL;
 	ulint		dbpath_len	= 100;
+        ulint 		files_read	= 0;
+        ulint 		files_read_at_last_check	= 0;
+        ib_time_t 	prev_report_time = ut_time();
 	os_file_dir_t	dir;
 	os_file_dir_t	dbdir;
 	os_file_stat_t	dbinfo;
@@ -4705,6 +4709,20 @@ fil_load_single_table_tablespaces(void)
 					try opening the file */
 					fil_load_single_table_tablespace(
 						dbinfo.name, fileinfo.name);
+					files_read++;
+					if (files_read - files_read_at_last_check >
+					    CHECK_TIME_EVERY_N_FILES) {
+						ib_time_t cur_time= ut_time();
+						files_read_at_last_check= files_read;
+						double time_elapsed= ut_difftime(cur_time, 
+						                                 prev_report_time);
+						if (time_elapsed > 15) {
+							ib_logf(IB_LOG_LEVEL_INFO, 
+								"Processed %ld .ibd/.isl files",
+								files_read);
+							prev_report_time= cur_time;
+						}
+                                        }
 				}
 next_file_item:
 				ret = fil_file_readdir_next_file(&err,



More information about the commits mailing list