[JAVA-3555] Work around changes to mapReduce implementation in the 4.4. server Created: 17/Dec/19  Updated: 28/Oct/23  Resolved: 18/Dec/19

Status: Closed
Project: Java Driver
Component/s: Query Operations
Affects Version/s: None
Fix Version/s: 3.12.1

Type: Improvement Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Jeffrey Yemin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-45105 Keep supporting finalize: null in map... Closed
related to SERVER-45210 Accept and ignore the nonAtomic:true ... Closed
related to SERVER-45211 Sharded cluster fails on mapReduce wi... Closed
Backwards Compatibility: Minor Change

 Description   

MongoDB 4.4 introduces several changes to mapReduce implementation which break assumptions in both the driver's implementation of mapReduce and the tests. This ticket is to address those changes



 Comments   
Comment by Githook User [ 15/Jan/20 ]

Author:

{'name': 'Jeff Yemin', 'username': 'jyemin', 'email': 'jeff.yemin@10gen.com'}

Message: Ensure collection exists prior to outputting mapReduce results to it

This works around a behavioral change in the 4.4 server's mapReduce
implementation on sharded clusters

JAVA-3555
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/14d72f00f345dafd23d91294ae080328dd6cd88f

Comment by Githook User [ 15/Jan/20 ]

Author:

{'name': 'Jeff Yemin', 'username': 'jyemin', 'email': 'jeff.yemin@10gen.com'}

Message: Make map and reduce functions more realistic in mapReduce collation test

The functions that were used exposed a subtle difference in server behavior
that the test was not intending to exercise. This change ensures that
the map and reduce functions will behave consistently on all server versions

JAVA-3555
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/3289efe0b74ec29265bacbd28da062cdeae75cef

Comment by Githook User [ 15/Jan/20 ]

Author:

{'name': 'Jeff Yemin', 'username': 'jyemin', 'email': 'jeff.yemin@10gen.com'}

Message: Remove assumptions about result order for mapReduce

Several driver tests assume mapReduce results are returned in
a particular order even in the absence of a sort criteria.

Remove those assumptions by comparing the results as a Set instead of a List

JAVA-3555
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/4a1b4cb93d5ad35c2af05692cb4614188b451c28

Comment by Githook User [ 15/Jan/20 ]

Author:

{'name': 'Jeff Yemin', 'username': 'jyemin', 'email': 'jeff.yemin@10gen.com'}

Message: Avoid including default or null values in mapReduceCommand

  • No longer sending null values for the query, sort, finalize, and scope fields
  • No longer sending false values for the sharded and nonAtomic fields of the out sub-document

JAVA-3555
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/e397462b100e22d7f5c9c72fbfce3f882d3d9a0b

Comment by Githook User [ 18/Dec/19 ]

Author:

{'name': 'Jeff Yemin', 'email': 'jeff.yemin@10gen.com', 'username': 'jyemin'}

Message: Ensure collection exists prior to outputting mapReduce results to it

This works around a behavioral change in the 4.4 server's mapReduce
implementation on sharded clusters

JAVA-3555
Branch: 3.12.x
https://github.com/mongodb/mongo-java-driver/commit/b8c5851bf9db72fdd71e3cd94360256ac949ed92

Comment by Githook User [ 18/Dec/19 ]

Author:

{'name': 'Jeff Yemin', 'email': 'jeff.yemin@10gen.com', 'username': 'jyemin'}

Message: Make map and reduce functions more realistic in mapReduce collation test

The functions that were used exposed a subtle difference in server behavior
that the test was not intending to exercise. This change ensures that
the map and reduce functions will behave consistently on all server versions

JAVA-3555
Branch: 3.12.x
https://github.com/mongodb/mongo-java-driver/commit/ecc8e23309dd2f8457b46c9efe77bcc79997d3a6

Comment by Githook User [ 18/Dec/19 ]

Author:

{'name': 'Jeff Yemin', 'email': 'jeff.yemin@10gen.com', 'username': 'jyemin'}

Message: Remove assumptions about result order for mapReduce

Several driver tests assume mapReduce results are returned in
a particular order even in the absence of a sort criteria.

Remove those assumptions by comparing the results as a Set instead of a List

JAVA-3555
Branch: 3.12.x
https://github.com/mongodb/mongo-java-driver/commit/4d7a0d54f94936ee63debaea66f3381db5f5af99

Comment by Githook User [ 18/Dec/19 ]

Author:

{'name': 'Jeff Yemin', 'email': 'jeff.yemin@10gen.com', 'username': 'jyemin'}

Message: Avoid including default or null values in mapReduceCommand

  • No longer sending null values for the query, sort, finalize, and scope fields
  • No longer sending false values for the sharded and nonAtomic fields of the out sub-document

JAVA-3555
Branch: 3.12.x
https://github.com/mongodb/mongo-java-driver/commit/a97d7d8acb3afdfaf8f92bd4f8d71157f32dbdb4

Generated at Thu Feb 08 08:59:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.