[SERVER-25515] repairDatabasesAndCheckVersion shouldn't be using system.indexes Created: 09/Aug/16  Updated: 06/Dec/22  Resolved: 12/Sep/16

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

Type: Bug Priority: Major - P3
Reporter: Mathias Stearn Assignee: Backlog - Storage Execution Team
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Storage Execution
Operating System: ALL
Participants:

 Description   

As written, it won't check any indexes on WiredTiger.



 Comments   
Comment by Ian Whalen (Inactive) [ 12/Sep/16 ]

Closing based on Max's comment.

Comment by Max Hirschhorn [ 09/Aug/16 ]

redbeard0531, it isn't clear to me why repairDatabasesAndCheckVersion() using the system.indexes collection is an issue. It only does so to handle cases where

  1. The index was created before 2.4
  2. The index has an invalid key pattern.
  3. The index has an invalid "v" field.

#1 doesn't apply to WiredTiger because it was introduced in 3.0. #2 and #3 are still checked during the mongod initialization process because IndexCatalog::init() calls IndexCatalog::_setupInMemoryStructures(), which calls IndexCatalog::_isSpecOk() on the infoObj of each IndexDescriptor.


Since the changes from SERVER-24248 aren't quite in yet, here's an example of running the partial_index_upgrade.js test with the WiredTiger storage engine.

Patch to apply

diff --git a/jstests/multiVersion/partial_index_upgrade.js b/jstests/multiVersion/partial_index_upgrade.js
index b19631a..65b8ddc 100644
--- a/jstests/multiVersion/partial_index_upgrade.js
+++ b/jstests/multiVersion/partial_index_upgrade.js
@@ -31,6 +31,7 @@
         var defaultOptions = {
             dbpath: dbpath,
             noCleanData: true,
+            storageEngine: 'wiredTiger',
         };
 
         // Start the old version.

resmoke.py invocation

PATH=$PATH:/data/multiversion/ python buildscripts/resmoke.py --executor=multiversion jstests/multiVersion/partial_index_upgrade.js

Output

[js_test:partial_index_upgrade] 2016-08-09T17:54:39.626-0400 2016-08-09T17:54:39.626-0400 I -        [thread1] shell: started program (sh46055):  /data/multiversion/mongod-3.0 --dbpath /data/db/job0/mongorunner/partial_index_upgrade --storageEngine wiredTiger --port 20010 --nopreallocj --setParameter enableTestCommands=1
...
[js_test:partial_index_upgrade] 2016-08-09T17:54:40.329-0400 2016-08-09T17:54:40.329-0400 I -        [thread1] shell: stopped mongo program on port 20010
[js_test:partial_index_upgrade] 2016-08-09T17:54:40.331-0400 2016-08-09T17:54:40.331-0400 I -        [thread1] shell: started program (sh46056):  /Users/maxh/Documents/GitHub/mongo/mongod --dbpath /data/db/job0/mongorunner/partial_index_upgrade --storageEngine wiredTiger --port 20011 --nopreallocj --setParameter enableTestCommands=1
...
[js_test:partial_index_upgrade] 2016-08-09T17:54:41.474-0400 d20011| 2016-08-09T17:54:41.473-0400 F INDEX    [initandlisten] Found an invalid index { v: 1, key: { a: 1.0 }, name: "a_1", ns: "test.coll", partialFilterExpression: "not an object" } on the test.coll collection: "partialFilterExpression" for an index must be a document
[js_test:partial_index_upgrade] 2016-08-09T17:54:41.474-0400 d20011| 2016-08-09T17:54:41.473-0400 I -        [initandlisten] Fatal Assertion 28782 at src/mongo/db/catalog/index_catalog.cpp 140
[js_test:partial_index_upgrade] 2016-08-09T17:54:41.475-0400 d20011| 2016-08-09T17:54:41.473-0400 I -        [initandlisten]
[js_test:partial_index_upgrade] 2016-08-09T17:54:41.475-0400 d20011|
[js_test:partial_index_upgrade] 2016-08-09T17:54:41.475-0400 d20011| ***aborting after fassert() failure

Comment by Mathias Stearn [ 09/Aug/16 ]

david.storch This may affect the upgrade/downgrade plans for collations, etc.

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