summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSulabh Mahajan <sulabh.mahajan@mongodb.com>2022-07-15 13:44:46 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-11-29 18:31:31 +0000
commit4b00c5844d1ad1b2695958822657a125b70e5c1f (patch)
tree895527fb6b8b918a285b7fb1ead3f50cbf7422bc
parent48476ee2af534a9efdd238f753ac7e271ec660dd (diff)
downloadmongo-4b00c5844d1ad1b2695958822657a125b70e5c1f.tar.gz
SERVER-66920 Fix assertion that didn't expect exact match for seek cursor
(cherry picked from commit f2678ea3658acd35548f770ebb68c15815b46040)
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp
index cd9a25c2930..a849fa04042 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp
@@ -1192,16 +1192,12 @@ protected:
LOGV2_TRACE_CURSOR(5683900, "cmp after advance: {cmp}", "cmp"_attr = cmp);
- // We do not expect any exact matches or matches of prefixes by comparing keys of
- // different lengths. Callers either seek using keys with discriminators that always
- // compare unequally, or in the case of restoring a cursor, perform exact searches. In
- // the case of an exact search, we will have returned earlier.
- dassert(cmp);
-
if (enforcingPrepareConflicts) {
// If we are enforcing prepare conflicts, calling next() or prev() must always give
// us a key that compares, respectively, greater than or less than our search key.
- dassert(_forward ? cmp > 0 : cmp < 0);
+ // An exact match is also possible in the case of _id indexes, because the recordid
+ // is not a part of the key.
+ dassert(_forward ? cmp >= 0 : cmp <= 0);
}
}