Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-1811

mongoimport can report incorrect number inserted if a JSON error occurs.

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: mongoimport
    • Labels:
      None

      It looks like there's a race condition between two goroutines: one that reads input data and one that bulk inserts data. The "count insertions" code is on the bulk insert side as is optimistic – increment a counter for document queued to send and then decrement later for errors after the bulk is flushed to the database. Because the error reading data aborts the program early, it can report the number of insertions (queued) rather than the number actually sent to the server.

            Assignee:
            david.golden@mongodb.com David Golden
            Reporter:
            david.golden@mongodb.com David Golden
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: