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.

    XMLWordPrintable

    Details

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

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: