Commit a3b113d6 authored by Georgios Bitzes's avatar Georgios Bitzes
Browse files

Add quarkdb-version command to just retrieve the version of a running node

parent af0a5fb8
Pipeline #499918 failed with stages
in 62 minutes and 40 seconds
build/
deps/rocksdb/
deps/backward-cpp/
deps/googletest/
......@@ -137,6 +137,7 @@ struct cmdMapInit {
redis_cmd_map["quarkdb_manual_compaction"] = {RedisCommand::QUARKDB_MANUAL_COMPACTION, CommandType::QUARKDB};
redis_cmd_map["quarkdb_level_stats"] = {RedisCommand::QUARKDB_LEVEL_STATS, CommandType::QUARKDB};
redis_cmd_map["quarkdb_compression_stats"] = {RedisCommand::QUARKDB_COMPRESSION_STATS, CommandType::QUARKDB};
redis_cmd_map["quarkdb_version"] = {RedisCommand::QUARKDB_VERSION, CommandType::QUARKDB};
redis_cmd_map["recovery_info"] = {RedisCommand::RECOVERY_INFO, CommandType::RECOVERY};
redis_cmd_map["recovery_set"] = {RedisCommand::RECOVERY_SET, CommandType::RECOVERY};
......
......@@ -142,6 +142,7 @@ enum class RedisCommand {
QUARKDB_MANUAL_COMPACTION,
QUARKDB_LEVEL_STATS,
QUARKDB_COMPRESSION_STATS,
QUARKDB_VERSION,
RECOVERY_GET,
RECOVERY_SET,
......
......@@ -130,6 +130,9 @@ LinkStatus QuarkDBNode::dispatch(Connection *conn, RedisRequest &req) {
case RedisCommand::QUARKDB_INFO: {
return conn->statusVector(this->info().toVector());
}
case RedisCommand::QUARKDB_VERSION: {
return conn->string(VERSION_FULL_STRING);
}
case RedisCommand::CONVERT_STRING_TO_INT:
case RedisCommand::CONVERT_INT_TO_STRING: {
return conn->raw(handleConversion(req));
......
......@@ -27,6 +27,7 @@
#include "raft/RaftCommitTracker.hh"
#include "raft/RaftConfig.hh"
#include "raft/RaftContactDetails.hh"
#include "Version.hh"
#include "Poller.hh"
#include "Configuration.hh"
#include "QuarkDBNode.hh"
......@@ -1192,6 +1193,7 @@ TEST_F(Raft_e2e, smove) {
ASSERT_REPLY(tunnel(leaderID)->exec("smembers", "set1"), make_vec("i2", "i3", "i4", "i5"));
ASSERT_REPLY(tunnel(leaderID)->exec("smembers", "set2"), make_vec("i1", "t1", "t2", "t3", "t4", "t5"));
ASSERT_REPLY(tunnel(leaderID)->exec("quarkdb-manual-compaction"), "OK");
ASSERT_REPLY(tunnel(leaderID)->exec("quarkdb-version"), VERSION_FULL_STRING);
qdb_info(qclient::describeRedisReply(tunnel(leaderID)->exec("quarkdb-level-stats").get()));
qdb_info(qclient::describeRedisReply(tunnel(leaderID)->exec("quarkdb-compression-stats").get()));
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment