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

Remove raft-invalid-command, force a crash on raft dispatching error

parent 1e559553
......@@ -107,7 +107,6 @@ struct cmdMapInit {
redis_cmd_map["raft_remove_member"] = {RedisCommand::RAFT_REMOVE_MEMBER, CommandType::RAFT};
redis_cmd_map["raft_promote_observer"] = {RedisCommand::RAFT_PROMOTE_OBSERVER, CommandType::RAFT};
redis_cmd_map["raft_heartbeat"] = {RedisCommand::RAFT_HEARTBEAT, CommandType::RAFT};
redis_cmd_map["raft_invalid_command"] = {RedisCommand::RAFT_INVALID_COMMAND, CommandType::RAFT};
redis_cmd_map["raft_fetch_last"] = {RedisCommand::RAFT_FETCH_LAST, CommandType::RAFT};
redis_cmd_map["activate_stale_reads"] = {RedisCommand::ACTIVATE_STALE_READS, CommandType::RAFT};
......
......@@ -114,7 +114,6 @@ enum class RedisCommand {
RAFT_REMOVE_MEMBER,
RAFT_PROMOTE_OBSERVER,
RAFT_HEARTBEAT,
RAFT_INVALID_COMMAND, // used in tests
RAFT_FETCH_LAST,
ACTIVATE_STALE_READS,
......
......@@ -307,10 +307,7 @@ LinkStatus RaftDispatcher::service(Connection *conn, RedisRequest &req) {
}
// At this point, the received command *must* be a write - verify!
if(req.getCommandType() != CommandType::WRITE) {
qdb_critical("RaftDispatcher: unable to dispatch non-write command: " << req[0]);
return conn->err("internal dispatching error");
}
qdb_assert(req.getCommandType() == CommandType::WRITE);
// send request to the write tracker
std::lock_guard<std::mutex> lock(raftCommand);
......
......@@ -362,7 +362,6 @@ TEST_F(Raft_e2e, test_many_redis_commands) {
futures.emplace_back(tunnel(leaderID)->exec("sismember", "myhash", "b"));
futures.emplace_back(tunnel(leaderID)->exec("scard", "myhash"));
futures.emplace_back(tunnel(leaderID)->exec("scard", "does-not-exist"));
futures.emplace_back(tunnel(leaderID)->exec("raft_invalid_command"));
futures.emplace_back(tunnel(leaderID)->exec("quarkdb_invalid_command"));
futures.emplace_back(tunnel(leaderID)->exec("raft-fetch-last", "7", "raw"));
......@@ -390,7 +389,6 @@ TEST_F(Raft_e2e, test_many_redis_commands) {
ASSERT_REPLY(futures[count++], "ERR Invalid argument: WRONGTYPE Operation against a key holding the wrong kind of value");
ASSERT_REPLY(futures[count++], 0);
ASSERT_REPLY(futures[count++], "ERR internal dispatching error");
ASSERT_REPLY(futures[count++], "ERR internal dispatching error");
redisReplyPtr entries = futures[count++].get();
std::vector<RaftEntry> lastEntries;
......
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