[SERVER-6499] compact's external sorter should use the default index version key comparator Created: 18/Jul/12  Updated: 11/Jul/16  Resolved: 25/Jul/12

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: 2.0.6
Fix Version/s: 2.2.0-rc1

Type: Bug Priority: Major - P3
Reporter: Allen Gilbert Assignee: Aaron Staple
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

3.2.22-35.60.amzn1.x86_64, 7.5 GB RAM


Issue Links:
Duplicate
Participants:

 Description   

I'm trying to compact one of my large, sharded collections. After setting up a new secondary with a copy of the master's data, the command failed when attempting to rebuild the index/shard key:

{
    "ns" : "data.intervals",
    "key" : { "datapoint_id" : 1, "localdate" : 1 },
    "name" : "datapoint_id_1_localdate_1",
    "unique" : true,
    "v" : 0
}

So, I re-copied the data and ran validate(

{full: true}

) first, which declared my collection to be healthy (ok's were all 1, no errors or invalidObjects). However, it failed again:

SECONDARY> db.intervals.runCommand("compact");
{
	"assertion" : "bad key order in BtreeBuilder - server internal error",
	"assertionCode" : 10288,
	"errmsg" : "db assertion failure",
	"ok" : 0
}

The stack trace from the secondary's log:

Fri Jul  6 20:06:16 [conn300] compact create index { datapoint_id: 1.0, localdate: 1.0 }
Fri Jul  6 20:06:16 [conn300] build index data.intervals { datapoint_id: 1.0, localdate: 1.0 }
Fri Jul  6 20:06:26 [conn300] Assertion: 10288:bad key order in BtreeBuilder - server internal error
0x5848a2 0x75aa59 0x8c283c 0x8b180c 0x8b2a55 0x8b37d3 0x8b468e 0xaa85dd 0xaa8c4f 0xaa98b7 0x97c4f4 0x97dbfd 0x940f05 0x943a30 0x889107 0x88dcd9 0xaa0bc8 0x6389f7 0x34f78077f1 0x34f70e5ccd 
 /opt/mongodb/bin/mongod(_ZN5mongo11msgassertedEiPKc+0x112) [0x5848a2]
 /opt/mongodb/bin/mongod(_ZN5mongo12BtreeBuilderINS_12BtreeData_V1EE6addKeyERNS_7BSONObjENS_7DiskLocE+0x519) [0x75aa59]
 /opt/mongodb/bin/mongod(_ZN5mongo24buildBottomUpPhases2And3INS_12BtreeData_V1EEEvbRNS_12IndexDetailsERNS_21BSONObjExternalSorterEbRSt4listINS_7DiskLocESaIS7_EEPNS_5CurOpEPNS_12SortPhaseOneERNS_19ProgressMeterHolderERNS_5TimerE+0x26c) [0x8c283c]
 /opt/mongodb/bin/mongod(_ZN5mongo14fastBuildIndexEPKcPNS_16NamespaceDetailsERNS_12IndexDetailsEi+0xc2c) [0x8b180c]
 /opt/mongodb/bin/mongod() [0x8b2a55]
 /opt/mongodb/bin/mongod(_ZN5mongo16insert_makeIndexEPNS_16NamespaceDetailsERKSsRKNS_7DiskLocE+0x1c3) [0x8b37d3]
 /opt/mongodb/bin/mongod(_ZN5mongo11DataFileMgr6insertEPKcPKvibbPb+0x6fe) [0x8b468e]
 /opt/mongodb/bin/mongod(_ZN5mongo8_compactEPKcPNS_16NamespaceDetailsERSsbRNS_14BSONObjBuilderE+0x1bdd) [0xaa85dd]
 /opt/mongodb/bin/mongod(_ZN5mongo7compactERKSsRSsbRNS_14BSONObjBuilderE+0x1cf) [0xaa8c4f]
 /opt/mongodb/bin/mongod(_ZN5mongo10CompactCmd3runERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb+0x267) [0xaa98b7]
 /opt/mongodb/bin/mongod(_ZN5mongo11execCommandEPNS_7CommandERNS_6ClientEiPKcRNS_7BSONObjERNS_14BSONObjBuilderEb+0x6c4) [0x97c4f4]
 /opt/mongodb/bin/mongod(_ZN5mongo12_runCommandsEPKcRNS_7BSONObjERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi+0x6fd) [0x97dbfd]
 /opt/mongodb/bin/mongod(_ZN5mongo11runCommandsEPKcRNS_7BSONObjERNS_5CurOpERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi+0x35) [0x940f05]
 /opt/mongodb/bin/mongod(_ZN5mongo8runQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1_+0x1740) [0x943a30]
 /opt/mongodb/bin/mongod() [0x889107]



 Comments   
Comment by auto [ 24/Jul/12 ]

Author:

{u'date': u'2012-07-24T16:04:13-07:00', u'email': u'aaron@10gen.com', u'name': u'Aaron'}

Message: SERVER-6499 Make test work in v8 shell by requesting test collection name explicitly.
Branch: master
https://github.com/mongodb/mongo/commit/2724a08f46f492bddf5add33e94d5c0b30e2af33

Comment by auto [ 24/Jul/12 ]

Author:

{u'date': u'2012-07-23T14:43:40-07:00', u'email': u'aaron@10gen.com', u'name': u'Aaron'}

Message: SERVER-6499 Always use v1 (default) key comparator in compact's external sorter.
Branch: master
https://github.com/mongodb/mongo/commit/3bb2070858b50453923038e2fe9e2797a2e8d035

Comment by auto [ 24/Jul/12 ]

Author:

{u'date': u'2012-07-23T13:10:55-07:00', u'email': u'aaron@10gen.com', u'name': u'Aaron'}

Message: SERVER-6499 Clarify compact's index build perparation logic.
Branch: master
https://github.com/mongodb/mongo/commit/6700f1ed58618dbae8e4add1a8f5e87400502bca

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