os0file.c:

  Print progress information if at startup InnoDB creates and writes bigger than 100 MB data file or log file
parent eab9a5e0
...@@ -752,7 +752,12 @@ os_file_set_size( ...@@ -752,7 +752,12 @@ os_file_set_size(
offset = 0; offset = 0;
low = (ib_longlong)size + (((ib_longlong)size_high) << 32); low = (ib_longlong)size + (((ib_longlong)size_high) << 32);
if (low >= (ib_longlong)(100 * 1024 * 1024)) {
fprintf(stderr, "InnoDB: Progress in MB:");
}
while (offset < low) { while (offset < low) {
if (low - offset < UNIV_PAGE_SIZE * 512) { if (low - offset < UNIV_PAGE_SIZE * 512) {
n_bytes = (ulint)(low - offset); n_bytes = (ulint)(low - offset);
...@@ -768,9 +773,24 @@ os_file_set_size( ...@@ -768,9 +773,24 @@ os_file_set_size(
ut_free(buf2); ut_free(buf2);
goto error_handling; goto error_handling;
} }
/* Print about progress for each 100 MB written */
if ((offset + n_bytes) / (ib_longlong)(100 * 1024 * 1024)
!= offset / (ib_longlong)(100 * 1024 * 1024)) {
fprintf(stderr, " %lu00",
(ulint)((offset + n_bytes)
/ (ib_longlong)(100 * 1024 * 1024)));
}
offset += n_bytes; offset += n_bytes;
} }
if (low >= (ib_longlong)(100 * 1024 * 1024)) {
fprintf(stderr, "\n");
}
ut_free(buf2); ut_free(buf2);
ret = os_file_flush(file); ret = os_file_flush(file);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment