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
63b9d6e7
Commit
63b9d6e7
authored
Feb 14, 2022
by
Vladislav Vaintroub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore the MDEV-26789 logic, partially lost in refactoring.
parent
3553cfd0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
17 deletions
+22
-17
storage/innobase/log/log0log.cc
storage/innobase/log/log0log.cc
+22
-17
No files found.
storage/innobase/log/log0log.cc
View file @
63b9d6e7
...
@@ -519,7 +519,8 @@ inline void log_t::persist(lsn_t lsn) noexcept
...
@@ -519,7 +519,8 @@ inline void log_t::persist(lsn_t lsn) noexcept
/** Write buf to ib_logfile0.
/** Write buf to ib_logfile0.
@tparam release_latch whether to invoke latch.wr_unlock()
@tparam release_latch whether to invoke latch.wr_unlock()
@return new write target
@return new write target
@retval 0 if everything was written */
@retval lsn of a callback pending on write_lock, or 0
*/
template
<
bool
release_latch
>
inline
lsn_t
log_t
::
write_buf
()
noexcept
template
<
bool
release_latch
>
inline
lsn_t
log_t
::
write_buf
()
noexcept
{
{
ut_ad
(
latch
.
is_write_locked
());
ut_ad
(
latch
.
is_write_locked
());
...
@@ -605,7 +606,9 @@ inline bool log_t::flush(lsn_t lsn) noexcept
...
@@ -605,7 +606,9 @@ inline bool log_t::flush(lsn_t lsn) noexcept
/** Ensure that previous log writes are durable.
/** Ensure that previous log writes are durable.
@param lsn previously written LSN
@param lsn previously written LSN
@return new durable lsn target
@return new durable lsn target
@retval 0 if everything was adequately written */
@retval 0, if there are no pending callbacks on flush_lock
or there is another group commit lead.
*/
static
lsn_t
log_flush
(
lsn_t
lsn
)
static
lsn_t
log_flush
(
lsn_t
lsn
)
{
{
ut_ad
(
!
log_sys
.
is_pmem
());
ut_ad
(
!
log_sys
.
is_pmem
());
...
@@ -653,29 +656,27 @@ void log_write_up_to(lsn_t lsn, bool durable,
...
@@ -653,29 +656,27 @@ void log_write_up_to(lsn_t lsn, bool durable,
flush_lock
.
acquire
(
lsn
,
callback
)
!=
group_commit_lock
::
ACQUIRED
)
flush_lock
.
acquire
(
lsn
,
callback
)
!=
group_commit_lock
::
ACQUIRED
)
return
;
return
;
lsn_t
write_lsn
;
lsn_t
pending_write_lsn
=
0
,
pending_flush_lsn
=
0
;
if
(
write_lock
.
acquire
(
lsn
,
durable
?
nullptr
:
callback
)
==
if
(
write_lock
.
acquire
(
lsn
,
durable
?
nullptr
:
callback
)
==
group_commit_lock
::
ACQUIRED
)
group_commit_lock
::
ACQUIRED
)
{
{
log_sys
.
latch
.
wr_lock
(
SRW_LOCK_CALL
);
log_sys
.
latch
.
wr_lock
(
SRW_LOCK_CALL
);
write_lsn
=
log_sys
.
write_buf
<
true
>
();
pending_
write_lsn
=
log_sys
.
write_buf
<
true
>
();
}
}
else
write_lsn
=
0
;
if
(
durable
)
if
(
durable
)
{
{
lsn
=
log_flush
(
write_lock
.
value
());
pending_flush_lsn
=
log_flush
(
write_lock
.
value
());
if
(
lsn
||
write_lsn
)
}
if
(
pending_write_lsn
||
pending_flush_lsn
)
{
{
/* There is no new group commit lead; some async waiters could stall. */
/* There is no new group commit lead; some async waiters could stall. */
callback
=
&
dummy_callback
;
callback
=
&
dummy_callback
;
if
(
write_lsn
>
lsn
)
lsn
=
std
::
max
(
pending_write_lsn
,
pending_flush_lsn
);
lsn
=
write_lsn
;
goto
repeat
;
goto
repeat
;
}
}
}
}
}
/** Write to the log file up to the last log entry.
/** Write to the log file up to the last log entry.
...
@@ -704,8 +705,12 @@ ATTRIBUTE_COLD void log_write_and_flush()
...
@@ -704,8 +705,12 @@ ATTRIBUTE_COLD void log_write_and_flush()
ut_ad
(
!
srv_read_only_mode
);
ut_ad
(
!
srv_read_only_mode
);
if
(
!
log_sys
.
is_pmem
())
if
(
!
log_sys
.
is_pmem
())
{
{
log_sys
.
write_buf
<
false
>
();
while
(
log_sys
.
write_buf
<
false
>
())
log_flush
(
write_lock
.
value
());
{
}
while
(
log_flush
(
write_lock
.
value
()))
{
}
}
}
#ifdef HAVE_PMEM
#ifdef HAVE_PMEM
else
else
...
...
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