File tree Expand file tree Collapse file tree 2 files changed +2
-31
lines changed Expand file tree Collapse file tree 2 files changed +2
-31
lines changed Original file line number Diff line number Diff line change @@ -892,24 +892,16 @@ private BulkWriteError getBulkWriteError(final WriteConcernException writeExcept
892
892
893
893
// Accommodating GLE representation of write concern errors
894
894
private boolean isWriteConcernError (final CommandResult commandResult ) {
895
- return commandResult .get ("wtimeout" ) != null || commandResult . get ( "wnote" ) != null || commandResult . get ( "jnote" ) != null ;
895
+ return commandResult .get ("wtimeout" ) != null ;
896
896
}
897
897
898
898
private WriteConcernError getWriteConcernError (final CommandResult commandResult ) {
899
899
return new WriteConcernError (commandResult .getCode (), getWriteConcernErrorMessage (commandResult ),
900
900
getErrorResponseDetails (commandResult ));
901
901
}
902
902
903
- // GLE uses jnote and wnote as alternative ways or reporting write concern errors
904
903
private String getWriteConcernErrorMessage (final CommandResult commandResult ) {
905
- String errorMessage = commandResult .getString ("jnote" );
906
- if (errorMessage == null ) {
907
- errorMessage = commandResult .getString ("wnote" );
908
- }
909
- if (errorMessage == null ) {
910
- errorMessage = commandResult .getString ("err" );
911
- }
912
- return errorMessage ;
904
+ return commandResult .getString ("err" );
913
905
}
914
906
915
907
private DBObject getErrorResponseDetails (final DBObject response ) {
Original file line number Diff line number Diff line change @@ -634,27 +634,6 @@ class BulkWriteOperationSpecification extends FunctionalSpecification {
634
634
ordered << [true , false ]
635
635
}
636
636
637
- def ' when w > 1 write concern is used on a standalone server without write commands, BulkWriteException is thrown' () {
638
- assumeTrue(isStandalone() && ! serverIsAtLeastVersion(2.6 ))
639
-
640
- given :
641
- def operation = collection. initializeUnorderedBulkOperation()
642
- operation. insert(new BasicDBObject (' _id' , 1 ))
643
- operation. insert(new BasicDBObject (' _id' , 2 ))
644
-
645
- when :
646
- operation. execute(new WriteConcern (2 , 1 ))
647
-
648
- then :
649
- def e = thrown(BulkWriteException )
650
- e. writeResult == new AcknowledgedBulkWriteResult (INSERT , 2 , [])
651
- e. writeConcernError != null
652
- e. writeConcernError. getDetails(). containsField(' wnote' )
653
-
654
- where :
655
- ordered << [true , false ]
656
- }
657
-
658
637
def ' when j write concern is used on a server without journaling or write commands, BulkWriteException is thrown' () {
659
638
assumeTrue(! isSharded() && isServerStartedWithJournalingDisabled() && ! serverIsAtLeastVersion(2.6 ))
660
639
You can’t perform that action at this time.
0 commit comments