• Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.3.9, 3.2.8
    • Affects Version/s: 3.2.1
    • Component/s: mongorestore
    • Environment:
      Linux mongotest01.chartbeat.net 3.13.0-79-generic #123~precise1-Ubuntu SMP Fri Feb 19 14:48:42 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

      ec2 - r3.4xlarge
    • Server Tools 12 (04/01/16), Server Tools 13 (04/22/16), Server Tools 14 (5/13/16), Server Tools 15 (6/3/16)

      Testing an upgrade to WiredTiger storage engine and performed a mongodump of a 4.2TB database from Mongo 2.6 into an archive of about 2.6TB. Trying to restore now on a fresh mongo instance running Mongo 3.2 and getting an "out of memory" error about 2 minutes into the restore. We have 31 databases with a couple thousand collections in each one. I've tried various options with "j 1" and "-batchSize 100" but still getting an OOM.

      Here's the backtrace if it's useful

      fatal error: runtime: out of memory

      runtime stack:
      runtime.SysMap(0xddde2d0000, 0x1010000, 0x43f600, 0x1330958)
      /usr/local/go/src/runtime/mem_linux.c:149 +0x98
      runtime.MHeap_SysAlloc(0x1336040, 0x1010000, 0x43a6b2)
      /usr/local/go/src/runtime/malloc.c:284 +0x124
      runtime.MHeap_Alloc(0x1336040, 0x801, 0x10100000000, 0x8)
      /usr/local/go/src/runtime/mheap.c:240 +0x66

      goroutine 1 [running]:
      runtime.switchtoM()
      /usr/local/go/src/runtime/asm_amd64.s:198 fp=0xc20e9835b0 sp=0xc20e9835a8
      runtime.mallocgc(0x1000040, 0x8878a0, 0xc200000000, 0x12)
      /usr/local/go/src/runtime/malloc.go:199 +0x9f3 fp=0xc20e983660 sp=0xc20e9835b0
      runtime.newobject(0x8878a0, 0xc20d726a00)
      /usr/local/go/src/runtime/malloc.go:353 +0x49 fp=0xc20e983688 sp=0xc20e983660
      github.com/mongodb/mongo-tools/mongorestore.(*MongoRestore).CreateIntentsForDB(0xc208034d00, 0xc20810c160, 0x13, 0x0, 0x0, 0x7f03f81ba0d8, 0xc2091a3080, 0x0, 0x0, 0x0)
      /data/mci/src/src/mongo-tools-repo/.gopath/src/github.com/mongodb/mongo-tools/mongorestore/filepath.go:301 +0x1497 fp=0xc20e983900 sp=0xc20e983688
      github.com/mongodb/mongo-tools/mongorestore.(*MongoRestore).CreateAllIntents(0xc208034d00, 0x7f03f81ba0d8, 0xc2091a3020, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
      /data/mci/src/src/mongo-tools-repo/.gopath/src/github.com/mongodb/mongo-tools/mongorestore/filepath.go:171 +0x649 fp=0xc20e983ad8 sp=0xc20e983900
      github.com/mongodb/mongo-tools/mongorestore.(*MongoRestore).Restore(0xc208034d00, 0x0, 0x0)
      /data/mci/src/src/mongo-tools-repo/.gopath/src/github.com/mongodb/mongo-tools/mongorestore/mongorestore.go:253 +0xe10 fp=0xc20e983d50 sp=0xc20e983ad8
      main.main()
      /data/mci/src/src/mongo-tools-repo/mongorestore/main/mongorestore.go:71 +0x85f fp=0xc20e983f98 sp=0xc20e983d50
      runtime.main()
      /usr/local/go/src/runtime/proc.go:63 +0xf3 fp=0xc20e983fe0 sp=0xc20e983f98
      runtime.goexit()
      /usr/local/go/src/runtime/asm_amd64.s:2232 +0x1 fp=0xc20e983fe8 sp=0xc20e983fe0
      goroutine 5 [syscall, 4 minutes]:
      os/signal.loop()
      /usr/local/go/src/os/signal/signal_unix.go:21 +0x1f
      created by os/signal.init·1
      /usr/local/go/src/os/signal/signal_unix.go:27 +0x35

      goroutine 10 [select]:
      gopkg.in/mgo%2ev2.(*mongoCluster).syncServersLoop(0xc20808c700)
      /data/mci/src/src/mongo-tools-repo/vendor/src/gopkg.in/mgo.v2/cluster.go:394 +0x606
      created by gopkg.in/mgo%2ev2.newCluster
      /data/mci/src/src/mongo-tools-repo/vendor/src/gopkg.in/mgo.v2/cluster.go:78 +0x20b

      goroutine 17 [syscall, 4 minutes, locked to thread]:
      runtime.goexit()
      /usr/local/go/src/runtime/asm_amd64.s:2232 +0x1

      goroutine 38 [sleep]:
      gopkg.in/mgo%2ev2.(*mongoServer).pinger(0xc2080fa000, 0x1)
      /data/mci/src/src/mongo-tools-repo/vendor/src/gopkg.in/mgo.v2/server.go:296 +0x169
      created by gopkg.in/mgo%2ev2.newServer
      /data/mci/src/src/mongo-tools-repo/vendor/src/gopkg.in/mgo.v2/server.go:89 +0x194

      goroutine 50 [IO wait]:
      net.(*pollDesc).Wait(0xc208102060, 0x72, 0x0, 0x0)
      /usr/local/go/src/net/fd_poll_runtime.go:84 +0x47
      net.(*pollDesc).WaitRead(0xc208102060, 0x0, 0x0)
      /usr/local/go/src/net/fd_poll_runtime.go:89 +0x43
      net.(*netFD).Read(0xc208102000, 0xc2080f4090, 0x24, 0x24, 0x0, 0x7f03fde8fba0, 0xc20e822340)
      /usr/local/go/src/net/fd_unix.go:242 +0x40f
      net.(*conn).Read(0xc208114000, 0xc2080f4090, 0x24, 0x24, 0x0, 0x0, 0x0)
      /usr/local/go/src/net/net.go:121 +0xdc
      gopkg.in/mgo%2ev2.fill(0x7f03fde96518, 0xc208114000, 0xc2080f4090, 0x24, 0x24, 0x0, 0x0)
      /data/mci/src/src/mongo-tools-repo/vendor/src/gopkg.in/mgo.v2/socket.go:530 +0x75
      gopkg.in/mgo%2ev2.(*mongoSocket).readLoop(0xc208116000)
      /data/mci/src/src/mongo-tools-repo/vendor/src/gopkg.in/mgo.v2/socket.go:547 +0x126
      created by gopkg.in/mgo%2ev2.newSocket
      /data/mci/src/src/mongo-tools-repo/vendor/src/gopkg.in/mgo.v2/socket.go:194 +0x3d3

      I'm unable to dump into anything but an archive since there are "/" in names and mongodump won't allow dumping to a filesystem due to that.

            Assignee:
            william.banfield William Banfield
            Reporter:
            jlintz Justin Lintz
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: