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
6f26619e
Commit
6f26619e
authored
Sep 24, 2018
by
Georgios Bitzes
Browse files
Prevent cluster from crashing when a read-only MULTI follows a read-write one
parent
3c1ee3e2
Pipeline
#521073
passed with stages
in 28 minutes
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
6f26619e
...
...
@@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.
## Unreleased
-
Updated rocksdb dependency to v5.15.10.
-
Added
`TYPE`
command.
-
A read-only MULTI immediatelly after a read-write MULTI could
cause the cluster to crash.
## 0.3.3 (2018-09-14)
...
...
src/redis/Transaction.cc
View file @
6f26619e
...
...
@@ -131,6 +131,8 @@ bool Transaction::deserialize(const std::string &src) {
void
Transaction
::
clear
()
{
requests
.
clear
();
phantom
=
false
;
hasWrites
=
false
;
}
std
::
string
Transaction
::
getFusedCommand
()
const
{
...
...
test/multi.cc
View file @
6f26619e
...
...
@@ -122,6 +122,25 @@ TEST_F(Multi, HandlerBasicSanity) {
replies
.
clear
();
ASSERT_REPLY
(
tunnel
(
leaderID
)
->
exec
(
"EXEC"
),
"ERR EXEC without MULTI"
);
ASSERT_REPLY
(
tunnel
(
leaderID
)
->
exec
(
"HGET"
,
"myhash"
,
"f1"
),
"v1"
);
// Read MULTI-EXEC right after a write
replies
.
clear
();
replies
.
push_back
(
tunnel
(
leaderID
)
->
exec
(
"MULTI"
));
replies
.
push_back
(
tunnel
(
leaderID
)
->
exec
(
"SET"
,
"abc"
,
"123"
));
replies
.
push_back
(
tunnel
(
leaderID
)
->
exec
(
"EXEC"
));
ASSERT_REPLY
(
replies
[
0
],
"OK"
);
ASSERT_REPLY
(
replies
[
1
],
"QUEUED"
);
ASSERT_REPLY_DESCRIBE
(
replies
[
2
],
"1) OK
\n
"
);
replies
.
clear
();
replies
.
push_back
(
tunnel
(
leaderID
)
->
exec
(
"MULTI"
));
replies
.
push_back
(
tunnel
(
leaderID
)
->
exec
(
"GET"
,
"abc"
));
replies
.
push_back
(
tunnel
(
leaderID
)
->
exec
(
"EXEC"
));
ASSERT_REPLY
(
replies
[
0
],
"OK"
);
ASSERT_REPLY
(
replies
[
1
],
"QUEUED"
);
ASSERT_REPLY_DESCRIBE
(
replies
[
2
],
"1)
\"
123
\"\n
"
);
}
TEST_F
(
Multi
,
WithRaft
)
{
...
...
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