-
Type: Bug
-
Resolution: Done
-
Priority: Critical - P2
-
Affects Version/s: 3.2.0
-
Component/s: Storage
-
Fully Compatible
-
ALL
-
-
Integration 10 (02/22/16)
Error:
Collection::insertDocument got document without _id for ns...
We are using POCO MongoDB connector to write/read MongoDB.
http://pocoproject.org/docs-1.6.0/Poco.MongoDB.html
It works fine 2.x, 3.0 and 3.1 version. But failed to insert large document above 256k from MongoDB 3.2 version.
The problem we found is because mongo does not generate index ID so the exception happened in Collection::insertDocuments:
for (auto it = begin; it != end; it++) { if (hasIdIndex && (*it)["_id"].eoo()) { return Status(ErrorCodes::InternalError, str::stream() << "Collection::insertDocument got " "document without _id for ns:" << _ns.ns()); } auto status = checkValidation(txn, *it); if (!status.isOK()) return status; }
From debugging we found the insert process in insertMulti function go directly to insertMultiSingletons which use insertDocument without generating index ID. It seems not right. Only document larger than 256K has the problem because insertVectorMaxBytes is 256k.
I have attached a test file written by POCO C++ to replicate this problem.
- is duplicated by
-
SERVER-22637 OP_INSERT can fail when inserted document contains no _id
- Closed