-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Execution
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Created from the following comment:
Stats setting silently ignored and unvalidated when sharding an existing collection Sharding or re-creating a collection that already exists accepts a statistics setting, reports success, and never applies or checks it. The impact is wrong expectations about query-planner statistics and a misleading log entry. No data is exposed and no permission is bypassed. Root cause: - persistentStatsConfig was added to ShardsvrCreateCollectionRequest (sharded_ddl_commands.idl:262). Its only use is makeCreateCommand (create_collection_coordinator.cpp:218), which is reached only when a collection is created locally. The existing-collection checks (create_collection_coordinator.cpp:699-723, 946) never compare this field, so the request succeeds without applying it. Validation (create_collection.cpp:431) is skipped on this path. Impact: The caller is told the operation succeeded, but the collection's stats configuration is unchanged. The change log at create_collection_coordinator.cpp:1066 records options that were never applied.
Add a test verifying that persistentStatsConfig are not lost when sharding a collection.