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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
7e869a27
Commit
7e869a27
authored
Oct 11, 2018
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.2 into 10.3
parents
4de0d920
81a5b6cc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
73 deletions
+45
-73
mysql-test/suite/innodb/r/log_file_size.result
mysql-test/suite/innodb/r/log_file_size.result
+1
-1
mysql-test/suite/innodb/t/log_file_size.test
mysql-test/suite/innodb/t/log_file_size.test
+1
-1
storage/innobase/srv/srv0start.cc
storage/innobase/srv/srv0start.cc
+43
-71
No files found.
mysql-test/suite/innodb/r/log_file_size.result
View file @
7e869a27
...
...
@@ -3,7 +3,7 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /InnoDB: Log file .*ib_logfile
0 size 0 is too small
/ in mysqld.1.err
FOUND 1 /InnoDB: Log file .*ib_logfile
1 is of different size .* bytes than other log files 0 bytes!
/ in mysqld.1.err
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
...
...
mysql-test/suite/innodb/t/log_file_size.test
View file @
7e869a27
...
...
@@ -43,7 +43,7 @@ eval $check_no_innodb;
--
move_file
$MYSQLD_DATADIR
/
ib_logfile
.
old
$MYSQLD_DATADIR
/
ib_logfile
.
0
--
source
include
/
shutdown_mysqld
.
inc
let
SEARCH_FILE
=
$MYSQLTEST_VARDIR
/
log
/
mysqld
.
1.
err
;
let
SEARCH_PATTERN
=
InnoDB
:
Log
file
.*
ib_logfile
0
size
0
is
too
small
;
let
SEARCH_PATTERN
=
InnoDB
:
Log
file
.*
ib_logfile
1
is
of
different
size
.*
bytes
than
other
log
files
0
bytes
!
;
--
source
include
/
search_pattern_in_file
.
inc
--
source
include
/
start_mysqld
.
inc
CHECK
TABLE
t1
;
...
...
storage/innobase/srv/srv0start.cc
View file @
7e869a27
...
...
@@ -564,34 +564,6 @@ create_log_files_rename(
return
(
err
);
}
/*********************************************************************//**
Opens a log file.
@return DB_SUCCESS or error code */
static
MY_ATTRIBUTE
((
nonnull
,
warn_unused_result
))
dberr_t
open_log_file
(
/*==========*/
pfs_os_file_t
*
file
,
/*!< out: file handle */
const
char
*
name
,
/*!< in: log file name */
os_offset_t
*
size
)
/*!< out: file size */
{
bool
ret
;
*
file
=
os_file_create
(
innodb_log_file_key
,
name
,
OS_FILE_OPEN
,
OS_FILE_AIO
,
OS_LOG_FILE
,
srv_read_only_mode
,
&
ret
);
if
(
!
ret
)
{
ib
::
error
()
<<
"Unable to open '"
<<
name
<<
"'"
;
return
(
DB_ERROR
);
}
*
size
=
os_file_get_size
(
*
file
);
ret
=
os_file_close
(
*
file
);
ut_a
(
ret
);
return
(
DB_SUCCESS
);
}
/*********************************************************************//**
Create undo tablespace.
@return DB_SUCCESS or error code */
...
...
@@ -1760,8 +1732,9 @@ dberr_t srv_start(bool create_new_db)
return
(
srv_init_abort
(
err
));
}
}
else
{
srv_log_file_size
=
0
;
for
(
i
=
0
;
i
<
SRV_N_LOG_FILES_MAX
;
i
++
)
{
os_offset_t
size
;
os_file_stat_t
stat_info
;
sprintf
(
logfilename
+
dirnamelen
,
...
...
@@ -1779,40 +1752,6 @@ dberr_t srv_start(bool create_new_db)
==
SRV_OPERATION_RESTORE_EXPORT
)
{
return
(
DB_SUCCESS
);
}
if
(
flushed_lsn
<
static_cast
<
lsn_t
>
(
1000
))
{
ib
::
error
()
<<
"Cannot create"
" log files because"
" data files are"
" corrupt or the"
" database was not"
" shut down cleanly"
" after creating"
" the data files."
;
return
(
srv_init_abort
(
DB_ERROR
));
}
err
=
create_log_files
(
logfilename
,
dirnamelen
,
flushed_lsn
,
logfile0
);
if
(
err
==
DB_SUCCESS
)
{
err
=
create_log_files_rename
(
logfilename
,
dirnamelen
,
flushed_lsn
,
logfile0
);
}
if
(
err
!=
DB_SUCCESS
)
{
return
(
srv_init_abort
(
err
));
}
/* Suppress the message about
crash recovery. */
flushed_lsn
=
log_get_lsn
();
goto
files_checked
;
}
/* opened all files */
...
...
@@ -1823,12 +1762,7 @@ dberr_t srv_start(bool create_new_db)
return
(
srv_init_abort
(
DB_ERROR
));
}
err
=
open_log_file
(
&
files
[
i
],
logfilename
,
&
size
);
if
(
err
!=
DB_SUCCESS
)
{
return
(
srv_init_abort
(
err
));
}
const
os_offset_t
size
=
stat_info
.
size
;
ut_a
(
size
!=
(
os_offset_t
)
-
1
);
if
(
size
&
(
OS_FILE_LOG_BLOCK_SIZE
-
1
))
{
...
...
@@ -1853,8 +1787,13 @@ dberr_t srv_start(bool create_new_db)
/* The first log file must consist of
at least the following 512-byte pages:
header, checkpoint page 1, empty,
checkpoint page 2, redo log page(s) */
if
(
size
<=
OS_FILE_LOG_BLOCK_SIZE
*
4
)
{
checkpoint page 2, redo log page(s).
Mariabackup --prepare would create an
empty ib_logfile0. Tolerate it if there
are no other ib_logfile* files. */
if
((
size
!=
0
||
i
!=
0
)
&&
size
<=
OS_FILE_LOG_BLOCK_SIZE
*
4
)
{
ib
::
error
()
<<
"Log file "
<<
logfilename
<<
" size "
<<
size
<<
" is too small"
;
...
...
@@ -1871,6 +1810,39 @@ dberr_t srv_start(bool create_new_db)
}
}
if
(
srv_log_file_size
==
0
)
{
if
(
flushed_lsn
<
lsn_t
(
1000
))
{
ib
::
error
()
<<
"Cannot create log files because"
" data files are corrupt or the"
" database was not shut down cleanly"
" after creating the data files."
;
return
srv_init_abort
(
DB_ERROR
);
}
strcpy
(
logfilename
+
dirnamelen
,
"ib_logfile0"
);
srv_log_file_size
=
srv_log_file_size_requested
;
err
=
create_log_files
(
logfilename
,
dirnamelen
,
flushed_lsn
,
logfile0
);
if
(
err
==
DB_SUCCESS
)
{
err
=
create_log_files_rename
(
logfilename
,
dirnamelen
,
flushed_lsn
,
logfile0
);
}
if
(
err
!=
DB_SUCCESS
)
{
return
(
srv_init_abort
(
err
));
}
/* Suppress the message about
crash recovery. */
flushed_lsn
=
log_get_lsn
();
goto
files_checked
;
}
srv_n_log_files_found
=
i
;
/* Create the in-memory file space objects. */
...
...
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