[SERVER-25061] Make CollectionShardingState a decoration on Collection Created: 14/Jul/16  Updated: 06/Dec/22  Resolved: 19/Dec/19

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

Type: Improvement Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: [DO NOT USE] Backlog - Sharding Team
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-24664 Get rid of calls to ShardingState::ge... Closed
Duplicate
is duplicated by SERVER-31902 Reduce contention on ShardingState::_... Closed
Assigned Teams:
Sharding
Sprint: Sharding 18 (08/05/16), Sharding 2016-08-29
Participants:

 Description   

Currently, the CollectionShardingState is kept on a map, which tracks the set of {{Collection}}s on the server. We should instead make it a decoration on the Collection in order to avoid the separate map lookup and mutex.

This also better ties the lifetime of a collection with that of its sharding state and allows us to potentially prevent direct drop of sharded collections.



 Comments   
Comment by Sheeri Cabral (Inactive) [ 19/Dec/19 ]

This is not a design change we want to make right now; if we find the pressing need in the future we can reopen.

Comment by Kaloian Manassiev [ 17/Nov/17 ]

Turns out that these calls cause contention on ShardingState::_mutex which ends up being called frequently. Because of this I am reopening this ticket.

Comment by Andy Schwerin [ 05/Dec/16 ]

There's no pressing need for this. If it comes up as part of future work, we can do it under separate cover then.

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