[SERVER-55272] Queries on sharded time-series buckets collections are not applying shard filters Created: 17/Mar/21  Updated: 27/Oct/23  Resolved: 31/Mar/21

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

Type: Bug Priority: Major - P3
Reporter: Louis Williams Assignee: Backlog - Storage Execution Team
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-55591 Store time-series collection metadata... Closed
Related
is related to SERVER-52528 test using an index on a time-series ... Closed
Assigned Teams:
Storage Execution
Operating System: ALL
Participants:

 Description   

I have a test that is returning the same document from two shards when I don't wait for the range deleter to clean up orphans. I will update with a reproducer after SERVER-52528 merges.

Investigate why queries on sharded time-series buckets collections using $_internalBucketUnpack are not applying a shard filter.



 Comments   
Comment by Louis Williams [ 31/Mar/21 ]

Fixed by SERVER-55591.

Comment by Louis Williams [ 29/Mar/21 ]

I'm pretty confident that this depends on SERVER-55591 to move the time-series metadata into the durable catalog. Non-primary shards do not have a system.views entry and therefore do not know when a namespace is actually a time-series collection.

Comment by Louis Williams [ 17/Mar/21 ]

This test fails on line 116 when line 108 is false.

That is, a query returns the same document twice, once from each shard. A shard filter should have been applied to filter out the document on the donor shard after the moveChunk operation.

[js_test:timeseries_sharded_query] uncaught exception: Error: [[
[js_test:timeseries_sharded_query] 	{
[js_test:timeseries_sharded_query] 		"time" : ISODate("2021-03-16T18:51:25.711Z"),
[js_test:timeseries_sharded_query] 		"hostName" : "host_19",
[js_test:timeseries_sharded_query] 		"_id" : 19,
[js_test:timeseries_sharded_query] 		"data" : 0.5697443887311241
[js_test:timeseries_sharded_query] 	}
[js_test:timeseries_sharded_query] ]] != [[
[js_test:timeseries_sharded_query] 	{
[js_test:timeseries_sharded_query] 		"time" : ISODate("2021-03-16T18:51:25.711Z"),
[js_test:timeseries_sharded_query] 		"hostName" : "host_19",
[js_test:timeseries_sharded_query] 		"_id" : 19,
[js_test:timeseries_sharded_query] 		"data" : 0.5697443887311241
[js_test:timeseries_sharded_query] 	},
[js_test:timeseries_sharded_query] 	{
[js_test:timeseries_sharded_query] 		"time" : ISODate("2021-03-16T18:51:25.711Z"),
[js_test:timeseries_sharded_query] 		"hostName" : "host_19",
[js_test:timeseries_sharded_query] 		"_id" : 19,
[js_test:timeseries_sharded_query] 		"data" : 0.5697443887311241
[js_test:timeseries_sharded_query] 	}
[js_test:timeseries_sharded_query] ]] are not equal :
[js_test:timeseries_sharded_query] doassert@src/mongo/shell/assert.js:20:14
[js_test:timeseries_sharded_query] assert.docEq@src/mongo/shell/assert.js:205:9
[js_test:timeseries_sharded_query] metaShardKeyCollation@jstests/sharding/timeseries_sharded_query.js:116:5
[js_test:timeseries_sharded_query] @jstests/sharding/timeseries_sharded_query.js:76:11
[js_test:timeseries_sharded_query] @jstests/sharding/timeseries_sharded_query.js:10:2

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