diff options
author | Justin Seyster <justin.seyster@mongodb.com> | 2020-01-10 16:52:07 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-01-17 22:06:40 +0000 |
commit | 8e810c9ff48db40e63b3201f8bd4d0bf4fdea8ce (patch) | |
tree | 0c005cbcd82f7a3e167fdb1e704b89b3c69e0054 /src/mongo/db/exec/text_or.cpp | |
parent | 91d9714e6ddd83f6a215c7a159b15dacc68a8701 (diff) | |
download | mongo-8e810c9ff48db40e63b3201f8bd4d0bf4fdea8ce.tar.gz |
SERVER-40620 uassert and log when fetching dangling index entry
If a FETCH_STAGE encounters a record id that does not reference any
existing documents, that means either the document was deleted since
query execution encountered the index entry or their is corruption
somewhere. If the snapshot id indicates that the query has not yielded
since the time that the index entry was loaded, that leaves corruption
as the only possibility. We return and error and write to the log with
instructions on how to address potentially inconsistent data.
create mode 100644 jstests/noPassthrough/query_yields_catch_index_corruption.js
Diffstat (limited to 'src/mongo/db/exec/text_or.cpp')
-rw-r--r-- | src/mongo/db/exec/text_or.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mongo/db/exec/text_or.cpp b/src/mongo/db/exec/text_or.cpp index 3bd267271da..8202ad623c7 100644 --- a/src/mongo/db/exec/text_or.cpp +++ b/src/mongo/db/exec/text_or.cpp @@ -268,7 +268,8 @@ PlanStage::StageState TextOrStage::addTerm(WorkingSetID wsid, WorkingSetID* out) // Our parent expects RID_AND_OBJ members, so we fetch the document here if we haven't // already. try { - if (!WorkingSetCommon::fetch(getOpCtx(), _ws, wsid, _recordCursor)) { + if (!WorkingSetCommon::fetch( + getOpCtx(), _ws, wsid, _recordCursor, collection()->ns())) { _ws->free(wsid); textRecordData->score = -1; return NEED_TIME; |