Commit 8ad0d6fb authored by Georgios Bitzes's avatar Georgios Bitzes
Browse files

Prevent crashing when LHSCAN is provided with a cursor missing the field component

parent fe1b02f1
Pipeline #856032 passed with stages
in 40 minutes
# Changelog
All notable changes to this project will be documented in this file.
## Unreleased
- Prevent crashing when ``LHSCAN`` is provided with a cursor missing the field
component.
## 0.3.7 (2019-04-24)
- Heavy use of lease commands could cause performance degradation and latency
spikes, due to accumulation of long-lived deletion tombstones on expiration
......
......@@ -193,7 +193,6 @@ public:
}
void resetField(std::string_view field) {
qdb_assert(!field.empty());
qdb_assert(localityPrefixSize != 0);
keyBuffer.shrink(localityPrefixSize);
......
......@@ -1550,6 +1550,7 @@ TEST_F(Raft_e2e, LocalityHash) {
replies.emplace_back(tunnel(leaderID)->exec("lhscan", "mykey", "0" ));
replies.emplace_back(tunnel(leaderID)->exec("lhscan", "mykey", "0", "COUNT", "2" ));
replies.emplace_back(tunnel(leaderID)->exec("lhscan", "mykey", "next:hint3##f1", "COUNT", "2" ));
replies.emplace_back(tunnel(leaderID)->exec("lhscan", "mykey", "next:hint3##", "COUNT", "5"));
ASSERT_REPLY_DESCRIBE(replies[0],
"1) \"0\"\n"
......@@ -1581,6 +1582,13 @@ TEST_F(Raft_e2e, LocalityHash) {
" 3) \"v3\"\n"
);
ASSERT_REPLY_DESCRIBE(replies[3],
"1) \"0\"\n"
"2) 1) \"hint3\"\n"
" 2) \"f1\"\n"
" 3) \"v3\"\n"
);
// Now test with evil characters, too
replies.clear();
replies.emplace_back(tunnel(leaderID)->exec("lhset", "my#key", "f#1", "hint#1", "v1"));
......
Markdown is supported
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