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

Profiler collection not created when using --profile

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.8.0-rc5
    • Fix Version/s: 3.0.0-rc6
    • Component/s: Diagnostics, Storage
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      var conn = MongoRunner.runMongod({profile: 2});
      var t = conn.getDB('test').foo;
       
      // this insert should trigger the creation of the profiler collection
      t.insert({});
       
      var colls = t.getDB().getCollectionNames();
      assert.contains('system.profile', colls, tojson(colls));
       
      MongoRunner.stopMongod(conn);

      Show
      var conn = MongoRunner.runMongod({profile: 2}); var t = conn.getDB('test').foo;   // this insert should trigger the creation of the profiler collection t.insert({});   var colls = t.getDB().getCollectionNames(); assert.contains('system.profile', colls, tojson(colls));   MongoRunner.stopMongod(conn);

      Description

      Starting with commit 02a78a7f3 (from SERVER-16431), a system.profile collection is no longer created when using --profile. The collection is still created when enabling the profiler via runCommand, however:

      // Using `./mongod --profile=2`
      //
      > db.runCommand({profile: 2});
      { "was" : 2, "slowms" : 100, "ok" : 1 }
      > db.getCollectionNames();
      [ "system.indexes" ]
      > db.foo.insert({});
      WriteResult({ "nInserted" : 1 })
      > db.getCollectionNames();
      [ "foo", "system.indexes" ]
       
       
      // Using `./mongod`
      //
      > db.runCommand({profile: 2});
      { "was" : 0, "slowms" : 100, "ok" : 1 }
      > db.getCollectionNames();
      [ "system.indexes", "system.profile" ]
      > db.foo.insert({});
      WriteResult({ "nInserted" : 1 })
      > db.getCollectionNames();
      [ "foo", "system.indexes", "system.profile" ]

        Attachments

          Activity

            People

            Assignee:
            kaloian.manassiev Kaloian Manassiev
            Reporter:
            kamran.khan Kamran K.
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: