[SERVER-66920] Crash in debug builds due to WiredTigerIndexCursorBase::seekWTCursor assertion not following search_near comparison semantics Created: 01/Jun/22  Updated: 29/Oct/23  Resolved: 15/Jul/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.0.4, 6.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Josef Ahmad Assignee: Sulabh Mahajan
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Duplicate
is duplicated by SERVER-66917 InsertAndSeekKeyString unit test shou... Closed
Related
is related to WT-9323 Fix a race tracking whether a tree ha... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v6.0
Steps To Reproduce:

Apply the following patch (this comment from a ticket where the issue was first observed)

--- a/src/third_party/wiredtiger/src/btree/bt_delete.c
+++ b/src/third_party/wiredtiger/src/btree/bt_delete.c
@@ -318,6 +318,9 @@ __wt_delete_page_instantiate(WT_SESSION_IMPL *session, WT_REF *ref)
     if (btree->modified)
         __wt_page_modify_set(session, page);
 
+    /* Hack to get these fast deleted pages scheduled for eviction regularly */
+    __wt_page_evict_soon(session, ref);
+
     /* Allocate the per-page update array if one doesn't already exist. */
     if (page->entries != 0 && page->modify->mod_row_update == NULL)
         WT_PAGE_ALLOC_AND_SWAP(

Run the unit test:

ninja +storage_wiredtiger_record_store_and_index_test

Sprint: Execution Team 2022-06-27, Execution Team 2022-07-11, Execution Team 2022-07-25
Participants:
Linked BF Score: 129

 Description   

The comparison between the cursor's current key and the search key should follow the same semantics as the previous search_near call, whereby a search key that is fully a prefix of a larger cursor key should return that we've landed past the search key (or after the search key for a backward cursor).

Failing to do so can fail this assertion on debug builds. This happens when search_near lands - by design - on a key that is lower than the search key (or after the search key on backward cursors).



 Comments   
Comment by Githook User [ 29/Nov/22 ]

Author:

{'name': 'Sulabh Mahajan', 'email': 'sulabh.mahajan@mongodb.com', 'username': 'sulabhM'}

Message: SERVER-66920 Fix assertion that didn't expect exact match for seek cursor

(cherry picked from commit f2678ea3658acd35548f770ebb68c15815b46040)
Branch: v6.0
https://github.com/mongodb/mongo/commit/4b00c5844d1ad1b2695958822657a125b70e5c1f

Comment by Githook User [ 15/Jul/22 ]

Author:

{'name': 'Sulabh Mahajan', 'email': 'sulabh.mahajan@mongodb.com', 'username': 'sulabhM'}

Message: SERVER-66920 Fix assertion that didn't expect exact match for seek cursor
Branch: master
https://github.com/mongodb/mongo/commit/f2678ea3658acd35548f770ebb68c15815b46040

Generated at Thu Feb 08 06:06:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.