ISSUE SUMMARY
The mongodump tool fails to dump the local.oplog.rs and local.oplog.$main collections when the --dbpath argument is specified and quits with an error.
USER IMPACT
Users cannot dump an oplog directly from the files but need to start a mongod instead.
WORKAROUNDS
Affected users can create the dump from a running mongod instance and avoid the --dbpath option as a workaround. Another workaround is to pass in a query with a ts field as the --query argument.
AFFECTED VERSIONS
Version 2.6.1 was affected by this bug.
FIX VERSION
The fix is included in the 2.6.2 production release.
RESOLUTION DETAILS
The oplogReplay query option is only set if the query contains a ts field.
Original description
When issuing a query for the oplog (oplog.$main) an error is returned if the ts field is not supplied.
mongodump --dbpath /data/db/sconsTests -d local -c 'oplog.$main' -out /tmp/master Thu Aug 8 09:07:40.653 [tools] Assertion: 13044:no ts field in query 0x1004482ab 0x10042332e 0x100226b5d 0x100226bca 0x1002278c7 0x1002307ff 0x100233c32 0x1001dfe5f 0x1001d7fc4 0x1001d81cd 0x10005053a 0x100029c70 0x1001d7b41 0x100008125 0x100008b2a 0x10000a740 0x1000046be 0x10041f69f 0x1000016ce 0x100001664 0 mongodump 0x00000001004482ab _ZN5mongo15printStackTraceERSo + 43 1 mongodump 0x000000010042332e _ZN5mongo11msgassertedEiPKc + 174 2 mongodump 0x0000000100226b5d _ZN5mongo18FindingStartCursor4initEv + 1625 3 mongodump 0x0000000100226bca _ZN5mongo18FindingStartCursor4makeERKNS_9QueryPlanE + 100 4 mongodump 0x00000001002278c7 _ZN5mongo18FindingStartCursor9getCursorEPKcRKNS_7BSONObjES5_ + 821 5 mongodump 0x00000001002307ff _ZN5mongo23queryWithQueryOptimizerEiRKSsRKNS_7BSONObjERNS_5CurOpES4_S4_RKN5boost10shared_ptrINS_11ParsedQueryEEES4_RKNS_12ChunkVersionERNS7_10scoped_ptrINS_25PageFaultRetryableSectionEEERNSG_INS_19NoPageFaultsAllowedEEERNS_7MessageE + 207 6 mongodump 0x0000000100233c32 _ZN5mongo8runQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1_ + 5346 7 mongodump 0x00000001001dfe5f _ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE + 1519 8 mongodump 0x00000001001d7fc4 _ZN5mongo14DBDirectClient4callERNS_7MessageES2_bPSs + 112 9 mongodump 0x00000001001d81cd _ZThn72_N5mongo14DBDirectClient4callERNS_7MessageES2_bPSs + 13 10 mongodump 0x000000010005053a _ZN5mongo14DBClientCursor4initEv + 304 11 mongodump 0x0000000100029c70 _ZN5mongo12DBClientBase5queryERKSsNS_5QueryEiiPKNS_7BSONObjEii + 180 12 mongodump 0x00000001001d7b41 _ZN5mongo14DBDirectClient5queryERKSsNS_5QueryEiiPKNS_7BSONObjEii + 79 13 mongodump 0x0000000100008125 _ZN4Dump12doCollectionESsP7__sFILEPN5mongo13ProgressMeterE + 401 14 mongodump 0x0000000100008b2a _ZN4Dump19writeCollectionFileESsN5boost11filesystem34pathE + 706 15 mongodump 0x000000010000a740 _ZN4Dump2goESsN5boost11filesystem34pathE + 4286 16 mongodump 0x00000001000046be _ZN4Dump3runEv + 5612 17 mongodump 0x000000010041f69f _ZN5mongo4Tool4mainEiPPc + 4933 18 mongodump 0x00000001000016ce main + 62 19 mongodump 0x0000000100001664 start + 52 Thu Aug 8 09:07:40.658 [tools] assertion 13044 no ts field in query ns:local.oplog.$main query:{} Thu Aug 8 09:07:40.658 [tools] 1 objects
Workaround:
mongodump --dbpath /data/db/sconsTests -d local -c 'oplog.$main' -q '{ts:{$exists:true}}' -out /tmp/master
- related to
-
TOOLS-144 audit tools for correct use of oplogReplay queryOption
- Closed
-
SERVER-14249 Add tests for querying oplog via mongodump using --dbpath
- Closed