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
66ae518a
Commit
66ae518a
authored
Apr 05, 2020
by
Vlad Lesin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some debug code
parent
00f0c039
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
101 additions
and
6 deletions
+101
-6
extra/mariabackup/write_filt.cc
extra/mariabackup/write_filt.cc
+40
-0
extra/mariabackup/xtrabackup.cc
extra/mariabackup/xtrabackup.cc
+27
-5
storage/innobase/fil/fil0crypt.cc
storage/innobase/fil/fil0crypt.cc
+1
-1
storage/innobase/fil/fil0fil.cc
storage/innobase/fil/fil0fil.cc
+33
-0
No files found.
extra/mariabackup/write_filt.cc
View file @
66ae518a
...
@@ -203,6 +203,15 @@ wf_wt_init(xb_write_filt_ctxt_t *ctxt, char *dst_name __attribute__((unused)),
...
@@ -203,6 +203,15 @@ wf_wt_init(xb_write_filt_ctxt_t *ctxt, char *dst_name __attribute__((unused)),
return
(
TRUE
);
return
(
TRUE
);
}
}
extern
bool
fil_space_verify_crypt_checksum
(
byte
*
page
,
const
page_size_t
&
page_size
,
ulint
space
,
ulint
offset
);
/************************************************************************
/************************************************************************
Write the next batch of pages to the destination datasink.
Write the next batch of pages to the destination datasink.
...
@@ -212,6 +221,37 @@ wf_wt_process(xb_write_filt_ctxt_t *ctxt, ds_file_t *dstfile)
...
@@ -212,6 +221,37 @@ wf_wt_process(xb_write_filt_ctxt_t *ctxt, ds_file_t *dstfile)
{
{
xb_fil_cur_t
*
cursor
=
ctxt
->
cursor
;
xb_fil_cur_t
*
cursor
=
ctxt
->
cursor
;
page_size_t
page_size_size
(
cursor
->
node
->
space
->
flags
);
if
(
cursor
->
node
->
space
->
id
!=
SRV_LOG_SPACE_FIRST_ID
&&
!
page_size_size
.
is_compressed
()
&&
// !FSP_FLAGS_GET_ZIP_SSIZE(cursor->node->space->flags) &&
!
FSP_FLAGS_HAS_PAGE_COMPRESSION
(
cursor
->
node
->
space
->
flags
)
&&
fil_is_user_tablespace_id
(
cursor
->
node
->
space
->
id
))
{
ulint
i
;
byte
*
page
;
const
ulint
page_size
=
cursor
->
page_size
.
physical
();
for
(
i
=
0
,
page
=
cursor
->
buf
;
i
<
cursor
->
buf_npages
;
i
++
,
page
+=
page_size
)
{
if
(
!
fil_space_verify_crypt_checksum
(
page
,
page_size_size
,
cursor
->
node
->
space
->
id
,
mach_read_from_4
(
page
+
FIL_PAGE_OFFSET
))
&&
mach_read_from_4
(
page
+
FIL_PAGE_LSN
+
4
)
!=
mach_read_from_4
(
page
+
UNIV_PAGE_SIZE
-
FIL_PAGE_END_LSN_OLD_CHKSUM
+
4
))
msg
(
"Warning: page %u of file %s, the LSN at the start %u "
"does match LSN at the end %u"
,
mach_read_from_4
(
page
+
FIL_PAGE_OFFSET
),
cursor
->
node
->
name
,
mach_read_from_4
(
page
+
FIL_PAGE_LSN
+
4
),
mach_read_from_4
(
page
+
UNIV_PAGE_SIZE
-
FIL_PAGE_END_LSN_OLD_CHKSUM
+
4
));
}
}
if
(
ds_write
(
dstfile
,
cursor
->
buf
,
cursor
->
buf_read
))
{
if
(
ds_write
(
dstfile
,
cursor
->
buf
,
cursor
->
buf_read
))
{
return
(
FALSE
);
return
(
FALSE
);
}
}
...
...
extra/mariabackup/xtrabackup.cc
View file @
66ae518a
...
@@ -4438,13 +4438,35 @@ xtrabackup_apply_delta(
...
@@ -4438,13 +4438,35 @@ xtrabackup_apply_delta(
}
}
}
}
success
=
os_file_write
(
IORequestWrite
,
dst_path
,
dst_file
,
buf
,
off
,
page_size
);
if
(
!
success
)
{
fil_space_t
*
space
=
fil_space_acquire
(
info
.
space_id
);
goto
error
;
if
(
space
)
{
page_size_t
page_size_size
(
space
->
flags
);
if
(
info
.
space_id
!=
SRV_LOG_SPACE_FIRST_ID
&&
fil_is_user_tablespace_id
(
info
.
space_id
)
&&
!
FSP_FLAGS_HAS_PAGE_COMPRESSION
(
space
->
flags
)
&&
!
page_size_size
.
is_compressed
()
&&
!
fil_space_verify_crypt_checksum
(
buf
,
page_size_size
,
info
.
space_id
,
mach_read_from_4
(
buf
+
FIL_PAGE_OFFSET
))
&&
(
mach_read_from_4
(
buf
+
FIL_PAGE_LSN
+
4
)
!=
mach_read_from_4
(
buf
+
UNIV_PAGE_SIZE
-
FIL_PAGE_END_LSN_OLD_CHKSUM
+
4
))
)
msg
(
"Warning: the LSN at the start %u does match LSN at the end %u "
"for tablespace %s"
,
mach_read_from_4
(
buf
+
FIL_PAGE_LSN
+
4
),
mach_read_from_4
(
buf
+
UNIV_PAGE_SIZE
-
FIL_PAGE_END_LSN_OLD_CHKSUM
+
4
),
filename
);
success
=
os_file_write
(
IORequestWrite
,
dst_path
,
dst_file
,
buf
,
off
,
page_size
);
if
(
!
success
)
{
goto
error
;
}
}
}
}
}
incremental_buffers
++
;
incremental_buffers
++
;
}
}
...
...
storage/innobase/fil/fil0crypt.cc
View file @
66ae518a
...
@@ -2529,7 +2529,7 @@ encrypted, or corrupted.
...
@@ -2529,7 +2529,7 @@ encrypted, or corrupted.
@param[in] space tablespace identifier
@param[in] space tablespace identifier
@param[in] offset page number
@param[in] offset page number
@return true if page is encrypted AND OK, false otherwise */
@return true if page is encrypted AND OK, false otherwise */
UNIV_INTERN
//
UNIV_INTERN
bool
bool
fil_space_verify_crypt_checksum
(
fil_space_verify_crypt_checksum
(
byte
*
page
,
byte
*
page
,
...
...
storage/innobase/fil/fil0fil.cc
View file @
66ae518a
...
@@ -5017,6 +5017,14 @@ fil_report_invalid_page_access(
...
@@ -5017,6 +5017,14 @@ fil_report_invalid_page_access(
:
""
);
:
""
);
}
}
extern
bool
fil_space_verify_crypt_checksum
(
byte
*
page
,
const
page_size_t
&
page_size
,
ulint
space
,
ulint
offset
);
/** Reads or writes data. This operation could be asynchronous (aio).
/** Reads or writes data. This operation could be asynchronous (aio).
@param[in,out] type IO context
@param[in,out] type IO context
...
@@ -5281,6 +5289,31 @@ fil_io(
...
@@ -5281,6 +5289,31 @@ fil_io(
req_type
.
set_fil_node
(
node
);
req_type
.
set_fil_node
(
node
);
ulint
page_type
=
mach_read_from_2
(
static_cast
<
byte
*>
(
buf
)
+
FIL_PAGE_TYPE
);
if
(
req_type
.
is_write
()
&&
page_id
.
space
()
!=
SRV_LOG_SPACE_FIRST_ID
&&
fil_is_user_tablespace_id
(
page_id
.
space
())
&&
!
page_size
.
is_compressed
()
#ifndef UNIV_INNOCHECKSUM
&&
!
FSP_FLAGS_HAS_PAGE_COMPRESSION
(
space
->
flags
)
#endif
&&
!
fil_space_verify_crypt_checksum
(
static_cast
<
byte
*>
(
buf
),
page_size
,
page_id
.
space
(),
page_id
.
page_no
())
&&
(
mach_read_from_4
(
static_cast
<
const
byte
*>
(
buf
)
+
FIL_PAGE_LSN
+
4
)
!=
mach_read_from_4
(
static_cast
<
const
byte
*>
(
buf
)
+
UNIV_PAGE_SIZE
-
FIL_PAGE_END_LSN_OLD_CHKSUM
+
4
)))
{
ib
::
error
()
<<
"Page write: log sequence number at the start "
<<
mach_read_from_4
(
static_cast
<
const
byte
*>
(
buf
)
+
FIL_PAGE_LSN
+
4
)
<<
" and the end "
<<
mach_read_from_4
(
static_cast
<
const
byte
*>
(
buf
)
+
UNIV_PAGE_SIZE
-
FIL_PAGE_END_LSN_OLD_CHKSUM
+
4
)
<<
" do not match"
;
}
/* Queue the aio request */
/* Queue the aio request */
dberr_t
err
=
os_aio
(
dberr_t
err
=
os_aio
(
req_type
,
req_type
,
...
...
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