[SERVER-16885] Flag noIndexBuildRetry doesn't clean up interrupted index Created: 15/Jan/15  Updated: 25/Jan/17  Resolved: 06/Feb/15

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

Type: Bug Priority: Major - P3
Reporter: Siyuan Zhou Assignee: Benety Goh
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-16645 Re-enable JS tests for yielding Closed
Related
related to SERVER-18087 index_retry.js and index_no_retry.js ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Completed:
Sprint: RPL 0 3/13/15
Participants:
Linked BF Score: 0

 Description   

Start a mongod with --noIndexBuildRetry.

Run the following script to build a index.

var bulk = db.jstests_bgsec.initializeUnorderedBulkOp();
for( i = 0; i < 100000; ++i ) {         bulk.insert({ i : i });     }
assert.writeOK(bulk.execute());
 
db.jstests_bgsec.ensureIndex( {i:1} );

Kill mongod with signal 9. Restart mongod with --noIndexBuildRetry. The index is still in the index catalog, but not available for query.

> db.jstests_bgsec.getIndexes()
[
	{
		"v" : 1,
		"key" : {
			"_id" : 1
		},
		"name" : "_id_",
		"ns" : "test.jstests_bgsec"
	},
	{
		"v" : 1,
		"key" : {
			"i" : 1
		},
		"name" : "i_1",
		"ns" : "test.jstests_bgsec",
		"background" : true
	}
]
 
> db.jstests_bgsec.find({i: {$gt: -1}}).hint({i: 1}).explain()
2015-01-15T17:23:21.955-0500 I QUERY    Error: explain failed: {
	"ok" : 0,
	"errmsg" : "error processing query: ns=test.jstests_bgsec limit=0 skip=0\nTree: i $gt -1.0\nSort: {}\nProj: {}\n planner returned error: bad hint",
	"code" : 2
}
    at Error (<anonymous>)
    at Function.throwOrReturn (src/mongo/shell/explainable.js:34:19)
    at constructor.finish (src/mongo/shell/explain_query.js:188:36)
    at DBQuery.explain (src/mongo/shell/query.js:434:25)
    at (shell):1:52 at src/mongo/shell/explainable.js:34
 
 
> db.jstests_bgsec.stats()
{
	"ns" : "test.jstests_bgsec",
	"count" : 100000,
	"size" : 4800080,
	"avgObjSize" : 48,
	"numExtents" : 6,
	"storageSize" : 11182080,
	"lastExtentSize" : 8388608,
	"paddingFactor" : 1,
	"paddingFactorNote" : "paddingFactor is unused and unmaintained in 2.8. It remains hard coded to 1.0 for compatibility only.",
	"userFlags" : 1,
	"nindexes" : 1,
	"indexDetails" : {
 
	},
	"totalIndexSize" : 3262224,
	"indexSizes" : {
		"_id_" : 3262224
	},
	"ok" : 1
}



 Comments   
Comment by Githook User [ 06/Feb/15 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-16885 index rebuilder should commit changes to index and collection catalogs even with --noIndexBuildRetry

Also clean up of index rebuilding test index_retry.js and additional test index_no_retry.js
for disabling index rebuilding after crash.

(cherry picked from commit c8e315735caa0b98179a5e6351cbcd0e16c134a6)
Branch: v3.0
https://github.com/mongodb/mongo/commit/216caf45f814fd99ce061210ef2ae78ab6bb8594

Comment by Githook User [ 06/Feb/15 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-16885 index rebuilder should commit changes to index and collection catalogs even with --noIndexBuildRetry

Also clean up of index rebuilding test index_retry.js and additional test index_no_retry.js
for disabling index rebuilding after crash.
Branch: master
https://github.com/mongodb/mongo/commit/c8e315735caa0b98179a5e6351cbcd0e16c134a6

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