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
949ae3ae
Commit
949ae3ae
authored
Jun 29, 2013
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#27 test case for big txn and checkpoint blocking other commits
parent
615490ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
src/tests/bigtxn27.cc
src/tests/bigtxn27.cc
+11
-0
No files found.
src/tests/bigtxn27.cc
View file @
949ae3ae
...
@@ -92,6 +92,8 @@ PATENT RIGHTS GRANT:
...
@@ -92,6 +92,8 @@ PATENT RIGHTS GRANT:
#include <pthread.h>
#include <pthread.h>
// verify that a commit of a big txn does not block the commits of other txn's
// verify that a commit of a big txn does not block the commits of other txn's
// commit writer happens before bigtxn commit happens before checkpoint
static
int
state
=
0
;
static
void
*
checkpoint_thread
(
void
*
arg
)
{
static
void
*
checkpoint_thread
(
void
*
arg
)
{
sleep
(
1
);
sleep
(
1
);
...
@@ -100,6 +102,7 @@ static void *checkpoint_thread(void *arg) {
...
@@ -100,6 +102,7 @@ static void *checkpoint_thread(void *arg) {
int
r
=
env
->
txn_checkpoint
(
env
,
0
,
0
,
0
);
int
r
=
env
->
txn_checkpoint
(
env
,
0
,
0
,
0
);
assert
(
r
==
0
);
assert
(
r
==
0
);
printf
(
"%s done
\n
"
,
__FUNCTION__
);
printf
(
"%s done
\n
"
,
__FUNCTION__
);
assert
(
toku_sync_fetch_and_add
(
&
state
,
1
)
==
2
);
return
arg
;
return
arg
;
}
}
...
@@ -129,6 +132,7 @@ static void *w_thread(void *arg) {
...
@@ -129,6 +132,7 @@ static void *w_thread(void *arg) {
r
=
txn
->
commit
(
txn
,
0
);
r
=
txn
->
commit
(
txn
,
0
);
assert
(
r
==
0
);
assert
(
r
==
0
);
printf
(
"%s done
\n
"
,
__FUNCTION__
);
printf
(
"%s done
\n
"
,
__FUNCTION__
);
assert
(
toku_sync_fetch_and_add
(
&
state
,
1
)
==
0
);
return
arg
;
return
arg
;
}
}
...
@@ -183,6 +187,13 @@ int test_main (int argc __attribute__((__unused__)), char *const argv[] __attrib
...
@@ -183,6 +187,13 @@ int test_main (int argc __attribute__((__unused__)), char *const argv[] __attrib
r
=
bigtxn
->
commit_with_progress
(
bigtxn
,
0
,
bigtxn_progress
,
NULL
);
r
=
bigtxn
->
commit_with_progress
(
bigtxn
,
0
,
bigtxn_progress
,
NULL
);
assert
(
r
==
0
);
assert
(
r
==
0
);
assert
(
toku_sync_fetch_and_add
(
&
state
,
1
)
==
1
);
void
*
ret
;
r
=
pthread_join
(
w_tid
,
&
ret
);
assert
(
r
==
0
);
r
=
pthread_join
(
checkpoint_tid
,
&
ret
);
assert
(
r
==
0
);
r
=
db
->
close
(
db
,
0
);
r
=
db
->
close
(
db
,
0
);
assert
(
r
==
0
);
assert
(
r
==
0
);
...
...
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