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
891d4246
Commit
891d4246
authored
Feb 19, 2020
by
Georgios Bitzes
Browse files
Implement quarkdb-verify-checksum command
parent
4af91997
Pipeline
#1431171
passed with stages
in 74 minutes and 23 seconds
Changes
5
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
891d4246
...
...
@@ -2,6 +2,9 @@
## Unreleased
### New features
-
Implement command
``quarkdb-verify-checksum``
for manually running a full checksum scan.
### Improvements
-
Security hardening of the redis parser for unauthenticated clients.
-
Package and distribute
``quarkdb-ldb``
tool based on the one provided by RocksDB.
...
...
src/Commands.cc
View file @
891d4246
...
...
@@ -155,6 +155,7 @@ struct cmdMapInit {
redis_cmd_map
[
"quarkdb_version"
]
=
{
RedisCommand
::
QUARKDB_VERSION
,
CommandType
::
QUARKDB
};
redis_cmd_map
[
"quarkdb_checkpoint"
]
=
{
RedisCommand
::
QUARKDB_CHECKPOINT
,
CommandType
::
QUARKDB
};
redis_cmd_map
[
"quarkdb_health"
]
=
{
RedisCommand
::
QUARKDB_HEALTH
,
CommandType
::
QUARKDB
};
redis_cmd_map
[
"quarkdb_verify_checksum"
]
=
{
RedisCommand
::
QUARKDB_VERIFY_CHECKSUM
,
CommandType
::
QUARKDB
};
// Compatibility: Keep raft_checkpoint, make identical to quarkdb_checkpoint.
// Maybe remove in a few versions.
...
...
src/Commands.hh
View file @
891d4246
...
...
@@ -162,6 +162,7 @@ enum class RedisCommand {
QUARKDB_VERSION
,
QUARKDB_CHECKPOINT
,
QUARKDB_HEALTH
,
QUARKDB_VERIFY_CHECKSUM
,
RECOVERY_GET
,
RECOVERY_SET
,
...
...
src/Shard.cc
View file @
891d4246
...
...
@@ -258,6 +258,19 @@ LinkStatus Shard::dispatch(Connection *conn, RedisRequest &req) {
stateMachine
->
getRequestCounter
().
fillHistorical
(
headers
,
data
);
return
conn
->
raw
(
Formatter
::
vectorsWithHeaders
(
headers
,
data
));
}
case
RedisCommand
::
QUARKDB_VERIFY_CHECKSUM
:
{
if
(
req
.
size
()
!=
1
)
return
conn
->
errArgs
(
req
[
0
]);
InFlightRegistration
registration
(
inFlightTracker
);
if
(
!
registration
.
ok
())
{
return
conn
->
err
(
"unavailable"
);
}
rocksdb
::
Status
st
=
stateMachine
->
verifyChecksum
();
std
::
vector
<
std
::
string
>
output
;
output
.
emplace_back
(
SSTR
(
"state-machine: "
<<
st
.
ToString
()));
return
conn
->
statusVector
(
output
);
}
default:
{
if
(
req
.
getCommandType
()
==
CommandType
::
QUARKDB
)
{
qdb_critical
(
"Unable to dispatch command '"
<<
req
[
0
]
<<
"' of type QUARKDB"
);
...
...
test/e2e.cc
View file @
891d4246
...
...
@@ -821,6 +821,11 @@ TEST_F(Raft_e2e, test_many_redis_commands) {
"3)
\"
12345
\"\n
"
"4)
\"
1
\"\n
"
);
ASSERT_REPLY_DESCRIBE
(
tunnel
(
leaderID
)
->
exec
(
"quarkdb-verify-checksum"
).
get
(),
"1) state-machine: OK
\n
"
);
}
TEST_F
(
Raft_e2e
,
DequeTrimming
)
{
...
...
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