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

mongos cursors cannot be killed if server log level is 3 or higher

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.4.11, 2.6.4, 3.0.0
    • Component/s: Querying, Sharding
    • None
    • ALL

      mongos will trip a non-fatal assertion failure and close the client connection when receiving an OP_KILL_CURSORS message if the server log level is 3 or higher. The assertion was introduced in SERVER-14268.

      To reproduce:

      var st = new ShardingTest({shards: 1});
      var coll = st.getDB("test").foo;
      coll.getDB().adminCommand({setParameter: 1, logLevel: 3});
      coll.insert({});
      coll.insert({});
      coll.insert({});
      coll.insert({});
      var cursor = coll.find().batchSize(2);
      cursor.next();
      assert.eq(1, coll.getDB().serverStatus().metrics.cursor.open.total);
      cursor = null;
      gc();
      assert.eq(0, coll.getDB().serverStatus().metrics.cursor.open.total);
      

      The server generates the following output:

       m30999| 2015-08-24T17:20:56.739-0400 I -        [conn2] Assertion failure messageShouldHaveNs() src/mongo/db/dbmessage.cpp 94
       m30999| 2015-08-24T17:20:56.742-0400 I CONTROL  [conn2]
       m30999|  0xa41c39 0x9f21b1 0x9d62ee 0x6e740d 0x5a96ca 0x9fe63b 0x7f27aeeae182 0x7f27adfaf30d
       m30999| ----- BEGIN BACKTRACE -----
       m30999| {"backtrace":[{"b":"400000","o":"641C39"},{"b":"400000","o":"5F21B1"},{"b":"400000","o":"5D62EE"},{"b":"400000","o":"2E740D"},{"b":"400000","o":"1A96CA"},{"b":"400000","o":"5FE63B"},{"b":"7F27AEEA6000","o":"8182"},{"b":"7F27ADEB4000","o":"FB30D"}],"processInfo":{ "mongodbVersion" : "3.0.6", "gitVersion" : "1ef45a23a4c5e3480ac919b28afcba3c615488f2", "uname" : { "sysname" : "Linux", "release" : "3.13.0-24-generic", "version" : "#46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014", "machine" : "x86_64" }, "somap" : [ { "elfType" : 2, "b" : "400000" }, { "b" : "7FFF932FE000", "elfType" : 3 }, { "b" : "7F27AEEA6000", "path" : "/lib/x86_64-linux-gnu/libpthread.so.0", "elfType" : 3 }, { "b" : "7F27AEC9E000", "path" : "/lib/x86_64-linux-gnu/librt.so.1", "elfType" : 3 }, { "b" : "7F27AEA9A000", "path" : "/lib/x86_64-linux-gnu/libdl.so.2", "elfType" : 3 }, { "b" : "7F27AE796000", "path" : "/usr/lib/x86_64-linux-gnu/libstdc++.so.6", "elfType" : 3 }, { "b" : "7F27AE490000", "path" : "/lib/x86_64-linux-gnu/libm.so.6", "elfType" : 3 }, { "b" : "7F27AE27A000", "path" : "/lib/x86_64-linux-gnu/libgcc_s.so.1", "elfType" : 3 }, { "b" : "7F27ADEB4000", "path" : "/lib/x86_64-linux-gnu/libc.so.6", "elfType" : 3 }, { "b" : "7F27AF0C4000", "path" : "/lib64/ld-linux-x86-64.so.2", "elfType" : 3 } ] }}
       m30999|  mongos(_ZN5mongo15printStackTraceERSo+0x29) [0xa41c39]
       m30999|  mongos(_ZN5mongo10logContextEPKc+0xE1) [0x9f21b1]
       m30999|  mongos(_ZN5mongo12verifyFailedEPKcS1_j+0xCE) [0x9d62ee]
       m30999|  mongos(+0x2E740D) [0x6e740d]
       m30999|  mongos(_ZN5mongo21ShardedMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE+0x13A) [0x5a96ca]
       m30999|  mongos(_ZN5mongo17PortMessageServer17handleIncomingMsgEPv+0x34B) [0x9fe63b]
       m30999|  libpthread.so.0(+0x8182) [0x7f27aeeae182]
       m30999|  libc.so.6(clone+0x6D) [0x7f27adfaf30d]
       m30999| -----  END BACKTRACE  -----
      

            Assignee:
            rassi J Rassi
            Reporter:
            rassi J Rassi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: