Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-83659

updateArrayFilters is incremented twice on timeseries retryable write

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Storage Execution
    • Fully Compatible
    • ALL
    • Execution Team 2023-12-11

      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.

            Assignee:
            yuhong.zhang@mongodb.com Yuhong Zhang
            Reporter:
            frederic.vitzikam@mongodb.com Frederic Vitzikam
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: