File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -860,10 +860,6 @@ private BulkWriteResult executeWriteProtocol() {
860
860
WriteResult writeResult = executeWriteProtocol (i );
861
861
if (writeConcern .callGetLastError ()) {
862
862
bulkWriteBatchCombiner .addResult (getResult (writeResult ), indexMap );
863
- // When a journaled write is requested but journaling is disabled, it's not thrown as an exception.
864
- if (isWriteConcernError (writeResult .getLastError ())) {
865
- bulkWriteBatchCombiner .addWriteConcernErrorResult (getWriteConcernError (writeResult .getLastError ()));
866
- }
867
863
}
868
864
} catch (WriteConcernException writeException ) {
869
865
if (isWriteConcernError (writeException .getCommandResult ())) {
Original file line number Diff line number Diff line change @@ -634,6 +634,23 @@ class BulkWriteOperationSpecification extends FunctionalSpecification {
634
634
ordered << [true , false ]
635
635
}
636
636
637
+ def ' when a replication timeout occurs, an exception is thrown' () {
638
+ assumeTrue(isReplicaSet())
639
+
640
+ given :
641
+ def operation = collection. initializeUnorderedBulkOperation()
642
+ operation. insert(new BasicDBObject (' _id' , 1 ))
643
+
644
+ when :
645
+ operation. execute(new WriteConcern (2 , 1 ))
646
+
647
+ then :
648
+ thrown(BulkWriteException )
649
+
650
+ where :
651
+ ordered << [true , false ]
652
+ }
653
+
637
654
def ' when j write concern is used on a server without journaling or write commands, BulkWriteException is thrown' () {
638
655
assumeTrue(! isSharded() && isServerStartedWithJournalingDisabled() && ! serverIsAtLeastVersion(2.6 ))
639
656
You can’t perform that action at this time.
0 commit comments