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
09b03ff3
Commit
09b03ff3
authored
Jun 23, 2021
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.3 into 10.4
parents
bf2680ea
1deb6304
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
16 deletions
+41
-16
storage/innobase/log/log0crypt.cc
storage/innobase/log/log0crypt.cc
+7
-1
storage/innobase/trx/trx0rseg.cc
storage/innobase/trx/trx0rseg.cc
+21
-4
storage/innobase/trx/trx0undo.cc
storage/innobase/trx/trx0undo.cc
+13
-11
No files found.
storage/innobase/log/log0crypt.cc
View file @
09b03ff3
/*****************************************************************************
Copyright (C) 2013, 2015, Google Inc. All Rights Reserved.
Copyright (C) 2014, 20
18
, MariaDB Corporation.
Copyright (C) 2014, 20
21
, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -104,6 +104,7 @@ static bool init_crypt_key(crypt_info_t* info, bool upgrade = false)
<<
info
->
key_version
<<
" failed ("
<<
rc
<<
"). Maybe the key or the required encryption "
"key management plugin was not found."
;
info
->
key_version
=
ENCRYPTION_KEY_VERSION_INVALID
;
return
false
;
}
...
...
@@ -123,6 +124,7 @@ static bool init_crypt_key(crypt_info_t* info, bool upgrade = false)
if
(
err
!=
MY_AES_OK
||
dst_len
!=
MY_AES_BLOCK_SIZE
)
{
ib
::
error
()
<<
"Getting redo log crypto key failed: err = "
<<
err
<<
", len = "
<<
dst_len
;
info
->
key_version
=
ENCRYPTION_KEY_VERSION_INVALID
;
return
false
;
}
...
...
@@ -317,6 +319,7 @@ log_crypt_101_read_block(byte* buf)
for
(
const
crypt_info_t
*
const
end
=
info
+
infos_used
;
info
<
end
;
info
++
)
{
if
(
info
->
key_version
&&
info
->
key_version
!=
ENCRYPTION_KEY_VERSION_INVALID
&&
info
->
checkpoint_no
==
checkpoint_no
)
{
goto
found
;
}
...
...
@@ -328,6 +331,9 @@ log_crypt_101_read_block(byte* buf)
/* MariaDB Server 10.1 would use the first key if it fails to
find a key for the current checkpoint. */
info
=
infos
;
if
(
info
->
key_version
==
ENCRYPTION_KEY_VERSION_INVALID
)
{
return
false
;
}
found:
byte
dst
[
OS_FILE_LOG_BLOCK_SIZE
];
uint
dst_len
;
...
...
storage/innobase/trx/trx0rseg.cc
View file @
09b03ff3
...
...
@@ -415,7 +415,7 @@ trx_rseg_mem_create(ulint id, fil_space_t* space, ulint page_no)
static
dberr_t
trx_undo_lists_init
(
trx_rseg_t
*
rseg
,
trx_id_t
&
max_trx_id
,
const
trx_rsegf_t
*
rseg_header
)
{
ut_ad
(
srv_force_recovery
<
SRV_FORCE_NO_UNDO_LOG_SCAN
);
ut_ad
(
srv_force_recovery
<
SRV_FORCE_NO_UNDO_LOG_SCAN
);
for
(
ulint
i
=
0
;
i
<
TRX_RSEG_N_SLOTS
;
i
++
)
{
...
...
@@ -569,6 +569,7 @@ dberr_t trx_rseg_array_init()
bool
wsrep_xid_in_rseg_found
=
false
;
#endif
mtr_t
mtr
;
dberr_t
err
=
DB_SUCCESS
;
for
(
ulint
rseg_id
=
0
;
rseg_id
<
TRX_SYS_N_RSEGS
;
rseg_id
++
)
{
mtr
.
start
();
...
...
@@ -598,10 +599,11 @@ dberr_t trx_rseg_array_init()
ut_ad
(
rseg
->
id
==
rseg_id
);
ut_ad
(
!
trx_sys
.
rseg_array
[
rseg_id
]);
trx_sys
.
rseg_array
[
rseg_id
]
=
rseg
;
if
(
dberr_t
err
=
trx_rseg_mem_restore
(
rseg
,
max_trx_id
,
&
mtr
))
{
if
((
err
=
trx_rseg_mem_restore
(
rseg
,
max_trx_id
,
&
mtr
))
!=
DB_SUCCESS
)
{
mtr
.
commit
();
return
err
;
break
;
}
#ifdef WITH_WSREP
if
(
!
wsrep_sys_xid
.
is_null
()
&&
...
...
@@ -622,6 +624,21 @@ dberr_t trx_rseg_array_init()
mtr
.
commit
();
}
if
(
err
!=
DB_SUCCESS
)
{
for
(
ulint
rseg_id
=
0
;
rseg_id
<
TRX_SYS_N_RSEGS
;
rseg_id
++
)
{
if
(
trx_rseg_t
*&
rseg
=
trx_sys
.
rseg_array
[
rseg_id
])
{
while
(
trx_undo_t
*
u
=
UT_LIST_GET_FIRST
(
rseg
->
undo_list
))
{
UT_LIST_REMOVE
(
rseg
->
undo_list
,
u
);
ut_free
(
u
);
}
trx_rseg_mem_free
(
rseg
);
rseg
=
NULL
;
}
}
return
err
;
}
#ifdef WITH_WSREP
if
(
!
wsrep_sys_xid
.
is_null
())
{
/* Upgrade from a version prior to 10.3.5,
...
...
storage/innobase/trx/trx0undo.cc
View file @
09b03ff3
...
...
@@ -1087,18 +1087,11 @@ trx_undo_mem_create_at_db_start(trx_rseg_t *rseg, ulint id, uint32_t page_no,
const
uint16_t
type
=
mach_read_from_2
(
TRX_UNDO_PAGE_HDR
+
TRX_UNDO_PAGE_TYPE
+
undo_page
);
switch
(
type
)
{
case
0
:
case
2
:
/* TRX_UNDO_UPDATE */
break
;
case
1
:
/* TRX_UNDO_INSERT */
sql_print_error
(
"InnoDB: upgrade from older version than"
" MariaDB 10.3 requires clean shutdown"
);
goto
corrupted
;
default:
if
(
UNIV_UNLIKELY
(
type
>
2
))
{
corrupted_type:
sql_print_error
(
"InnoDB: unsupported undo header type %u"
,
type
);
corrupted:
corrupted:
mtr
.
commit
();
return
nullptr
;
}
...
...
@@ -1118,12 +1111,21 @@ trx_undo_mem_create_at_db_start(trx_rseg_t *rseg, ulint id, uint32_t page_no,
switch
(
state
)
{
case
TRX_UNDO_ACTIVE
:
case
TRX_UNDO_PREPARED
:
break
;
if
(
UNIV_LIKELY
(
type
!=
1
))
{
break
;
}
sql_print_error
(
"InnoDB: upgrade from older version than"
" MariaDB 10.3 requires clean shutdown"
);
goto
corrupted
;
default:
sql_print_error
(
"InnoDB: unsupported undo header state %u"
,
state
);
goto
corrupted
;
case
TRX_UNDO_TO_PURGE
:
if
(
UNIV_UNLIKELY
(
type
==
1
))
{
goto
corrupted_type
;
}
/* fall through */
case
TRX_UNDO_CACHED
:
trx_id_t
id
=
mach_read_from_8
(
TRX_UNDO_TRX_NO
+
undo_header
);
if
(
id
>>
48
)
{
...
...
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