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

Cursor iteration freezes after first batch if no batchLimit is set

    • Type: Icon: Bug Bug
    • Resolution: Incomplete
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 4.0.18
    • Labels:
      None
    • ALL
    • Hide

      Don't know how to get to this behavior, but once you're there, can't really get read of it (100% reproduction).

      Show
      Don't know how to get to this behavior, but once you're there, can't really get read of it (100% reproduction).

      Hello,

      I have the following situation:

      • I have a GridFS bucket with 810,959 files (.files count) stored in 2,499,160 chunks (.chunks count)
      • I want to iterate over all entries in .chunks and print (just for sake of simplicity) the _id of each entry
      • for this I use the following command
      • db.sandboxReports.chunks.find({},{_id:1}).forEach(r=>print(r._id)) 

      During the time the query executes, I have the following output from currentOp:

                      {
                              "host" : "HOST_NAME_HERE:27017",
                              "desc" : "conn11650",
                              "connectionId" : 11650,
                              "client" : "127.0.0.1:48568",
                              "appName" : "MongoDB Shell",
                              "clientMetadata" : {
                                      "application" : {
                                              "name" : "MongoDB Shell"
                                      },
                                      "driver" : {
                                              "name" : "MongoDB Internal Client",
                                              "version" : "4.0.18"
                                      },
                                      "os" : {
                                              "type" : "Linux",
                                              "name" : "Ubuntu",
                                              "architecture" : "x86_64",
                                              "version" : "18.04"
                                      }
                              },
                              "active" : true,
                              "currentOpTime" : "2020-05-18T21:37:24.801+0000",
                              "opid" : 9652856,
                              "lsid" : {
                                      "id" : UUID("ab8e0656-ddd0-496e-8c1b-6c95dc9e35b3"),
                                      "uid" : BinData(0,"lrHY+QTs83BmclcR9MKKYcSvfFmsJ+jW+bP+OfRjiFM=")
                              },
                              "secs_running" : NumberLong(906),
                              "microsecs_running" : NumberLong(906036759),
                              "op" : "getmore",
                              "ns" : "DB_NAME.sandboxReports.chunks",
                              "command" : {
                                      "getMore" : NumberLong("171272634643"),
                                      "collection" : "sandboxReports.chunks",
                                      "lsid" : {
                                              "id" : UUID("ab8e0656-ddd0-496e-8c1b-6c95dc9e35b3")
                                      },
                                      "$clusterTime" : {
                                              "clusterTime" : Timestamp(1589836937, 5),
                                              "signature" : {
                                                      "hash" : BinData(0,"v8OUtyPICaqX5BTz+tZ3u/rAsV8="),
                                                      "keyId" : NumberLong("6785026434701197326")
                                              }
                                      },
                                      "$db" : "sandboxReports"
                              },
                              "originatingCommand" : {
                                      "find" : "sandboxReports.chunks",
                                      "filter" : {                                },
                                      "projection" : {
                                              "_id" : 1
                                      },
                                      "lsid" : {
                                              "id" : UUID("ab8e0656-ddd0-496e-8c1b-6c95dc9e35b3")
                                      },
                                      "$clusterTime" : {
                                              "clusterTime" : Timestamp(1589816462, 13),
                                              "signature" : {
                                                      "hash" : BinData(0,"ZTJm56Md0AIWuKYHN/EiyyopmLY="),
                                                      "keyId" : NumberLong("6785026434701197326")
                                              }
                                      },
                                      "$db" : "sandboxReports"
                              },
                              "planSummary" : "COLLSCAN",
                              "numYields" : 42856,
                              "locks" : {
                                      "Global" : "r",
                                      "Database" : "r",
                                      "Collection" : "r"
                              },
                              "waitingForLock" : false,
                              "lockStats" : {
                                      "Global" : {
                                              "acquireCount" : {
                                                      "r" : NumberLong(42857)
                                              }
                                      },
                                      "Database" : {
                                              "acquireCount" : {
                                                      "r" : NumberLong(42857)
                                              }
                                      },
                                      "Collection" : {
                                              "acquireCount" : {
                                                      "r" : NumberLong(42857)
                                              }
                                      }
                              }
                      },
       

      Server is MongoDB 4.0.18 running on Ubuntu 18.04 setup in replica set mode.

      I have tried to run the command on different servers from replica set

      If I can help you with other information, please let me know.

      Any help is greatly appreciated.

       

      Regards,
      Puiu

            Assignee:
            dmitry.agranat@mongodb.com Dmitry Agranat
            Reporter:
            phrenciuc@bitdefender.com Puiu Hrenciuc
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: