[SERVER-81379] `delete` and `update` mishandle `collectionUUID` Created: 22/Sep/23  Updated: 14/Nov/23  Resolved: 20/Oct/23

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

Type: Bug Priority: Major - P3
Reporter: Felipe Gasper Assignee: Gregory Noma
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-81433 Test time-series arbitrary updates wi... Closed
is duplicated by SERVER-81434 Test time-series arbitrary deletes wi... Closed
Related
related to SERVER-82924 Time-series collections should indica... Open
Assigned Teams:
Storage Execution
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution NAMR Team 2023-10-16, Execution Team 2023-10-30
Participants:

 Description   

When I `delete` from a time-series collection with a `collectionUUID` the error is a bit strange:

db.runCommand({delete:"weather", collectionUUID: UUID("12345678-1234-1234-1234-f776a983614a"), deletes:[{ q:{ timestamp: new Date() }, limit: 0}]});
{
  n: 0,
  writeErrors: [
    {
      index: 0,
      code: 361,
      errmsg: 'Collection UUID does not match that specified',
      db: 'test',
      collectionUUID: new UUID("12345678-1234-1234-1234-f776a983614a"),
      expectedCollection: 'system.buckets.weather',
      actualCollection: null
    }
  ],
  ok: 1,
  '$clusterTime': {
    clusterTime: Timestamp({ t: 1695405156, i: 1 }),
    signature: {
      hash: Binary(Buffer.from("0000000000000000000000000000000000000000", "hex"), 0),
      keyId: Long("0")
    }
  },
  operationTime: Timestamp({ t: 1695405152, i: 1 })
}

Note that it says the "expectedCollection" is `system.buckets.weather`, not `weather`.

I see the same behavior with `update`.

I don't think this will cause breakage, and the `actualCollection` is correct when I give it the UUID of a real collection.

Seen in 7.0.1; it may affect other versions.



 Comments   
Comment by Githook User [ 20/Oct/23 ]

Author:

{'name': 'Gregory Noma', 'email': 'gregory.noma@gmail.com', 'username': 'gregorynoma'}

Message: SERVER-81379 Respect `collectionUUID` for time-series write commands
Branch: master
https://github.com/mongodb/mongo/commit/0b24bba0a6b29ff5f7554f9133229db82b4fe575

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