[SERVER-83659] updateArrayFilters is incremented twice on timeseries retryable write Created: 28/Nov/23  Updated: 05/Dec/23  Resolved: 05/Dec/23

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

Type: Bug Priority: Major - P3
Reporter: Frederic Vitzikam Assignee: Yuhong Zhang
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Storage Execution
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution Team 2023-12-11
Participants:

 Description   

Running the following once increases updateArrayFilters by 2 in serverStatus.metrics.update:

{
	"update" : "testColl",
	"updates" : [
		{
			"q" : {
				"_id" : 1,
				"timestamp" : ISODate("2021-05-18T00:00:00Z")
			},
			"u" : {
				"$set" : {
					"a.$[i].b" : 7
				}
			},
			"arrayFilters" : [
				{
					"i.b" : 6
				}
			]
		}
	],
	"writeConcern" : {
		"w" : "majority"
	},
	"lsid" : {
		"id" : UUID("7c4f9933-4a2a-4716-b6b8-f8e42fee6b3a")
	},
	"txnNumber" : NumberLong(11)
}

I think it is because this code means we go into this twice.

Maybe the incrementUpdateMetrics loop should be in a if(!isTimeseriesViewRequest || !opCtx->isRetryableWrite() || !opCtx->inMultiDocumentTransaction()) or similar ?

I added a TODO for this in a bulk_write js test comparing those metrics between bulkWrite and non-bulkWrite.



 Comments   
Comment by Githook User [ 05/Dec/23 ]

Author:

{'name': 'Yuhong Zhang', 'email': 'yuhong.zhang@mongodb.com', 'username': 'YuhongZhang98'}

Message: SERVER-83659 Correctly handle command metrics for retryable time-series updates

GitOrigin-RevId: ff3d89d9de85f945da57d44ae0461eb09cfd6a1c
Branch: master
https://github.com/mongodb/mongo/commit/a37dd902790b062a41fa87aacf57adce8ba503e6

Generated at Thu Feb 08 06:52:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.