[SERVER-82730] The validate cmd can invariant on corrupted keystrings Created: 02/Nov/23  Updated: 29/Nov/23  Resolved: 17/Nov/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.3.0-rc0, 7.2.0-rc2, 4.4.27, 7.0.5, 6.0.13, 5.0.24

Type: Bug Priority: Major - P3
Reporter: Yuhong Zhang Assignee: Yuhong Zhang
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
related to SERVER-34399 $changeStream with invalid resume tok... Closed
Assigned Teams:
Storage Execution
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v7.2, v7.1, v7.0, v6.0, v5.0, v4.4
Steps To Reproduce:

First insert a document into an index

db.test.createIndex({a: 1})
db.test.insert({_id: 1, a: "x"}) 

Find out the ident of the secondary index

db.runCommand({aggregate: "test", cursor: {}, pipeline:[{$listCatalog: {}}]}) 

Shutdown the server. Dump the index table using a command similar to

~/mongo/build/install/bin/wt -r -C "log=(compressor=snappy,path=journal)" -h /data/db/ dump -x table:index-2-4842695354225906245 > error 

Open the file and modify the value of the keystring to 3c7800040002. Then load the data back to the table using a command similar to

build/install/bin/wt -h /data/db/ load -f error -r index-2-4842695354225906245 

Start the server again and run the validate cmd. 

Sprint: Execution Team 2023-11-27
Participants:

 Description   

When we traverse through the indexes, the validate cmd can invariant and crash the server when encountering corrupted keystrings.



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

Author:

{'name': 'Yuhong Zhang', 'email': 'yuhong.zhang@mongodb.com', 'username': 'YuhongZhang98'}

Message: SERVER-82730 Convert invariants when decoding keystring RecordId to assertions

(cherry picked from commit bf607bda808e7a9ab70ed5d5260161d548c035ce)
(cherry picked from commit 28b205ae6f53c271b851c635cbac7d986ee94546)
(cherry picked from commit 92f490aaa8f58d2b1107ae882c42398e7d92bdca)
(cherry picked from commit 0574e0ef069cb6e892c75d045ec9e9166f8f18b3)

GitOrigin-RevId: 37bce82aef4a781439f72a4684db88c3e165542a
Branch: v4.4
https://github.com/mongodb/mongo/commit/030d7706d8f3ca8c1965f406a3870d60b379ebd1

Comment by Githook User [ 29/Nov/23 ]

Author:

{'name': 'Yuhong Zhang', 'email': 'yuhong.zhang@mongodb.com', 'username': 'YuhongZhang98'}

Message: SERVER-82730 Convert invariants when decoding keystring RecordId to assertions

(cherry picked from commit bf607bda808e7a9ab70ed5d5260161d548c035ce)
(cherry picked from commit 28b205ae6f53c271b851c635cbac7d986ee94546)
(cherry picked from commit 92f490aaa8f58d2b1107ae882c42398e7d92bdca)
Branch: v5.0
https://github.com/mongodb/mongo/commit/0574e0ef069cb6e892c75d045ec9e9166f8f18b3

Comment by Yuhong Zhang [ 29/Nov/23 ]

Author:

{'name': 'Yuhong Zhang', 'email': 'yuhong.zhang@mongodb.com', 'username': 'YuhongZhang98'}

Message: SERVER-82730 Convert invariants when decoding keystring RecordId to assertions

(cherry picked from commit bf607bda808e7a9ab70ed5d5260161d548c035ce)
Branch: v7.0
https://github.com/mongodb/mongo/commit/28b205ae6f53c271b851c635cbac7d986ee94546

Comment by Githook User [ 28/Nov/23 ]

Author:

{'name': 'Yuhong Zhang', 'email': 'yuhong.zhang@mongodb.com', 'username': 'YuhongZhang98'}

Message: SERVER-82730 Convert invariants when decoding keystring RecordId to assertions

(cherry picked from commit bf607bda808e7a9ab70ed5d5260161d548c035ce)
(cherry picked from commit 28b205ae6f53c271b851c635cbac7d986ee94546)
Branch: v6.0
https://github.com/mongodb/mongo/commit/92f490aaa8f58d2b1107ae882c42398e7d92bdca

Comment by Githook User [ 28/Nov/23 ]

Author:

{'name': 'Yuhong Zhang', 'email': 'yuhong.zhang@mongodb.com', 'username': 'YuhongZhang98'}

Message: SERVER-82730 Convert invariants when decoding keystring RecordId to assertions

(cherry picked from commit bf607bda808e7a9ab70ed5d5260161d548c035ce)
Branch: v7.2
https://github.com/mongodb/mongo/commit/13fd6af74426bebdc226b3aeb4c46fe19ae82eb2

Comment by Githook User [ 16/Nov/23 ]

Author:

{'name': 'Yuhong Zhang', 'email': 'yuhong.zhang@mongodb.com', 'username': 'YuhongZhang98'}

Message: SERVER-82730 Convert invariants when decoding keystring RecordId to assertions
Branch: master
https://github.com/mongodb/mongo/commit/bf607bda808e7a9ab70ed5d5260161d548c035ce

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