[SERVER-45599] Backport the changes to CollectionShardingState done as part of SERVER-32198 to 4.0 Created: 16/Jan/20  Updated: 29/Oct/23  Resolved: 02/Mar/20

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.0.17

Type: Task Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Kaloian Manassiev
Resolution: Fixed Votes: 0
Labels: PM-1645-Milestone-1
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-32198 Missing collection metadata on the sh... Closed
Problem/Incident
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2020-01-27, Sharding 2020-02-10, Sharding 2020-03-09
Participants:
Linked BF Score: 0

 Description   

The incremental changes under SERVER-32198 cleaned up the CollectionShardingState/Runtime, but were never backported all the way to 4.0. In order to complete this ticket and have it available in 4.0 we need to finish backporting these changes and this ticket will be used to track that work. When it is done, master, 4.2 and 4.0 will be at the same level of functionality to actually be able to throw SSV in all code paths, when the filtering metadata is not yet known.



 Comments   
Comment by Githook User [ 26/Feb/20 ]

Author:

{'name': 'Kaloian Manassiev', 'username': 'kaloianm', 'email': 'kaloian.manassiev@mongodb.com'}

Message: SERVER-45599 Backport of SERVER-39495: Move ShardingState::needCollectionMetadata under OperationShardingState

ShardingState logically contains answers to questions about whether the
current instance is node in a sharded cluster, whereas
OperationShardingState is responsible for the 'shardedness' of the
commands.

This is a partial cherry-pick from b049257fbd1d215388cffaf7544f6741dbce5b45, adapted for the 4.0 branch.

Also backports the addition of more testing for multi:true/justOne:false updates and ChangeStreams, which was taken from commit 50f6bd4d6a9428a6f1df22db792d7b55d773762c.
Branch: v4.0
https://github.com/mongodb/mongo/commit/fcd2dd41189fffc6e67a8645b99974178f87ca04

Comment by Githook User [ 26/Feb/20 ]

Author:

{'username': 'kaloianm', 'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com'}

Message: SERVER-45599 Backport of SERVER-39495: Only return versioned filtering metadata for cases that actually need to do filtering

This is a partial cherry-pick from 851dad7902d6bb8c3ed25f99f565a2e2c8c8bc47, adapted for the 4.0 branch.
Branch: v4.0
https://github.com/mongodb/mongo/commit/62a6b963bc20ba74d2f3e0d62552dc3b7b1f1133

Comment by Githook User [ 26/Feb/20 ]

Author:

{'name': 'Kaloian Manassiev', 'username': 'kaloianm', 'email': 'kaloian.manassiev@mongodb.com'}

Message: SERVER-45599 Backport of SERVER-32198: Split CollectionShardingState::getMetadata into three methods

o getCurrentMetadataIfKnown - which returns the current filtering metadata if any is available
o getMetadataForOperation - which returns the metadata which is required by the current opertion, based on the OperationShardingState
o getCurrentMetadata - which returns the currently available filtering metadata (or UNSHARDED if not known)

This is in preparation for making getMetadataForOperation/getCurrentMetadata throw StaleShardVersion exception if the metadata has not been loaded yet.

This is a partial cherry-pick from dcf7e0dd89d34f58b592f1adb3d41e5edd6e2012, adapted for the 4.0 branch.
Branch: v4.0
https://github.com/mongodb/mongo/commit/b41cd4b2c416e965fc3541c97cd0b51563d90c40

Comment by Githook User [ 26/Feb/20 ]

Author:

{'name': 'Kaloian Manassiev', 'username': 'kaloianm', 'email': 'kaloian.manassiev@mongodb.com'}

Message: SERVER-45599 Backport of SERVER-32198: Make MetadataManager support an 'UNKNOWN' filtering metadata state

This is partial cherry-pick of the changes done under 20117b8ee9678794be675eb4d728bfcc8f9d75f4 to make the 4.0 logic match that of 4.2.
Branch: v4.0
https://github.com/mongodb/mongo/commit/96ced970aef7c5dbf81b660009bb80f33d8026e8

Comment by Githook User [ 25/Feb/20 ]

Author:

{'username': 'kaloianm', 'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com'}

Message: SERVER-45599 Backport the 'assertChangeStreamEventEq' function from master

This function is necessary for adding change streams testing and was
picked up from these two commits: 065f3ef77de and 38a0e128d66, but it
doesn't backport the commits themselves.
Branch: v4.0
https://github.com/mongodb/mongo/commit/6a5e4ec3084a1067f25d3aa904e1dac2c2abc90e

Comment by Githook User [ 29/Jan/20 ]

Author:

{'name': 'Kaloian Manassiev', 'username': 'kaloianm', 'email': 'kaloian.manassiev@mongodb.com'}

Message: Revert "SERVER-45599 Backport the 'assertChangeStreamEventEq' function from master"

This reverts commit 0363c1d062483022c7c1d2f2357edee3713073ca.
Branch: v4.0
https://github.com/mongodb/mongo/commit/2a5433168a53044cb6b4fa8083e4cfd7ba142221

Comment by Githook User [ 29/Jan/20 ]

Author:

{'name': 'Kaloian Manassiev', 'username': 'kaloianm', 'email': 'kaloian.manassiev@mongodb.com'}

Message: Revert "SERVER-45599 Backport of SERVER-32198: Make MetadataManager support an 'UNKNOWN' filtering metadata state"

This reverts commit e4e052a10484cf2cc44c62c377db4ece8162820a.
Branch: v4.0
https://github.com/mongodb/mongo/commit/132aa852b1ae87f48165dbdf50943f32d2376c73

Comment by Githook User [ 29/Jan/20 ]

Author:

{'name': 'Kaloian Manassiev', 'username': 'kaloianm', 'email': 'kaloian.manassiev@mongodb.com'}

Message: Revert "SERVER-45599 Backport of SERVER-32198: Split CollectionShardingState::getMetadata into three methods"

This reverts commit a414e4ceafb45dc6ebf4daeb9198f0a7f3fb189c.
Branch: v4.0
https://github.com/mongodb/mongo/commit/c25809db3532d2af31321648790e775bd420e600

Comment by Githook User [ 29/Jan/20 ]

Author:

{'name': 'Kaloian Manassiev', 'username': 'kaloianm', 'email': 'kaloian.manassiev@mongodb.com'}

Message: Revert "SERVER-45599 Backport of SERVER-39495: Only return versioned filtering metadata for cases that actually need to do filtering"

This reverts commit fe4ced8f98d731883e5a4511d434716629e457a8.
Branch: v4.0
https://github.com/mongodb/mongo/commit/a7e9c2223a6aa92f6648d3800d251d8335cd1881

Comment by Githook User [ 29/Jan/20 ]

Author:

{'name': 'Kaloian Manassiev', 'username': 'kaloianm', 'email': 'kaloian.manassiev@mongodb.com'}

Message: Revert "SERVER-45599 Backport of SERVER-39495: Move ShardingState::needCollectionMetadata under OperationShardingState"

This reverts commit 1a01c53df8f7c1e016c0ccbc38b77f6b3508bf65.
Branch: v4.0
https://github.com/mongodb/mongo/commit/385511e9d05b254beb6767ed92a3cd95e83ea166

Comment by Githook User [ 26/Jan/20 ]

Author:

{'username': 'kaloianm', 'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com'}

Message: SERVER-45599 Backport of SERVER-39495: Move ShardingState::needCollectionMetadata under OperationShardingState

ShardingState logically contains answers to questions about whether the
current instance is node in a sharded cluster, whereas
OperationShardingState is responsible for the 'shardedness' of the
commands.

This is a partial cherry-pick from b049257fbd1d215388cffaf7544f6741dbce5b45, adapted for the 4.0 branch.

Also backports the addition of more testing for multi:true/justOne:false updates and ChangeStreams, which was taken from commit 50f6bd4d6a9428a6f1df22db792d7b55d773762c.
Branch: v4.0
https://github.com/mongodb/mongo/commit/1a01c53df8f7c1e016c0ccbc38b77f6b3508bf65

Comment by Githook User [ 26/Jan/20 ]

Author:

{'email': 'kaloian.manassiev@mongodb.com', 'username': 'kaloianm', 'name': 'Kaloian Manassiev'}

Message: SERVER-45599 Backport of SERVER-39495: Only return versioned filtering metadata for cases that actually need to do filtering

This is a partial cherry-pick from 851dad7902d6bb8c3ed25f99f565a2e2c8c8bc47, adapted for the 4.0 branch.
Branch: v4.0
https://github.com/mongodb/mongo/commit/fe4ced8f98d731883e5a4511d434716629e457a8

Comment by Githook User [ 25/Jan/20 ]

Author:

{'email': 'kaloian.manassiev@mongodb.com', 'username': 'kaloianm', 'name': 'Kaloian Manassiev'}

Message: SERVER-45599 Backport of SERVER-32198: Split CollectionShardingState::getMetadata into three methods

o getCurrentMetadataIfKnown - which returns the current filtering
metadata if any is available
o getMetadataForOperation - which returns the metadata which is required
by the current opertion, based on the OperationShardingState
o getCurrentMetadata - which returns the currently available filtering
metadata (or UNSHARDED if not known)

This is in preparation for making
getMetadataForOperation/getCurrentMetadata throw
StaleShardVersion exception if the metadata has not been loaded yet.

This is a partial cherry-pick from dcf7e0dd89d34f58b592f1adb3d41e5edd6e2012, adapted for the 4.0 branch.
Branch: v4.0
https://github.com/mongodb/mongo/commit/a414e4ceafb45dc6ebf4daeb9198f0a7f3fb189c

Comment by Githook User [ 24/Jan/20 ]

Author:

{'username': 'kaloianm', 'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com'}

Message: SERVER-45599 Backport of SERVER-32198: Make MetadataManager support an 'UNKNOWN' filtering metadata state

This is partial cherry-pick of the changes done under 20117b8ee9678794be675eb4d728bfcc8f9d75f4 to make the 4.0 logic match that of 4.2.
Branch: v4.0
https://github.com/mongodb/mongo/commit/e4e052a10484cf2cc44c62c377db4ece8162820a

Comment by Githook User [ 24/Jan/20 ]

Author:

{'username': 'kaloianm', 'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com'}

Message: SERVER-45599 Backport the 'assertChangeStreamEventEq' function from master

This function is necessary for adding change streams testing and was
picked up from these two commits: 065f3ef77de and 38a0e128d66, but it
doesn't backport the commits themselves.
Branch: v4.0
https://github.com/mongodb/mongo/commit/0363c1d062483022c7c1d2f2357edee3713073ca

Generated at Thu Feb 08 05:09:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.