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
330ecb90
Commit
330ecb90
authored
Mar 27, 2018
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-12266: fsp_flags_try_adjust(): Remove lookup
parent
05863142
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
20 deletions
+15
-20
storage/innobase/fil/fil0fil.cc
storage/innobase/fil/fil0fil.cc
+11
-14
storage/innobase/include/fil0fil.h
storage/innobase/include/fil0fil.h
+2
-4
storage/innobase/srv/srv0start.cc
storage/innobase/srv/srv0start.cc
+2
-2
No files found.
storage/innobase/fil/fil0fil.cc
View file @
330ecb90
...
...
@@ -3514,7 +3514,8 @@ fil_ibd_open(
mutex_exit
(
&
fil_system
.
mutex
);
if
(
err
==
DB_SUCCESS
&&
validate
&&
!
srv_read_only_mode
)
{
fsp_flags_try_adjust
(
id
,
flags
&
~
FSP_FLAGS_MEM_MASK
);
fsp_flags_try_adjust
(
space
,
flags
&
~
FSP_FLAGS_MEM_MASK
);
}
return
err
;
...
...
@@ -3816,7 +3817,8 @@ fil_ibd_open(
df_remote
.
close
();
df_dict
.
close
();
df_default
.
close
();
fsp_flags_try_adjust
(
id
,
flags
&
~
FSP_FLAGS_MEM_MASK
);
fsp_flags_try_adjust
(
space
,
flags
&
~
FSP_FLAGS_MEM_MASK
);
}
}
...
...
@@ -4218,28 +4220,22 @@ fil_report_missing_tablespace(
/** Try to adjust FSP_SPACE_FLAGS if they differ from the expectations.
(Typically when upgrading from MariaDB 10.1.0..10.1.20.)
@param[in
] space_id tablespace ID
@param[in
,out] space tablespace
@param[in] flags desired tablespace flags */
UNIV_INTERN
void
fsp_flags_try_adjust
(
ulint
space_id
,
ulint
flags
)
void
fsp_flags_try_adjust
(
fil_space_t
*
space
,
ulint
flags
)
{
ut_ad
(
!
srv_read_only_mode
);
ut_ad
(
fsp_flags_is_valid
(
flags
,
space_id
));
mutex_enter
(
&
fil_system
.
mutex
);
fil_space_t
*
space
=
fil_space_get_space
(
space_id
);
if
(
!
space
||
!
space
->
size
)
{
mutex_exit
(
&
fil_system
.
mutex
);
ut_ad
(
fsp_flags_is_valid
(
flags
,
space
->
id
));
if
(
!
space
->
size
)
{
return
;
}
/* This code is executed during server startup while no
connections are allowed. We do not need to protect against
DROP TABLE by fil_space_acquire(). */
mutex_exit
(
&
fil_system
.
mutex
);
mtr_t
mtr
;
mtr
.
start
();
if
(
buf_block_t
*
b
=
buf_page_get
(
page_id_t
(
space
_
id
,
0
),
page_size_t
(
flags
),
page_id_t
(
space
->
id
,
0
),
page_size_t
(
flags
),
RW_X_LATCH
,
&
mtr
))
{
ulint
f
=
fsp_header_get_flags
(
b
->
frame
);
/* Suppress the message if only the DATA_DIR flag to differs. */
...
...
@@ -4330,7 +4326,8 @@ fil_space_for_table_exists_in_mem(
mutex_exit
(
&
fil_system
.
mutex
);
if
(
valid
&&
!
srv_read_only_mode
)
{
fsp_flags_try_adjust
(
id
,
expected_flags
&
~
FSP_FLAGS_MEM_MASK
);
fsp_flags_try_adjust
(
space
,
expected_flags
&
~
FSP_FLAGS_MEM_MASK
);
}
return
(
valid
);
...
...
storage/innobase/include/fil0fil.h
View file @
330ecb90
...
...
@@ -1037,11 +1037,9 @@ fil_ibd_create(
/** Try to adjust FSP_SPACE_FLAGS if they differ from the expectations.
(Typically when upgrading from MariaDB 10.1.0..10.1.20.)
@param[in
] space_id tablespace ID
@param[in
,out] space tablespace
@param[in] flags desired tablespace flags */
UNIV_INTERN
void
fsp_flags_try_adjust
(
ulint
space_id
,
ulint
flags
);
void
fsp_flags_try_adjust
(
fil_space_t
*
space
,
ulint
flags
);
/********************************************************************//**
Tries to open a single-table tablespace and optionally checks the space id is
...
...
storage/innobase/srv/srv0start.cc
View file @
330ecb90
...
...
@@ -2240,8 +2240,8 @@ innobase_start_or_create_for_mysql()
if
(
!
srv_read_only_mode
)
{
const
ulint
flags
=
FSP_FLAGS_PAGE_SSIZE
();
for
(
ulint
id
=
0
;
id
<=
srv_undo_tablespaces
;
id
++
)
{
if
(
fil_space_get
(
id
))
{
fsp_flags_try_adjust
(
id
,
flags
);
if
(
fil_space_
t
*
space
=
fil_space_
get
(
id
))
{
fsp_flags_try_adjust
(
space
,
flags
);
}
}
...
...
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