Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
6bd2f900
Commit
6bd2f900
authored
Jul 03, 2014
by
Jan Lindström
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-6288: Innodb causes server crash after disk full, then can't
ALTER TABLE any more.
parent
80a02037
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
130 additions
and
7 deletions
+130
-7
mysql-test/suite/innodb/r/innodb-alter-table-disk-full.result
...l-test/suite/innodb/r/innodb-alter-table-disk-full.result
+50
-0
mysql-test/suite/innodb/t/innodb-alter-table-disk-full-master.opt
...st/suite/innodb/t/innodb-alter-table-disk-full-master.opt
+1
-0
mysql-test/suite/innodb/t/innodb-alter-table-disk-full.test
mysql-test/suite/innodb/t/innodb-alter-table-disk-full.test
+47
-0
storage/xtradb/fil/fil0fil.cc
storage/xtradb/fil/fil0fil.cc
+6
-3
storage/xtradb/handler/handler0alter.cc
storage/xtradb/handler/handler0alter.cc
+3
-0
storage/xtradb/os/os0file.cc
storage/xtradb/os/os0file.cc
+23
-4
No files found.
mysql-test/suite/innodb/r/innodb-alter-table-disk-full.result
0 → 100644
View file @
6bd2f900
create table t1(a int not null primary key, b int) engine=innodb;
create procedure innodb_insert_proc (repeat_count int)
begin
declare current_num int;
set current_num = 0;
while current_num < repeat_count do
insert into t1 values(current_num, current_num);
set current_num = current_num + 1;
end while;
end//
commit;
set autocommit=0;
call innodb_insert_proc(10000);
commit;
set autocommit=1;
set DEBUG_DBUG='+d,ib_os_aio_func_io_failure_28';
alter table t1 add testcol int;
ERROR HY000: The table 't1' is full
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
set DEBUG_DBUG='+d,ib_os_aio_func_io_failure_28_2';
alter table t1 add testcol int;
ERROR HY000: The table 't1' is full
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
set DEBUG_DBUG=NULL;
alter table t1 add testcol2 int;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` int(11) DEFAULT NULL,
`testcol2` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
select count(1) from t1;
count(1)
10000
drop procedure innodb_insert_proc;
drop table t1;
mysql-test/suite/innodb/t/innodb-alter-table-disk-full-master.opt
0 → 100644
View file @
6bd2f900
--innodb-use-native-aio=0
mysql-test/suite/innodb/t/innodb-alter-table-disk-full.test
0 → 100644
View file @
6bd2f900
# MDEV-6288: Innodb causes server crash after disk full, then can't ALTER TABLE any more
--
source
include
/
have_xtradb
.
inc
# DEBUG_SYNC must be compiled in.
--
source
include
/
have_debug_sync
.
inc
create
table
t1
(
a
int
not
null
primary
key
,
b
int
)
engine
=
innodb
;
delimiter
//;
create
procedure
innodb_insert_proc
(
repeat_count
int
)
begin
declare
current_num
int
;
set
current_num
=
0
;
while
current_num
<
repeat_count
do
insert
into
t1
values
(
current_num
,
current_num
);
set
current_num
=
current_num
+
1
;
end
while
;
end
//
delimiter
;
//
commit
;
set
autocommit
=
0
;
call
innodb_insert_proc
(
10000
);
commit
;
set
autocommit
=
1
;
# This caused crash earlier
set
DEBUG_DBUG
=
'+d,ib_os_aio_func_io_failure_28'
;
--
error
1114
alter
table
t1
add
testcol
int
;
show
create
table
t1
;
# This caused crash earlier
set
DEBUG_DBUG
=
'+d,ib_os_aio_func_io_failure_28_2'
;
--
error
1114
alter
table
t1
add
testcol
int
;
show
create
table
t1
;
set
DEBUG_DBUG
=
NULL
;
alter
table
t1
add
testcol2
int
;
show
create
table
t1
;
select
count
(
1
)
from
t1
;
drop
procedure
innodb_insert_proc
;
drop
table
t1
;
storage/xtradb/fil/fil0fil.cc
View file @
6bd2f900
...
@@ -5543,7 +5543,7 @@ _fil_io(
...
@@ -5543,7 +5543,7 @@ _fil_io(
ulint
mode
;
ulint
mode
;
fil_space_t
*
space
;
fil_space_t
*
space
;
fil_node_t
*
node
;
fil_node_t
*
node
;
ibool
ret
;
ibool
ret
=
TRUE
;
ulint
is_log
;
ulint
is_log
;
ulint
wake_later
;
ulint
wake_later
;
os_offset_t
offset
;
os_offset_t
offset
;
...
@@ -5767,7 +5767,6 @@ _fil_io(
...
@@ -5767,7 +5767,6 @@ _fil_io(
offset
,
len
);
offset
,
len
);
}
}
#endif
/* !UNIV_HOTBACKUP */
#endif
/* !UNIV_HOTBACKUP */
ut_a
(
ret
);
if
(
mode
==
OS_AIO_SYNC
)
{
if
(
mode
==
OS_AIO_SYNC
)
{
/* The i/o operation is already completed when we return from
/* The i/o operation is already completed when we return from
...
@@ -5782,7 +5781,11 @@ _fil_io(
...
@@ -5782,7 +5781,11 @@ _fil_io(
ut_ad
(
fil_validate_skip
());
ut_ad
(
fil_validate_skip
());
}
}
return
(
DB_SUCCESS
);
if
(
!
ret
)
{
return
(
DB_OUT_OF_FILE_SPACE
);
}
else
{
return
(
DB_SUCCESS
);
}
}
}
#ifndef UNIV_HOTBACKUP
#ifndef UNIV_HOTBACKUP
...
...
storage/xtradb/handler/handler0alter.cc
View file @
6bd2f900
...
@@ -3167,6 +3167,9 @@ error_handling:
...
@@ -3167,6 +3167,9 @@ error_handling:
case
DB_DUPLICATE_KEY
:
case
DB_DUPLICATE_KEY
:
my_error
(
ER_DUP_KEY
,
MYF
(
0
),
"SYS_INDEXES"
);
my_error
(
ER_DUP_KEY
,
MYF
(
0
),
"SYS_INDEXES"
);
break
;
break
;
case
DB_OUT_OF_FILE_SPACE
:
my_error_innodb
(
error
,
table_name
,
user_table
->
flags
);
break
;
default:
default:
my_error_innodb
(
error
,
table_name
,
user_table
->
flags
);
my_error_innodb
(
error
,
table_name
,
user_table
->
flags
);
}
}
...
...
storage/xtradb/os/os0file.cc
View file @
6bd2f900
...
@@ -4720,8 +4720,10 @@ os_aio_func(
...
@@ -4720,8 +4720,10 @@ os_aio_func(
wake_later
=
mode
&
OS_AIO_SIMULATED_WAKE_LATER
;
wake_later
=
mode
&
OS_AIO_SIMULATED_WAKE_LATER
;
mode
=
mode
&
(
~
OS_AIO_SIMULATED_WAKE_LATER
);
mode
=
mode
&
(
~
OS_AIO_SIMULATED_WAKE_LATER
);
if
(
mode
==
OS_AIO_SYNC
)
DBUG_EXECUTE_IF
(
"ib_os_aio_func_io_failure_28"
,
{
mode
=
OS_AIO_SYNC
;);
if
(
mode
==
OS_AIO_SYNC
)
{
ibool
ret
;
ibool
ret
;
/* This is actually an ordinary synchronous read or write:
/* This is actually an ordinary synchronous read or write:
no need to use an i/o-handler thread */
no need to use an i/o-handler thread */
...
@@ -4735,7 +4737,18 @@ os_aio_func(
...
@@ -4735,7 +4737,18 @@ os_aio_func(
ret
=
os_file_write
(
name
,
file
,
buf
,
offset
,
n
);
ret
=
os_file_write
(
name
,
file
,
buf
,
offset
,
n
);
}
}
ut_a
(
ret
);
DBUG_EXECUTE_IF
(
"ib_os_aio_func_io_failure_28"
,
os_has_said_disk_full
=
FALSE
;);
DBUG_EXECUTE_IF
(
"ib_os_aio_func_io_failure_28"
,
ret
=
0
;);
DBUG_EXECUTE_IF
(
"ib_os_aio_func_io_failure_28"
,
errno
=
28
;);
if
(
!
ret
)
{
fprintf
(
stderr
,
"FAIL"
);
}
return
ret
;
return
ret
;
}
}
...
@@ -5564,7 +5577,13 @@ consecutive_loop:
...
@@ -5564,7 +5577,13 @@ consecutive_loop:
aio_slot
->
offset
,
total_len
);
aio_slot
->
offset
,
total_len
);
}
}
ut_a
(
ret
);
DBUG_EXECUTE_IF
(
"ib_os_aio_func_io_failure_28_2"
,
os_has_said_disk_full
=
FALSE
;);
DBUG_EXECUTE_IF
(
"ib_os_aio_func_io_failure_28_2"
,
ret
=
0
;);
DBUG_EXECUTE_IF
(
"ib_os_aio_func_io_failure_28_2"
,
errno
=
28
;);
srv_set_io_thread_op_info
(
global_segment
,
"file i/o done"
);
srv_set_io_thread_op_info
(
global_segment
,
"file i/o done"
);
if
(
aio_slot
->
type
==
OS_FILE_READ
&&
n_consecutive
>
1
)
{
if
(
aio_slot
->
type
==
OS_FILE_READ
&&
n_consecutive
>
1
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment