Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sds
sds-keyval
Commits
618481a6
Commit
618481a6
authored
Mar 07, 2019
by
Matthieu Dorier
Browse files
missing lock when receiving database
parent
8956c438
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/sdskv-server.cc
View file @
618481a6
...
...
@@ -2245,8 +2245,13 @@ static int sdskv_pre_migration_callback(remi_fileset_t fileset, void* uargs)
db_root
.
resize
(
root_size
+
1
);
remi_fileset_get_root
(
fileset
,
db_root
.
data
(),
&
root_size
);
// (2) check that there isn't a database with the same name
if
(
provider
->
name2id
.
find
(
db_name
)
!=
provider
->
name2id
.
end
())
{
return
-
102
;
{
ABT_rdlock_wrlock
(
provider
->
lock
);
auto
unlock
=
at_exit
([
provider
]()
{
ABT_rwlock_unlock
(
provider
->
lock
);
});
if
(
provider
->
name2id
.
find
(
db_name
)
!=
provider
->
name2id
.
end
())
{
return
-
102
;
}
}
// (3) check that the type of database is ok to migrate
if
(
db_type
!=
"berkeleydb"
&&
db_type
!=
"leveldb"
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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