Commit 401024a2 authored by Georgios Bitzes's avatar Georgios Bitzes
Browse files

Fix incorrect end-of-iteration cursor returned by deque-scan-back

parent ed0461e9
Pipeline #1102497 passed with stages
in 47 minutes and 2 seconds
......@@ -2,6 +2,8 @@
All notable changes to this project will be documented in this file.
## Unreleased
- ``deque-scan-back`` was returning wrong cursor to signal end of iteration: ``next:0``
while it should have been ``0``.
- A race condition was sometimes causing elections to fail spuriously, making
the election of a stable leader to require slightly more rounds than it should have.
- Implementation of health indicators through ``QUARKDB-HEALTH`` command.
......
......@@ -792,7 +792,7 @@ rocksdb::Status StateMachine::dequeScanBack(StagingArea &stagingArea, std::strin
if(isWrongType(keyinfo, KeyType::kDeque)) return wrong_type();
if(keyinfo.getSize() == 0) {
newCursor = "0";
newCursor = "";
return rocksdb::Status::OK();
}
......@@ -813,7 +813,7 @@ rocksdb::Status StateMachine::dequeScanBack(StagingArea &stagingArea, std::strin
uint64_t startingMarker = cursorMarker - count;
if(startingMarker <= keyinfo.getStartIndex() + 1) {
newCursor = "0";
newCursor = "";
startingMarker = keyinfo.getStartIndex() + 1;
}
else {
......
......@@ -621,7 +621,7 @@ TEST_F(Raft_e2e, test_many_redis_commands) {
" 3) \"9\"\n");
ASSERT_REPLY_DESCRIBE(futures[i++],
"1) \"next:0\"\n"
"1) \"0\"\n"
"2) 1) \"1\"\n"
" 2) \"2\"\n"
" 3) \"3\"\n"
......@@ -640,13 +640,13 @@ TEST_F(Raft_e2e, test_many_redis_commands) {
);
ASSERT_REPLY_DESCRIBE(futures[i++],
"1) \"next:0\"\n"
"1) \"0\"\n"
"2) 1) \"1\"\n"
" 2) \"2\"\n"
" 3) \"3\"\n");
ASSERT_REPLY_DESCRIBE(futures[i++],
"1) \"next:0\"\n"
"1) \"0\"\n"
"2) 1) \"1\"\n"
" 2) \"2\"\n"
" 3) \"3\"\n");
......@@ -657,27 +657,27 @@ TEST_F(Raft_e2e, test_many_redis_commands) {
" 2) \"3\"\n");
ASSERT_REPLY_DESCRIBE(futures[i++],
"1) \"next:0\"\n"
"1) \"0\"\n"
"2) 1) \"1\"\n");
ASSERT_REPLY_DESCRIBE(futures[i++],
"1) \"next:0\"\n"
"1) \"0\"\n"
"2) 1) \"1\"\n");
ASSERT_REPLY_DESCRIBE(futures[i++],
"1) \"next:0\"\n"
"1) \"0\"\n"
"2) (empty list or set)\n");
ASSERT_REPLY_DESCRIBE(futures[i++],
"1) \"next:0\"\n"
"1) \"0\"\n"
"2) (empty list or set)\n");
ASSERT_REPLY_DESCRIBE(futures[i++],
"1) \"next:0\"\n"
"1) \"0\"\n"
"2) (empty list or set)\n");
ASSERT_REPLY_DESCRIBE(futures[i++],
"1) \"next:0\"\n"
"1) \"0\"\n"
"2) (empty list or set)\n");
ASSERT_REPLY_DESCRIBE(futures[i++],
......@@ -699,7 +699,7 @@ TEST_F(Raft_e2e, test_many_redis_commands) {
" 3) \"9\"\n");
ASSERT_REPLY_DESCRIBE(futures[i++],
"1) \"next:0\"\n"
"1) \"0\"\n"
"2) (empty list or set)\n");
// Now test qclient callbacks, ensure things stay reasonable when we mix them
......
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