[SERVER-12565] Cannot run mongodump from 2.4 datafiles Created: 31/Jan/14 Updated: 11/Jul/16 Resolved: 07/Feb/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Tools |
| Affects Version/s: | None |
| Fix Version/s: | 2.6.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Shaun Verch | Assignee: | Eliot Horowitz (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Steps To Reproduce: | Run a 2.4 mongod and shut down (after inserting data shown below):
Insert data:
Dump using 2.5.5 mongodump:
Confirmation that the data has not been dumped:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
Cannot run a direct mongodump against the data files of a 2.4 database. See steps to reproduce. |
| Comments |
| Comment by Githook User [ 10/Feb/14 ] |
|
Author: {u'username': u'erh', u'name': u'Eliot Horowitz', u'email': u'eliot@10gen.com'}Message: |
| Comment by Githook User [ 07/Feb/14 ] |
|
Author: {u'username': u'erh', u'name': u'Eliot Horowitz', u'email': u'eliot@10gen.com'}Message: |
| Comment by Shaun Verch [ 05/Feb/14 ] |
|
It looks like the issue is that when Database::getFile is called it unconditionally initializes the data files for writing: https://github.com/mongodb/mongo/blob/9cbdc4fa38c14a27/src/mongo/db/database.h#L83 In this case, we are trying to run a count command, which retrieves the index catalog for the database. To initialize the index metadata, the index catalog calls into getFile, which attempts to initialize the extent free list as part of initializing for writes. In the 2.4 data files, it seems like we don't have an extent free list, so it tries to create it, which fails because "count" doesn't take a write lock. A workaround for this is to start a new mongod on the 2.4 datafiles and then shut it down. this seems to properly initialize the data files without problems as subsequent mongodumps are successful. |
| Comment by Eliot Horowitz (Inactive) [ 31/Jan/14 ] |
|
I would guess the namespace over which you want to count doesn't exist, and someone isn't checking high enough up. |
| Comment by Andy Schwerin [ 31/Jan/14 ] |
|
eliot, any idea why a tool running a count command using DBDirectClient would end up calling a function that requires a write lock? Looks like initForWrites() is getting called on a Database object deep inside getCollection(). It appears to be that mongodump is trying to open db.$freelist as a collection, and since it doesn't exist, tries to allocate storage. |