[SERVER-75364] deleteMany() on a timeseries collection fails to delete matched measurements when there are multiple covering indexes Created: 28/Mar/23  Updated: 03/Apr/23  Resolved: 28/Mar/23

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

Type: Bug Priority: Critical - P2
Reporter: Yoon Soo Kim Assignee: Yoon Soo Kim
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-74955 Refactor TS_MODIFY to unpack and writ... Closed
Operating System: ALL
Steps To Reproduce:

> db.createCollection("ts", {timeseries: {timeField: "t", metaField: "tag"}});
{ "ok" : 1 }
> db.ts.insert({t: new ISODate(), tag: 1, f: 1});
WriteResult({ "nInserted" : 1 })
> db.ts.createIndex({tag: 1});
{
	"numIndexesBefore" : 1,
	"numIndexesAfter" : 2,
	"createdCollectionAutomatically" : false,
	"ok" : 1
}
> db.ts.getIndexes();
[
	{
		"v" : 2,
		"key" : {
			"tag" : 1,
			"t" : 1
		},
		"name" : "tag_1_t_1"
	},
	{
		"v" : 2,
		"key" : {
			"tag" : 1
		},
		"name" : "tag_1"
	}
]
> db.ts.deleteMany({tag: 1, f: 1});
{ "acknowledged" : true, "deletedCount" : 0 }
> db.ts.dropIndex("tag_1");
{ "nIndexesWas" : 2, "ok" : 1 }
> db.ts.deleteMany({tag: 1, f: 1});
{ "acknowledged" : true, "deletedCount" : 1 }

Sprint: Execution Team 2023-04-03
Participants:
Generated at Thu Feb 08 06:29:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.