[SERVER-41073] Writing index metainfo into WT's app_metadata can cause a parsing error Created: 09/May/19  Updated: 29/Oct/23  Resolved: 23/May/19

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 4.1.12

Type: Bug Priority: Major - P3
Reporter: Daniel Gottlieb (Inactive) Assignee: Gregory Wlodarek
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Documented
is documented by DOCS-13452 4.2 only: remove index metadata.infoO... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

On a replica set with > 0 secondaries:

db.bla.insert({});
db.bla.ensureIndex({a: 1}, {unique: true});
db.bla.renameCollection("\x7F");
db.runCommand({"collMod": "\x7F"});

Sprint: Storage NYC 2019-05-20, Execution Team 2019-06-03
Participants:
Linked BF Score: 5

 Description   

Since as far as I care to look back, mongodb has passed index "info objects" to the WT table's app_metadata. The index data is converted to a json string representation which contains the collection name.

When this string is malformed and WT hits a parsing error, it's typically discovered via the primary and results in a uassert:

test> db.createCollection("\x7F")
{
	"ok" : 0,
	"errmsg" : "22: Invalid argument",
	"code" : 2,
	"codeName" : "BadValue"
}

However an existing collection can be renamed without renaming the ns field on an index entry:

test> db.foo.renameCollection("\x7F")
{ "ok" : 1 }
test> db["\x7F"].find()
{ "_id" : ObjectId("5cd472baae8328407ec23421") }

With the new unique index format, indexes can have their metadata re-written to note the format the index is currently in. This can happen on an empty collMod command. There are cases where a primary will replicate this collMod without having hit the parsing error itself. A secondary processing this oplog entry will crash.



 Comments   
Comment by Githook User [ 23/May/19 ]

Author:

{'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}

Message: SERVER-41073 Remove infoObj from being generated for WT's app_metadata
Branch: master
https://github.com/mongodb/mongo/commit/84bda45d3e50c164beebc83a1b44cc3f923bb62a

Comment by Gregory Wlodarek [ 22/May/19 ]

The work for this ticket would be to remove the infoObj=<desc> part from this line.

Generated at Thu Feb 08 04:56:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.