[SERVER-13121] ninserted is one too few, for write command batch inserts Created: 10/Mar/14 Updated: 10/Dec/14 Resolved: 20/Mar/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 2.6.0-rc0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Peter Garafano (Inactive) | Assignee: | Eric Milkie |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| Description |
|
When using bulk insert on 2.6.0-rc1, the log shows "ninserted:999" when the driver reports 1000 documents inserted during the operation. I have verified that 1000 documents were inserted into the collection by doing a .count() on the collection pre and post insert. I can supply a sample Java program if needed. |
| Comments |
| Comment by Eric Milkie [ 20/Mar/14 ] | ||
|
A fix for this was committed last night to the 2.6 branch, as part of | ||
| Comment by Eric Milkie [ 10/Mar/14 ] | ||
|
The behavior of inserts changed with a commit made this morning ( | ||
| Comment by Jeffrey Yemin [ 10/Mar/14 ] | ||
|
I moved this issue out of the SERVER project prematurely. Stepping through the Java driver code, I can see that the splitting is happening correctly and the insert command is correctly returning { n : 1000 }. Furthermore, if I dial the batch size in the test program down to 1, I see this in the server logs:
My conclusion is that the server is logging incorrectly. | ||
| Comment by Jeffrey Yemin [ 10/Mar/14 ] | ||
|
Thanks, I'll step through and see what's going on. | ||
| Comment by Peter Garafano (Inactive) [ 10/Mar/14 ] | ||
|
Latest output from mongod: 2014-03-10T16:12:42.064-0400 [conn2] insert BulkLoadTestDb.BulkLoadTestCol ninserted:999 keyUpdates:0 numYields:0 locks(micros) w:67380 110ms keyUpdates:0 numYields:0 reslen:40 112ms keyUpdates:0 numYields:0 reslen:40 114ms keyUpdates:0 numYields:0 reslen:40 113ms keyUpdates:0 numYields:0 reslen:40 116ms keyUpdates:0 numYields:0 reslen:40 112ms keyUpdates:0 numYields:0 reslen:40 105ms keyUpdates:0 numYields:0 reslen:40 102ms keyUpdates:0 numYields:0 reslen:40 118ms keyUpdates:0 numYields:0 reslen:40 143ms keyUpdates:0 numYields:0 reslen:40 117ms keyUpdates:0 numYields:0 reslen:40 159ms keyUpdates:0 numYields:0 reslen:40 111ms keyUpdates:0 numYields:0 reslen:40 103ms keyUpdates:0 numYields:0 reslen:40 108ms keyUpdates:0 numYields:0 reslen:40 106ms keyUpdates:0 numYields:0 reslen:40 118ms Using Java driver 2.12.0-rc1 Calls to getInsertedCount() return 1000. | ||
| Comment by Jeffrey Yemin [ 10/Mar/14 ] | ||
|
This looks to be a duplicate of | ||
| Comment by Jeffrey Yemin [ 10/Mar/14 ] | ||
|
Moving this issue to the JAVA driver. | ||
| Comment by Peter Garafano (Inactive) [ 10/Mar/14 ] | ||
|
milkie I was under the impression the driver wouldn't split as long as the batch size is <= 1000. It is possible that the driver is splitting into 999 and 1. Any ideas on how to confirm this? I attached both a screenshot of the output I see, and a program to generate it. | ||
| Comment by Eric Milkie [ 10/Mar/14 ] | ||
|
Sorry, that ticket I realize is for the shell. Java driver may have a similar issue. When you say "the log shows", are you seeing just the slowms logging? If the java driver splits the batch into 999 and 1, the batch of 1 may be too fast to show up in the log. | ||
| Comment by Eric Milkie [ 10/Mar/14 ] | ||
|
See linked ticket. | ||
| Comment by Eric Milkie [ 10/Mar/14 ] | ||
|
I believe you are hitting this bug that was just fixed in the shell in master. | ||
| Comment by J Rassi [ 10/Mar/14 ] | ||
|
peter.garafano: yes, could you please attach to this ticket the source file of the program that reproduces this issue? Thanks. |