[SERVER-16893] Invariant failure: out-of-order index keys with v0 WiredTiger index Created: 16/Jan/15  Updated: 17/May/19  Resolved: 23/Jan/15

Status: Closed
Project: Core Server
Component/s: Index Maintenance, Storage
Affects Version/s: 2.8.0-rc5
Fix Version/s: 3.0.0-rc7

Type: Bug Priority: Major - P3
Reporter: Kamran K. Assignee: Daniel Alabi
Resolution: Done Votes: 0
Labels: 28qa, pull-request, wiredtiger
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
is documented by DOCS-4774 Document that WT and v:0 indexes are ... Closed
Backwards Compatibility: Minor Change
Operating System: ALL
Steps To Reproduce:

var t = db.wt_v0;
t.drop();
 
t.insert({a: {b: 1}});
t.insert({a: {a: 1}});
t.ensureIndex({a: 1}, {v: 0}); // v:0 is required

Participants:

 Description   

This bug only seems to affect v:0 indexes with WiredTiger (which may not be a sensible combination).

2015-01-16T00:05:25.113-0500 E STORAGE  [conn1] WiredTiger (22) [1421384725:113676][9472:0x7ffff7fcc700], file:index-4-6490722470707178545.wt, cursor.insert: bulk-load presented with out-of-order keys: F\1ea\00+\02\00\04\00\10 compares smaller than previously inserted key F\1eb\00+\02\00\04\00\08: Invalid argument
2015-01-16T00:05:25.113-0500 I -        [conn1] Invariant failure: _cursor->insert(_cursor) resulted in status BadValue 22: Invalid argument at src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp 451
 
#0  0x00007ffff7bcc20b in raise (sig=5) at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:37
#1  0x00000000018bbc89 in mongo::breakpoint () at src/mongo/util/debugger.cpp:63
#2  0x00000000018b132e in mongo::invariantOKFailed (expr=0x2014c07 "_cursor->insert(_cursor)", status=..., file=0x2014a28 "src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp", line=451)
    at src/mongo/util/assert_util.cpp:157
#3  0x000000000172b8e4 in mongo::WiredTigerIndex::StandardBulkBuilder::addKey (this=0x34f2100, key=..., loc=...) at src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp:451
#4  0x0000000001414a6b in mongo::BtreeBasedBulkAccessMethod::commit (this=0x3457900, dupsToDrop=0x0, mayInterrupt=true, dupsAllowed=true) at src/mongo/db/index/btree_based_bulk_access_method.cpp:156
#5  0x00000000014131ad in mongo::BtreeBasedAccessMethod::commitBulk (this=0x34f23a0, bulkRaw=0x3457900, mayInterrupt=true, dupsAllowed=true, dupsToDrop=0x0)
    at src/mongo/db/index/btree_based_access_method.cpp:323
#6  0x000000000127ca2e in mongo::MultiIndexBlock::doneInserting (this=0x7ffff7fca290, dupsOut=0x0) at src/mongo/db/catalog/index_create.cpp:304
#7  0x000000000127c5a0 in mongo::MultiIndexBlock::insertAllDocumentsInCollection (this=0x7ffff7fca290, dupsOut=0x0) at src/mongo/db/catalog/index_create.cpp:271
#8  0x00000000012a58e1 in mongo::CmdCreateIndex::run (this=0x2861160 <mongo::cmdCreateIndex>, txn=0x7ffff7fcb7e0, dbname=..., cmdObj=..., options=0, errmsg=..., result=..., fromRepl=false)
    at src/mongo/db/commands/create_indexes.cpp:200
#9  0x000000000132ddd3 in mongo::_execCommand (txn=0x7ffff7fcb7e0, c=0x2861160 <mongo::cmdCreateIndex>, dbname=..., cmdObj=..., queryOptions=0, errmsg=..., result=..., fromRepl=false)
    at src/mongo/db/dbcommands.cpp:1267
#10 0x000000000132ed50 in mongo::Command::execCommand (txn=0x7ffff7fcb7e0, c=0x2861160 <mongo::cmdCreateIndex>, queryOptions=0, cmdns=0x33f0014 "test.$cmd", cmdObj=..., result=..., fromRepl=false)
    at src/mongo/db/dbcommands.cpp:1483
#11 0x000000000132f632 in mongo::_runCommands (txn=0x7ffff7fcb7e0, ns=0x33f0014 "test.$cmd", _cmdobj=..., b=..., anObjBuilder=..., fromRepl=false, queryOptions=0) at src/mongo/db/dbcommands.cpp:1558
#12 0x0000000001531c82 in mongo::runCommands (txn=0x7ffff7fcb7e0, ns=0x33f0014 "test.$cmd", jsobj=..., curop=..., b=..., anObjBuilder=..., fromRepl=false, queryOptions=0) at src/mongo/db/query/find.cpp:137
#13 0x0000000001533caa in mongo::runQuery (txn=0x7ffff7fcb7e0, m=..., q=..., nss=..., curop=..., result=..., fromDBDirectClient=false) at src/mongo/db/query/find.cpp:606
#14 0x0000000001438e20 in mongo::receivedQuery (txn=0x7ffff7fcb7e0, c=..., dbresponse=..., m=..., fromDBDirectClient=false) at src/mongo/db/instance.cpp:220
#15 0x0000000001439fca in mongo::assembleResponse (txn=0x7ffff7fcb7e0, m=..., dbresponse=..., remote=..., fromDBDirectClient=false) at src/mongo/db/instance.cpp:403
#16 0x0000000001137704 in mongo::MyMessageHandler::process (this=0x30ae180, m=..., port=0x30d5ed0, le=0x33f6cd0) at src/mongo/db/db.cpp:206
#17 0x00000000018d98b7 in mongo::PortMessageServer::handleIncomingMsg (arg=0x30d5ed0) at src/mongo/util/net/message_server_port.cpp:227
#18 0x00007ffff7bc4182 in start_thread (arg=0x7ffff7fcc700) at pthread_create.c:312
#19 0x00007ffff6cc500d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111


Version: bcf19d4af076b5ce



 Comments   
Comment by Githook User [ 26/Jan/15 ]

Author:

{u'username': u'alabid', u'name': u'alabid', u'email': u'alabidan@gmail.com'}

Message: SERVER-16893 Disallow creation of v0 indexes with non-mmapv1 storage engines

Also moved jstests/tool/dumprestore6.js to jstests/mmapv1/dumprestore6.js
since this JS test attempts to restore a v0 index

Closes #914

Signed-off-by: Benety Goh <benety@mongodb.com>
(cherry picked from commit 5f3fa2e77537d1be650af981effa2e66dc86e10d)
Branch: v3.0
https://github.com/mongodb/mongo/commit/021ea0a1a885d26e7c1010d71cf4152d40d5c04c

Comment by Githook User [ 23/Jan/15 ]

Author:

{u'username': u'alabid', u'name': u'alabid', u'email': u'alabidan@gmail.com'}

Message: SERVER-16893 Disallow creation of v0 indexes with non-mmapv1 storage engines

Also moved jstests/tool/dumprestore6.js to jstests/mmapv1/dumprestore6.js
since this JS test attempts to restore a v0 index

Closes #914

Signed-off-by: Benety Goh <benety@mongodb.com>
Branch: master
https://github.com/mongodb/mongo/commit/5f3fa2e77537d1be650af981effa2e66dc86e10d

Comment by Daniel Pasette (Inactive) [ 20/Jan/15 ]

I believe this is an invalid combo. Let's forbid combo of v0 + WT.

Generated at Thu Feb 08 03:42:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.