Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-4426

cryptic assertion when system.profile is not a capped collection

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      Users can manually create system.profile, and if they choose to do this they are supposed to create system.profile as a capped collection but this isn't actually enforced. If a non capped system.profile is created and operations are logged to it, non user friendly assertions can be triggered when the initial extent runs out of space:

      > db.createCollection("system.profile")

      { "ok" : 1 }

      > db.setProfilingLevel(2)

      { "was" : 0, "slowms" : 100, "ok" : 1 }

      > for( i = 0; i < 100; ++i ) { db.c.save({}); }
      Sun Dec 4 14:29:33 DBClientCursor::init call() failed
      Sun Dec 4 14:29:33 query failed : test.$cmd

      { getlasterror: 1.0, w: 1.0 }

      to: 127.0.0.1:27017
      Sun Dec 4 14:29:33 Error: error doing query: failed shell/collection.js:155
      Sun Dec 4 14:29:33 trying reconnect to 127.0.0.1:27017
      Sun Dec 4 14:29:33 reconnect 127.0.0.1:27017 ok

      Sun Dec 4 14:29:33 [conn1] test.c Assertion failure !loc.isNull() db/pdfile.cpp 2076
      0x1087507f5 0x10874edfb 0x10875c269 0x108c08e5f 0x108a7f537 0x108bdc0d3 0x108e5d3cf 0x10886669a 0x108867ea0 0x108867f02 0x108867f2d 0x10a762460 0x7fff8b3688bf 0x7fff8b36bb75
      0 mongod 0x00000001087507f5 _ZN5mongo15printStackTraceERSo + 37
      1 mongod 0x000000010874edfb _ZN5mongo12sayDbContextEPKc + 123
      2 mongod 0x000000010875c269 _ZN5mongo8assertedEPKcS1_j + 409
      3 mongod 0x0000000108c08e5f _ZN5mongo11DataFileMgr17fast_oplog_insertEPNS_16NamespaceDetailsEPKci + 337
      4 mongod 0x0000000108a7f537 _ZN5mongo7profileERKNS_6ClientERNS_5CurOpE + 2455
      5 mongod 0x0000000108bdc0d3 _ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE + 5283
      6 mongod 0x0000000108e5d3cf _ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE + 261
      7 mongod 0x000000010886669a _ZN5mongo3pms9threadRunEPNS_13MessagingPortE + 1546
      8 mongod 0x0000000108867ea0 _ZN5boost3_bi5list1INS0_5valueIPN5mongo13MessagingPortEEEEclIPFvS5_ENS0_5list0EEEvNS0_4typeIvEERT_RT0_i + 78
      9 mongod 0x0000000108867f02 _ZN5boost3_bi6bind_tIvPFvPN5mongo13MessagingPortEENS0_5list1INS0_5valueIS4_EEEEEclEv + 92
      10 mongod 0x0000000108867f2d _ZN5boost6detail11thread_dataINS_3_bi6bind_tIvPFvPN5mongo13MessagingPortEENS2_5list1INS2_5valueIS6_EEEEEEE3runEv + 37
      11 libboost_thread-mt.dylib 0x000000010a762460 thread_proxy + 160
      12 libsystem_c.dylib 0x00007fff8b3688bf _pthread_start + 335
      13 libsystem_c.dylib 0x00007fff8b36bb75 thread_start + 13
      Sun Dec 4 14:29:33 [conn1] AssertionException handling request, closing client connection: 0 assertion db/pdfile.cpp:2076

      I think a similar error message may be possible if system.profile is a capped collection but was created in such a way that a record of the required size cannot be allocated (if system.profile is small or if all of its extents are small).

      We should probably check if system.profile is capped either when it is created or when an operation is logged to it. We should probably also trigger a more user friendly assertion if space for a profile record cannot be allocated in system.profile.

            Assignee:
            Unassigned Unassigned
            Reporter:
            aaron Aaron Staple
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: