Skip to content

Commit 298e1d3

Browse files
author
Jan Lindström
committed
Improve error diagnostics on I/O errors. If node->name is NULL
try to use space->name instead.
1 parent 628bc57 commit 298e1d3

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

storage/innobase/fil/fil0fil.cc

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5034,12 +5034,15 @@ fil_extend_space_to_desired_size(
50345034
os_offset_t offset
50355035
= ((os_offset_t) (start_page_no - file_start_page_no))
50365036
* page_size;
5037+
5038+
const char* name = node->name == NULL ? space->name : node->name;
5039+
50375040
#ifdef UNIV_HOTBACKUP
5038-
success = os_file_write(node->name, node->handle, buf,
5041+
success = os_file_write(name, node->handle, buf,
50395042
offset, page_size * n_pages);
50405043
#else
50415044
success = os_aio(OS_FILE_WRITE, OS_AIO_SYNC,
5042-
node->name, node->handle, buf,
5045+
name, node->handle, buf,
50435046
offset, page_size * n_pages,
50445047
NULL, NULL);
50455048
#endif /* UNIV_HOTBACKUP */
@@ -5610,18 +5613,20 @@ fil_io(
56105613
ut_a(byte_offset % OS_FILE_LOG_BLOCK_SIZE == 0);
56115614
ut_a((len % OS_FILE_LOG_BLOCK_SIZE) == 0);
56125615

5616+
const char* name = node->name == NULL ? space->name : node->name;
5617+
56135618
#ifdef UNIV_HOTBACKUP
56145619
/* In mysqlbackup do normal i/o, not aio */
56155620
if (type == OS_FILE_READ) {
56165621
ret = os_file_read(node->handle, buf, offset, len);
56175622
} else {
56185623
ut_ad(!srv_read_only_mode);
5619-
ret = os_file_write(node->name, node->handle, buf,
5624+
ret = os_file_write(name, node->handle, buf,
56205625
offset, len);
56215626
}
56225627
#else
56235628
/* Queue the aio request */
5624-
ret = os_aio(type, mode | wake_later, node->name, node->handle, buf,
5629+
ret = os_aio(type, mode | wake_later, name, node->handle, buf,
56255630
offset, len, node, message);
56265631
#endif /* UNIV_HOTBACKUP */
56275632

storage/xtradb/fil/fil0fil.cc

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5060,12 +5060,15 @@ fil_extend_space_to_desired_size(
50605060
os_offset_t offset
50615061
= ((os_offset_t) (start_page_no - file_start_page_no))
50625062
* page_size;
5063+
5064+
const char* name = node->name == NULL ? space->name : node->name;
5065+
50635066
#ifdef UNIV_HOTBACKUP
5064-
success = os_file_write(node->name, node->handle, buf,
5067+
success = os_file_write(name, node->handle, buf,
50655068
offset, page_size * n_pages);
50665069
#else
50675070
success = os_aio(OS_FILE_WRITE, OS_AIO_SYNC,
5068-
node->name, node->handle, buf,
5071+
name, node->handle, buf,
50695072
offset, page_size * n_pages,
50705073
NULL, NULL, space_id, NULL);
50715074
#endif /* UNIV_HOTBACKUP */
@@ -5664,7 +5667,9 @@ _fil_io(
56645667
}
56655668

56665669
/* Queue the aio request */
5667-
ret = os_aio(type, mode | wake_later, node->name, node->handle, buf,
5670+
const char* name = node->name == NULL ? space->name : node->name;
5671+
5672+
ret = os_aio(type, mode | wake_later, name, node->handle, buf,
56685673
offset, len, node, message, space_id, trx);
56695674

56705675
#else
@@ -5673,7 +5678,7 @@ _fil_io(
56735678
ret = os_file_read(node->handle, buf, offset, len);
56745679
} else {
56755680
ut_ad(!srv_read_only_mode);
5676-
ret = os_file_write(node->name, node->handle, buf,
5681+
ret = os_file_write(name, node->handle, buf,
56775682
offset, len);
56785683
}
56795684
#endif /* !UNIV_HOTBACKUP */

0 commit comments

Comments
 (0)