Summary
In mixed-version clusters where a last-continuous (pre-9.0) mongos is present, reshardCollection for timeseries collections is routed using the bucket namespace (e.g. db.system.buckets.coll), while updateZoneKeyRange stores zone tags under the user-facing namespace (e.g. db.coll). When resharding commits, writeDecisionPersistedState only deletes config.tags entries for sourceNss (the bucket namespace), leaving behind orphaned tag documents under the user-facing namespace.
Root Cause
In src/mongo/db/s/resharding/resharding_coordinator_service_util.cpp, the writeDecisionPersistedState function calls removeTagsDocs with a query for coordinatorDoc.getSourceNss(). When a pre-9.0 mongos routes the reshardCollection command, sourceNss is the bucket namespace (system.buckets.X). Zone tags written via updateZoneKeyRange on a new-binary mongos use the user-facing namespace — those entries are never cleaned up on commit.
Fix
After deleting tags for sourceNss, additionally check sourceNss.isTimeseriesBucketsCollection(). If true, derive the user-facing view namespace and delete any config.tags entries under that namespace as well.
Testing
The assertion verifying zero orphaned tags is in jstests/sharding/resharding_timeseries/reshard_timeseries_update_tag_zones.js (postCheckFn). It is temporarily disabled in SERVER-126221 (which introduces the test infrastructure) with a TODO to re-enable it here.
Depends on
SERVER-126221 (introduces the resharding timeseries zone test infrastructure that exercises this bug)
- related to
-
SERVER-128606 SERVER-127450 Fix orphaned config.tags cleanup for timeseries resharding [v8.0 backport]
-
- Closed
-
-
SERVER-128607 SERVER-127450 Fix orphaned config.tags cleanup for timeseries resharding [v8.3 backport]
-
- Closed
-
-
SERVER-128947 Fix removeTagsMetadataFromConfig namespace mismatch in DropCollectionCoordinator for viewful timeseries collections
-
- Needs Scheduling
-
-
SERVER-129106 Scrub pre-existing orphaned config.tags entries for timeseries collections during v9.0 FCV upgrade
-
- Needs Scheduling
-