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

Uploading ~500000 small tables into collections interrupts with error and even breaks MongoDB

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      elementary OS 5.1.7
      MongoDB shell version v4.4.4
      PyMongo 3.11.2
    • ALL
    •  

      Source data.
      A large number (in my case, 500409) of TSVs. The size of each is most often no more than 100 rows.

      My actions.
      I tried to convert each table to collection using my well-tested Python program.

      Error.
      After ~15 minutes of running the program an error occurs:

      multiprocessing.pool.RemoteTraceback: 
      """
      Traceback (most recent call last):
        File "/home/platon/miniconda3/lib/python3.7/multiprocessing/pool.py", line 121, in worker
          result = (True, func(*args, **kwds))
        File "/home/platon/miniconda3/lib/python3.7/multiprocessing/pool.py", line 44, in mapstar
          return list(map(*args))
        File "create_db.py", line 211, in create_collection
          'block_compressor=zstd'}})
        File "/home/platon/miniconda3/lib/python3.7/site-packages/pymongo/database.py", line 408, in create_collection
          with self.__client._tmp_session(session) as s:
        File "/home/platon/miniconda3/lib/python3.7/contextlib.py", line 112, in __enter__
          return next(self.gen)
        File "/home/platon/miniconda3/lib/python3.7/site-packages/pymongo/mongo_client.py", line 1829, in _tmp_session
          s = self._ensure_session(session)
        File "/home/platon/miniconda3/lib/python3.7/site-packages/pymongo/mongo_client.py", line 1816, in _ensure_session
          return self.__start_session(True, causal_consistency=False)
        File "/home/platon/miniconda3/lib/python3.7/site-packages/pymongo/mongo_client.py", line 1766, in __start_session
          server_session = self._get_server_session()
        File "/home/platon/miniconda3/lib/python3.7/site-packages/pymongo/mongo_client.py", line 1802, in _get_server_session
          return self._topology.get_server_session()
        File "/home/platon/miniconda3/lib/python3.7/site-packages/pymongo/topology.py", line 488, in get_server_session
          None)
        File "/home/platon/miniconda3/lib/python3.7/site-packages/pymongo/topology.py", line 217, in _select_servers_loop
          (self._error_message(selector), timeout, self.description))
      pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 111] Connection refused, Timeout: 30s, Topology Description: <TopologyDescription id: 605a9f0f977b5c231ff4873e, topology_type: Single, servers: [<ServerDescription ('localhost', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('localhost:27017: [Errno 111] Connection refused')>]>

      Global MongoDB breakdown.
      All further attempts to use MongoDB result in connection errors. Restarting the Mongo process doesn't help.

      mongo
      MongoDB shell version v4.4.4
       connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
       Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :
       connect@src/mongo/shell/mongo.js:374:17
       @(connect):2:6
       exception: connect failed
       exiting with code 1


      Why do I consider this a MongoDB bug?
      The documentation does not describe any limits on the number of collections from the WiredTiger side.

        1. MongoDB_ECONNREFUSED.png
          MongoDB_ECONNREFUSED.png
          27 kB
        2. src_table_example.png
          src_table_example.png
          153 kB

            Assignee:
            dmitry.agranat@mongodb.com Dmitry Agranat
            Reporter:
            platon.work@gmail.com Platon workaccount
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: