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
daa2680c
Commit
daa2680c
authored
May 12, 2022
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.5 into 10.6
parents
7da0f30c
3fabdc3c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
27 deletions
+48
-27
extra/mariabackup/xtrabackup.cc
extra/mariabackup/xtrabackup.cc
+20
-19
mysql-test/suite/mariabackup/incremental_backup.test
mysql-test/suite/mariabackup/incremental_backup.test
+16
-0
sql/item.h
sql/item.h
+2
-2
storage/innobase/buf/buf0buf.cc
storage/innobase/buf/buf0buf.cc
+10
-6
No files found.
extra/mariabackup/xtrabackup.cc
View file @
daa2680c
...
...
@@ -51,6 +51,7 @@ Street, Fifth Floor, Boston, MA 02110-1335 USA
#include <my_getopt.h>
#include <mysql_com.h>
#include <my_default.h>
#include <scope.h>
#include <sql_class.h>
#include <fcntl.h>
...
...
@@ -4601,13 +4602,6 @@ static bool xtrabackup_backup_func()
}
if
(
auto
b
=
aligned_malloc
(
UNIV_PAGE_SIZE_MAX
,
4096
))
{
field_ref_zero
=
static_cast
<
byte
*>
(
memset_aligned
<
4096
>
(
b
,
0
,
UNIV_PAGE_SIZE_MAX
));
}
else
{
goto
fail
;
}
{
/* definition from recv_recovery_from_checkpoint_start() */
ulint
max_cp_field
;
...
...
@@ -4624,10 +4618,6 @@ static bool xtrabackup_backup_func()
msg
(
"Error: cannot read redo log header"
);
unlock_and_fail:
mysql_mutex_unlock
(
&
log_sys
.
mutex
);
free_and_fail:
aligned_free
(
const_cast
<
byte
*>
(
field_ref_zero
));
field_ref_zero
=
nullptr
;
goto
fail
;
}
if
(
log_sys
.
log
.
format
==
0
)
{
...
...
@@ -4653,7 +4643,7 @@ static bool xtrabackup_backup_func()
xtrabackup_init_datasinks
();
if
(
!
select_history
())
{
goto
f
ree_and_f
ail
;
goto
fail
;
}
/* open the log file */
...
...
@@ -4662,7 +4652,7 @@ static bool xtrabackup_backup_func()
if
(
dst_log_file
==
NULL
)
{
msg
(
"Error: failed to open the target stream for '%s'."
,
LOG_FILE_NAME
);
goto
f
ree_and_f
ail
;
goto
fail
;
}
/* label it */
...
...
@@ -4700,7 +4690,7 @@ static bool xtrabackup_backup_func()
if
(
ds_write
(
dst_log_file
,
log_hdr_buf
,
LOG_FILE_HDR_SIZE
))
{
msg
(
"error: write to logfile failed"
);
aligned_free
(
log_hdr_buf
);
goto
f
ree_and_f
ail
;
goto
fail
;
}
aligned_free
(
log_hdr_buf
);
...
...
@@ -4721,7 +4711,7 @@ static bool xtrabackup_backup_func()
" error %s."
,
ut_strerr
(
err
));
fail_before_log_copying_thread_start:
log_copying_running
=
false
;
goto
f
ree_and_f
ail
;
goto
fail
;
}
/* copy log file by current position */
...
...
@@ -4744,7 +4734,7 @@ static bool xtrabackup_backup_func()
/* FLUSH CHANGED_PAGE_BITMAPS call */
if
(
!
flush_changed_page_bitmaps
())
{
goto
f
ree_and_f
ail
;
goto
fail
;
}
ut_a
(
xtrabackup_parallel
>
0
);
...
...
@@ -4812,9 +4802,6 @@ static bool xtrabackup_backup_func()
if
(
opt_log_innodb_page_corruption
)
ok
=
corrupted_pages
.
print_to_file
(
MB_CORRUPTED_PAGES_FILE
);
aligned_free
(
const_cast
<
byte
*>
(
field_ref_zero
));
field_ref_zero
=
nullptr
;
if
(
!
ok
)
{
goto
fail
;
}
...
...
@@ -6997,6 +6984,20 @@ static int main_low(char** argv)
}
}
ut_ad
(
!
field_ref_zero
);
if
(
auto
b
=
aligned_malloc
(
UNIV_PAGE_SIZE_MAX
,
4096
))
{
field_ref_zero
=
static_cast
<
byte
*>
(
memset_aligned
<
4096
>
(
b
,
0
,
UNIV_PAGE_SIZE_MAX
));
}
else
{
msg
(
"Can't allocate memory for field_ref_zero"
);
return
EXIT_FAILURE
;
}
auto
_
=
make_scope_exit
([]()
{
aligned_free
(
const_cast
<
byte
*>
(
field_ref_zero
));
field_ref_zero
=
nullptr
;
});
/* --backup */
if
(
xtrabackup_backup
&&
!
xtrabackup_backup_func
())
{
return
(
EXIT_FAILURE
);
...
...
mysql-test/suite/mariabackup/incremental_backup.test
View file @
daa2680c
...
...
@@ -8,6 +8,7 @@ if (`select @@max_binlog_stmt_cache_size = 4294963200 and @@innodb_page_size = 6
call
mtr
.
add_suppression
(
"InnoDB: New log files created"
);
let
$test_comp
=
`select @@innodb_page_size < 32768`
;
let
basedir
=
$MYSQLTEST_VARDIR
/
tmp
/
backup
;
let
incremental_dir
=
$MYSQLTEST_VARDIR
/
tmp
/
backup_inc1
;
...
...
@@ -16,6 +17,14 @@ CREATE TABLE t(i INT PRIMARY KEY) ENGINE INNODB;
# MDEV-515 takes X-lock on the table for the first insert.
# So concurrent insert won't happen on the table
INSERT
INTO
t
VALUES
(
100
);
if
(
$test_comp
)
{
# If MDEV-28474 is not fixed, backup preparing will crash with SIGSEGV.
--
disable_query_log
--
disable_result_log
CREATE
TABLE
t_comp
(
i
INT
PRIMARY
KEY
)
ENGINE
INNODB
ROW_FORMAT
=
COMPRESSED
;
--
enable_query_log
--
enable_result_log
}
BEGIN
;
INSERT
INTO
t
VALUES
(
2
);
connect
(
con1
,
localhost
,
root
,,);
...
...
@@ -99,6 +108,13 @@ let $targetdir=$basedir;
SELECT
*
FROM
t
;
DROP
TABLE
t
;
if
(
$test_comp
)
{
--
disable_query_log
--
disable_result_log
DROP
TABLE
t_comp
;
--
enable_query_log
--
enable_result_log
}
DROP
TABLE
t_aria
;
# Cleanup
...
...
sql/item.h
View file @
daa2680c
...
...
@@ -6643,9 +6643,9 @@ class Item_default_value : public Item_field
bool
get_date
(
THD
*
thd
,
MYSQL_TIME
*
ltime
,
date_mode_t
fuzzydate
)
override
;
bool
val_native
(
THD
*
thd
,
Native
*
to
)
override
;
bool
val_native_result
(
THD
*
thd
,
Native
*
to
)
override
;
longlong
val_datetime_packed
(
THD
*
thd
)
longlong
val_datetime_packed
(
THD
*
thd
)
override
{
return
Item
::
val_datetime_packed
(
thd
);
}
longlong
val_time_packed
(
THD
*
thd
)
longlong
val_time_packed
(
THD
*
thd
)
override
{
return
Item
::
val_time_packed
(
thd
);
}
/* Result variants */
...
...
storage/innobase/buf/buf0buf.cc
View file @
daa2680c
...
...
@@ -1116,15 +1116,19 @@ bool buf_pool_t::create()
ut_ad
(
srv_buf_pool_size
>
0
);
ut_ad
(
!
resizing
);
ut_ad
(
!
chunks_old
);
ut_ad
(
!
field_ref_zero
);
/* mariabackup loads tablespaces, and it requires field_ref_zero to be
allocated before innodb initialization */
ut_ad
(
srv_operation
>=
SRV_OPERATION_RESTORE
||
!
field_ref_zero
);
NUMA_MEMPOLICY_INTERLEAVE_IN_SCOPE
;
if
(
auto
b
=
aligned_malloc
(
UNIV_PAGE_SIZE_MAX
,
4096
))
field_ref_zero
=
static_cast
<
const
byte
*>
(
memset_aligned
<
4096
>
(
b
,
0
,
UNIV_PAGE_SIZE_MAX
));
else
return
true
;
if
(
!
field_ref_zero
)
{
if
(
auto
b
=
aligned_malloc
(
UNIV_PAGE_SIZE_MAX
,
4096
))
field_ref_zero
=
static_cast
<
const
byte
*>
(
memset_aligned
<
4096
>
(
b
,
0
,
UNIV_PAGE_SIZE_MAX
));
else
return
true
;
}
chunk_t
::
map_reg
=
UT_NEW_NOKEY
(
chunk_t
::
map
());
...
...
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