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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
7f3631c2
Commit
7f3631c2
authored
Dec 08, 2008
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
ccfb9c32
e1ee25e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
5 deletions
+20
-5
storage/maria/ma_loghandler.c
storage/maria/ma_loghandler.c
+20
-5
No files found.
storage/maria/ma_loghandler.c
View file @
7f3631c2
...
...
@@ -1404,18 +1404,21 @@ LSN translog_get_file_max_lsn_stored(uint32 file)
SYNOPSIS
translog_buffer_init()
buffer The buffer to initialize
num Number of this buffer
RETURN
0 OK
1 Error
*/
static
my_bool
translog_buffer_init
(
struct
st_translog_buffer
*
buffer
)
static
my_bool
translog_buffer_init
(
struct
st_translog_buffer
*
buffer
,
int
num
)
{
DBUG_ENTER
(
"translog_buffer_init"
);
buffer
->
prev_last_lsn
=
buffer
->
last_lsn
=
LSN_IMPOSSIBLE
;
DBUG_PRINT
(
"info"
,
(
"last_lsn and prev_last_lsn set to 0 buffer: 0x%lx"
,
(
ulong
)
buffer
));
buffer
->
buffer_no
=
(
uint8
)
num
;
/* This Buffer File */
buffer
->
file
=
NULL
;
buffer
->
overlay
=
0
;
...
...
@@ -1430,10 +1433,23 @@ static my_bool translog_buffer_init(struct st_translog_buffer *buffer)
buffer
->
copy_to_buffer_in_progress
=
0
;
/* list of waiting buffer ready threads */
buffer
->
waiting_flush
=
0
;
/* lock for the buffer. Current buffer also lock the handler */
/*
Buffers locked by fallowing mutex. As far as buffers create logical
circle (after last buffer goes first) it trigger false alarm of deadlock
detect system, so we remove check of deadlock for this buffers. In deed
all mutex locks concentrated around current buffer except flushing
thread (but it is only one thread). One thread can't take more then
2 buffer locks at once. So deadlock is impossible here.
To prevent false alarm of dead lock detection we switch dead lock
detection for one buffer in the middle of the buffers chain. Excluding
only one of eight buffers from deadlock detection hardly can hide other
possible problems which include this mutexes.
*/
if
(
my_pthread_mutex_init
(
&
buffer
->
mutex
,
MY_MUTEX_INIT_FAST
,
"translog_buffer->mutex"
,
MYF_NO_DEADLOCK_DETECTION
)
||
(
num
==
TRANSLOG_BUFFERS_NO
-
2
?
MYF_NO_DEADLOCK_DETECTION
:
0
))
||
pthread_cond_init
(
&
buffer
->
prev_sent_to_disk_cond
,
0
))
DBUG_RETURN
(
1
);
buffer
->
is_closing_buffer
=
0
;
...
...
@@ -3555,9 +3571,8 @@ my_bool translog_init_with_table(const char *directory,
/* Buffers for log writing */
for
(
i
=
0
;
i
<
TRANSLOG_BUFFERS_NO
;
i
++
)
{
if
(
translog_buffer_init
(
log_descriptor
.
buffers
+
i
))
if
(
translog_buffer_init
(
log_descriptor
.
buffers
+
i
,
i
))
goto
err
;
log_descriptor
.
buffers
[
i
].
buffer_no
=
(
uint8
)
i
;
DBUG_PRINT
(
"info"
,
(
"translog_buffer buffer #%u: 0x%lx"
,
i
,
(
ulong
)
log_descriptor
.
buffers
+
i
));
}
...
...
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