summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--searchcore/src/tests/proton/reference/gid_to_lid_change_handler/gid_to_lid_change_handler_test.cpp8
-rw-r--r--searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_handler.cpp5
2 files changed, 10 insertions, 3 deletions
diff --git a/searchcore/src/tests/proton/reference/gid_to_lid_change_handler/gid_to_lid_change_handler_test.cpp b/searchcore/src/tests/proton/reference/gid_to_lid_change_handler/gid_to_lid_change_handler_test.cpp
index cddce944e4d..625e9c1f6a9 100644
--- a/searchcore/src/tests/proton/reference/gid_to_lid_change_handler/gid_to_lid_change_handler_test.cpp
+++ b/searchcore/src/tests/proton/reference/gid_to_lid_change_handler/gid_to_lid_change_handler_test.cpp
@@ -289,14 +289,18 @@ TEST_F("Test that out of order notifyRemoveDone is handled", StatsFixture)
TEST_DO(f.assertChanges(1, 1));
}
-TEST_F("Test that out of order notifyPutDone is handled", StatsFixture)
+TEST_F("Test that out of order notifyPutDone is partially handled", StatsFixture)
{
f.notifyRemove(toGid(doc1), 20);
TEST_DO(f.assertChanges(0, 1));
f.notifyPutDone(toGid(doc1), 12, 50);
TEST_DO(f.assertChanges(1, 1));
- f.notifyRemoveDone(toGid(doc1), 20);
+ f.notifyPutDone(toGid(doc1), 11, 40);
TEST_DO(f.assertChanges(1, 1));
+ f.notifyPutDone(toGid(doc1), 13, 55);
+ TEST_DO(f.assertChanges(2, 1));
+ f.notifyRemoveDone(toGid(doc1), 20);
+ TEST_DO(f.assertChanges(2, 1));
}
}
diff --git a/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_handler.cpp b/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_handler.cpp
index 341c5434623..bd3574327bc 100644
--- a/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_handler.cpp
+++ b/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_handler.cpp
@@ -57,7 +57,10 @@ GidToLidChangeHandler::notifyPutDone(GlobalId gid, uint32_t lid, SerialNum seria
if (entry.removeSerialNum > serialNum) {
return; // Document has already been removed later on
}
- assert(entry.putSerialNum < serialNum);
+ assert(entry.putSerialNum != serialNum);
+ if (entry.putSerialNum > serialNum) {
+ return; // Document has already been put later on
+ }
entry.putSerialNum = serialNum;
}
notifyPutDone(gid, lid);