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
2b1c719a
Commit
2b1c719a
authored
Mar 29, 2010
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Atomic operation removed because we do not need it.
parent
cbcbb052
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
28 deletions
+16
-28
storage/maria/ma_loghandler.c
storage/maria/ma_loghandler.c
+16
-28
No files found.
storage/maria/ma_loghandler.c
View file @
2b1c719a
...
@@ -8060,18 +8060,14 @@ retest:
...
@@ -8060,18 +8060,14 @@ retest:
/* keep values for soft sync() and forced sync() actual */
/* keep values for soft sync() and forced sync() actual */
{
{
uint32
fileno
=
LSN_FILE_NO
(
lsn
);
uint32
fileno
=
LSN_FILE_NO
(
lsn
);
my_atomic_rwlock_wrlock
(
&
soft_sync_rwl
);
soft_sync_min
=
fileno
;
my_atomic_store32
(
&
soft_sync_min
,
fileno
);
soft_sync_max
=
fileno
;
my_atomic_store32
(
&
soft_sync_max
,
fileno
);
my_atomic_rwlock_wrunlock
(
&
soft_sync_rwl
);
}
}
}
}
else
else
{
{
my_atomic_rwlock_wrlock
(
&
soft_sync_rwl
);
soft_sync_max
=
lsn
;
my_atomic_store32
(
&
soft_sync_max
,
LSN_FILE_NO
(
lsn
));
soft_need_sync
=
1
;
my_atomic_store32
(
&
soft_need_sync
,
1
);
my_atomic_rwlock_wrunlock
(
&
soft_sync_rwl
);
}
}
DBUG_ASSERT
(
flush_horizon
<=
log_descriptor
.
horizon
);
DBUG_ASSERT
(
flush_horizon
<=
log_descriptor
.
horizon
);
...
@@ -8464,9 +8460,7 @@ my_bool translog_purge(TRANSLOG_ADDRESS low)
...
@@ -8464,9 +8460,7 @@ my_bool translog_purge(TRANSLOG_ADDRESS low)
translog_status
==
TRANSLOG_READONLY
);
translog_status
==
TRANSLOG_READONLY
);
soft
=
soft_sync
;
soft
=
soft_sync
;
my_atomic_rwlock_wrlock
(
&
soft_sync_rwl
);
min_unsync
=
soft_sync_min
;
min_unsync
=
my_atomic_load32
(
&
soft_sync_min
);
my_atomic_rwlock_wrunlock
(
&
soft_sync_rwl
);
DBUG_PRINT
(
"info"
,
(
"min_unsync: %lu"
,
(
ulong
)
min_unsync
));
DBUG_PRINT
(
"info"
,
(
"min_unsync: %lu"
,
(
ulong
)
min_unsync
));
if
(
soft
&&
min_unsync
<
last_need_file
)
if
(
soft
&&
min_unsync
<
last_need_file
)
{
{
...
@@ -8748,9 +8742,7 @@ void translog_sync()
...
@@ -8748,9 +8742,7 @@ void translog_sync()
uint32
min
;
uint32
min
;
DBUG_ENTER
(
"ma_translog_sync"
);
DBUG_ENTER
(
"ma_translog_sync"
);
my_atomic_rwlock_rdlock
(
&
soft_sync_rwl
);
min
=
soft_sync_min
;
min
=
my_atomic_load32
(
&
soft_sync_min
);
my_atomic_rwlock_rdunlock
(
&
soft_sync_rwl
);
if
(
!
min
)
if
(
!
min
)
min
=
max
;
min
=
max
;
...
@@ -8796,13 +8788,11 @@ ma_soft_sync_background( void *arg __attribute__((unused)))
...
@@ -8796,13 +8788,11 @@ ma_soft_sync_background( void *arg __attribute__((unused)))
ulonglong
prev_loop
=
my_micro_time
();
ulonglong
prev_loop
=
my_micro_time
();
ulonglong
time
,
sleep
;
ulonglong
time
,
sleep
;
uint32
min
,
max
,
sync_request
;
uint32
min
,
max
,
sync_request
;
my_atomic_rwlock_rdlock
(
&
soft_sync_rwl
);
min
=
soft_sync_min
;
min
=
my_atomic_load32
(
&
soft_sync_min
);
max
=
soft_sync_max
;
max
=
my_atomic_load32
(
&
soft_sync_max
);
sync_request
=
soft_need_sync
;
sync_request
=
my_atomic_load32
(
&
soft_need_sync
);
soft_sync_min
=
max
;
my_atomic_store32
(
&
soft_sync_min
,
max
);
soft_need_sync
=
0
;
my_atomic_store32
(
&
soft_need_sync
,
0
);
my_atomic_rwlock_rdunlock
(
&
soft_sync_rwl
);
sleep
=
group_commit_wait
;
sleep
=
group_commit_wait
;
if
(
sync_request
)
if
(
sync_request
)
...
@@ -8834,15 +8824,13 @@ int translog_soft_sync_start(void)
...
@@ -8834,15 +8824,13 @@ int translog_soft_sync_start(void)
DBUG_ENTER
(
"translog_soft_sync_start"
);
DBUG_ENTER
(
"translog_soft_sync_start"
);
/* check and init variables */
/* check and init variables */
my_atomic_rwlock_rdlock
(
&
soft_sync_rwl
);
min
=
soft_sync_min
;
min
=
my_atomic_load32
(
&
soft_sync_min
);
max
=
soft_sync_max
;
max
=
my_atomic_load32
(
&
soft_sync_max
);
if
(
!
max
)
if
(
!
max
)
my_atomic_store32
(
&
soft_sync_max
,
(
max
=
get_current_logfile
()
->
number
))
;
soft_sync_max
=
max
=
get_current_logfile
()
->
number
;
if
(
!
min
)
if
(
!
min
)
my_atomic_store32
(
&
soft_sync_min
,
max
);
soft_sync_min
=
max
;
my_atomic_store32
(
&
soft_need_sync
,
1
);
soft_need_sync
=
1
;
my_atomic_rwlock_rdunlock
(
&
soft_sync_rwl
);
if
(
!
(
res
=
ma_service_thread_control_init
(
&
soft_sync_control
)))
if
(
!
(
res
=
ma_service_thread_control_init
(
&
soft_sync_control
)))
if
(
!
(
res
=
pthread_create
(
&
th
,
NULL
,
ma_soft_sync_background
,
NULL
)))
if
(
!
(
res
=
pthread_create
(
&
th
,
NULL
,
ma_soft_sync_background
,
NULL
)))
...
...
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