Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -774,8 +774,11 @@ ClientBulkWriteResult build(@Nullable final MongoException topLevelError, final
for (BsonDocument individualOperationResponse : response.getCursorExhaust()) {
int individualOperationIndexInBatch = individualOperationResponse.getInt32("idx").getValue();
int writeModelIndex = batchStartModelIndex + individualOperationIndexInBatch;
if (individualOperationResponse.getNumber("ok").intValue() == 1) {
assertTrue(verboseResultsSetting);
if (individualOperationResponse.getNumber("ok").intValue() == 1 && verboseResultsSetting) {
// Note: Previously, assertTrue(verboseResultsSetting) was used here because the server was not supposed
// to return successful operation results in the cursor when verboseResultsSetting is false.
// Due to server bug SERVER-113344, these unexpected results must be ignored until we stop supporting server
// versions with this bug. When that happens, restore assertTrue(verboseResultsSetting) here.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave a TODO-<JAVA ticket ID> tag here, and create a corresponding ticket, which is linked as "blocked by" / "depends on" (not sure what relations we have) to the aforementioned server ticket.

AbstractClientNamespacedWriteModel writeModel = getNamespacedModel(models, writeModelIndex);
if (writeModel instanceof ConcreteClientNamespacedInsertOneModel) {
insertResults.put(
Expand Down