@@ -217,8 +217,6 @@ def base_spec(operation_id, session)
217217 end
218218
219219 def execute_operation ( name , values , connection , context , operation_id , result_combiner , session , txn_num = nil )
220- validate_collation! ( connection )
221- validate_array_filters! ( connection )
222220 validate_hint! ( connection )
223221
224222 unpin_maybe ( session , connection ) do
@@ -234,13 +232,9 @@ def execute_operation(name, values, connection, context, operation_id, result_co
234232 end
235233 end
236234 end
237- # With OP_MSG (3.6+ servers), the size of each section in the message
235+ # The size of each section in the message
238236 # is independently capped at 16m and each bulk operation becomes
239237 # its own section. The size of the entire bulk write is limited to 48m.
240- # With OP_QUERY (pre-3.6 servers), the entire bulk write is sent as a
241- # single document and is thus subject to the 16m document size limit.
242- # This means the splits differ between pre-3.6 and 3.6+ servers, with
243- # 3.6+ servers being able to split less.
244238 rescue Error ::MaxBSONSize , Error ::MaxMessageSize => e
245239 raise e if values . size <= 1
246240 unpin_maybe ( session , connection ) do
@@ -297,33 +291,19 @@ def update_many(documents, connection, context, operation_id, session, txn_num)
297291
298292 private
299293
300- def validate_collation! ( connection )
301- if op_combiner . has_collation? && !connection . features . collation_enabled?
302- raise Error ::UnsupportedCollation . new
303- end
304- end
305-
306- def validate_array_filters! ( connection )
307- if op_combiner . has_array_filters? && !connection . features . array_filters_enabled?
308- raise Error ::UnsupportedArrayFilters . new
309- end
310- end
311-
312294 def validate_hint! ( connection )
313295 if op_combiner . has_hint?
314296 if !can_hint? ( connection ) && write_concern && !write_concern . acknowledged?
315297 raise Error ::UnsupportedOption . hint_error ( unacknowledged_write : true )
316- elsif !connection . features . update_delete_option_validation_enabled?
317- raise Error ::UnsupportedOption . hint_error
318298 end
319299 end
320300 end
321301
322302 # Loop through the requests and check if each operation is allowed to send
323303 # a hint for each operation on the given server version.
324304 #
325- # For the following operations, the client can send a hint for servers >= 4.2
326- # and for the rest, the client can only send it for 4.4+:
305+ # For the following operations, the client can send a hint for all supported
306+ # server versions, and for the rest, the client can only send it for 4.4+:
327307 # - updateOne
328308 # - updateMany
329309 # - replaceOne
@@ -333,13 +313,12 @@ def validate_hint!(connection)
333313 # @return [ true | false ] Whether the request is able to send hints for
334314 # the current server version.
335315 def can_hint? ( connection )
336- gte_4_2 = connection . server . description . server_version_gte? ( '4.2' )
337316 gte_4_4 = connection . server . description . server_version_gte? ( '4.4' )
338317 op_combiner . requests . all? do |req |
339318 op = req . keys . first
340319 if req [ op ] . keys . include? ( :hint )
341320 if [ :update_one , :update_many , :replace_one ] . include? ( op )
342- gte_4_2
321+ true
343322 else
344323 gte_4_4
345324 end
0 commit comments