Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
eos
QuarkDB
Commits
11151dcb
Commit
11151dcb
authored
Mar 06, 2020
by
Georgios Bitzes
Browse files
Prevent crash when DEL is ran on a lease key
parent
c5d6a409
Pipeline
#1473204
failed with stages
in 48 minutes and 52 seconds
Changes
3
Pipelines
6
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
11151dcb
...
...
@@ -2,6 +2,11 @@
## Unreleased
### Bug fixes
-
Running
``DEL``
on a lease key would cause all nodes in a cluster to crash
with an assertion.
``DEL``
will now simply release the given lease, as if
``lease-release``
had been called.
### New features
-
Implement command
``quarkdb-verify-checksum``
for manually running a full checksum scan.
-
Addition of
``quarkdb-validate-checkpoint``
tool for ensuring that a given
...
...
src/StateMachine.cc
View file @
11151dcb
...
...
@@ -1732,6 +1732,9 @@ rocksdb::Status StateMachine::del(StagingArea &stagingArea, const ReqIterator &s
remove_all_with_prefix
(
indexLocator
.
toView
(),
count
,
stagingArea
);
if
(
count
!=
keyInfo
.
getSize
())
qdb_throw
(
"mismatch between keyInfo counter and number of elements deleted by remove_all_with_prefix: "
<<
count
<<
" vs "
<<
keyInfo
.
getSize
());
}
else
if
(
keyInfo
.
getKeyType
()
==
KeyType
::
kLease
)
{
THROW_ON_ERROR
(
lease_release
(
stagingArea
,
it
->
sv
(),
0u
));
}
else
{
qdb_throw
(
"DEL called on unknown keytype - should never happen"
);
}
...
...
test/e2e.cc
View file @
11151dcb
...
...
@@ -774,13 +774,13 @@ TEST_F(Raft_e2e, test_many_redis_commands) {
std
::
future
<
redisReplyPtr
>
l11
=
tunnel
(
leaderID
)
->
exec
(
"lease-acquire"
,
"mykey"
,
"holder2"
,
"10000"
);
std
::
future
<
redisReplyPtr
>
l12
=
tunnel
(
leaderID
)
->
exec
(
"lease-acquire"
,
"mykey"
,
"holder2"
,
"10000"
);
std
::
future
<
redisReplyPtr
>
l13
=
tunnel
(
leaderID
)
->
exec
(
"
lease-release
"
,
"mykey"
);
std
::
future
<
redisReplyPtr
>
l13
=
tunnel
(
leaderID
)
->
exec
(
"
del
"
,
"mykey"
);
std
::
future
<
redisReplyPtr
>
l14
=
tunnel
(
leaderID
)
->
exec
(
"lease-acquire"
,
"mykey"
,
"holder2"
,
"10000"
);
std
::
future
<
redisReplyPtr
>
l15
=
tunnel
(
leaderID
)
->
exec
(
"lease-get-pending-expiration-events"
);
ASSERT_REPLY
(
l11
,
"ACQUIRED"
);
ASSERT_REPLY
(
l12
,
"RENEWED"
);
ASSERT_REPLY
(
l13
,
"OK"
);
ASSERT_REPLY
(
l13
,
1
);
ASSERT_REPLY
(
l14
,
"ACQUIRED"
);
l15
.
get
();
// ignore for now..
...
...
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