diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2015-03-09 18:21:48 +0200 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2015-03-09 18:33:25 +0200 |
commit | a7fd11b31d52b62ef7b61783bb83a5e62271307b (patch) | |
tree | 979131c0d6ce96f32c4d56f87008d54e1bdeef42 /storage/xtradb | |
parent | ec16d1b62fb08b4dd3aa415a9bf717b5039a56cc (diff) | |
download | mariadb-git-a7fd11b31d52b62ef7b61783bb83a5e62271307b.tar.gz |
MDEV-7685: MariaDB - server crashes when inserting more rows than
available space on disk
Add error handling when disk full situation happens and
intentionally bring server down with stacktrace because
on all cases InnoDB can't continue anyway.
Diffstat (limited to 'storage/xtradb')
-rw-r--r-- | storage/xtradb/btr/btr0btr.cc | 6 | ||||
-rw-r--r-- | storage/xtradb/handler/handler0alter.cc | 1 | ||||
-rw-r--r-- | storage/xtradb/os/os0file.cc | 16 |
3 files changed, 14 insertions, 9 deletions
diff --git a/storage/xtradb/btr/btr0btr.cc b/storage/xtradb/btr/btr0btr.cc index 1da487f1400..d240188e772 100644 --- a/storage/xtradb/btr/btr0btr.cc +++ b/storage/xtradb/btr/btr0btr.cc @@ -3097,12 +3097,6 @@ func_start: /* 2. Allocate a new page to the index */ new_block = btr_page_alloc(cursor->index, hint_page_no, direction, btr_page_get_level(page, mtr), mtr, mtr); - - /* Play safe, if new page is not allocated */ - if (!new_block) { - return(rec); - } - new_page = buf_block_get_frame(new_block); new_page_zip = buf_block_get_page_zip(new_block); btr_page_create(new_block, new_page_zip, cursor->index, diff --git a/storage/xtradb/handler/handler0alter.cc b/storage/xtradb/handler/handler0alter.cc index 3441fe04006..bb58a92ed1a 100644 --- a/storage/xtradb/handler/handler0alter.cc +++ b/storage/xtradb/handler/handler0alter.cc @@ -128,6 +128,7 @@ my_error_innodb( break; case DB_OUT_OF_FILE_SPACE: my_error(ER_RECORD_FILE_FULL, MYF(0), table); + ut_error; break; case DB_TEMP_FILE_WRITE_FAILURE: my_error(ER_GET_ERRMSG, MYF(0), diff --git a/storage/xtradb/os/os0file.cc b/storage/xtradb/os/os0file.cc index 112581442ab..a88c344a6ee 100644 --- a/storage/xtradb/os/os0file.cc +++ b/storage/xtradb/os/os0file.cc @@ -716,6 +716,7 @@ os_file_handle_error_cond_exit( fflush(stderr); + ut_error; return(FALSE); case OS_FILE_AIO_RESOURCES_RESERVED: @@ -4735,7 +4736,7 @@ os_aio_func( mode = mode & (~OS_AIO_SIMULATED_WAKE_LATER); DBUG_EXECUTE_IF("ib_os_aio_func_io_failure_28", - mode = OS_AIO_SYNC; os_has_said_disk_full = TRUE;); + mode = OS_AIO_SYNC; os_has_said_disk_full = FALSE;); if (mode == OS_AIO_SYNC) { ibool ret; @@ -4751,7 +4752,11 @@ os_aio_func( ret = os_file_write(name, file, buf, offset, n); DBUG_EXECUTE_IF("ib_os_aio_func_io_failure_28", - os_has_said_disk_full = TRUE; ret = 0; errno = 28;); + os_has_said_disk_full = FALSE; ret = 0; errno = 28;); + + if (!ret) { + os_file_handle_error_cond_exit(name, "os_file_write_func", TRUE, FALSE); + } } if (!ret) { @@ -5582,7 +5587,12 @@ consecutive_loop: aio_slot->offset, total_len); DBUG_EXECUTE_IF("ib_os_aio_func_io_failure_28", - os_has_said_disk_full = TRUE; ret = 0; errno = 28;); + os_has_said_disk_full = FALSE; ret = 0; errno = 28;); + + if (!ret) { + os_file_handle_error_cond_exit(aio_slot->name, "os_file_write_func", TRUE, FALSE); + } + } else { ret = os_file_read( aio_slot->file, combined_buf, |