[SERVER-72370] Update in-memory serverless locks transactionally for tenant migration recipient Created: 22/Dec/22  Updated: 29/Oct/23  Resolved: 16/May/23

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

Type: Task Priority: Major - P3
Reporter: Didier Nadeau Assignee: Didier Nadeau
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-74966 Improve serverless lock/access blocke... Closed
Assigned Teams:
Serverless
Backwards Compatibility: Fully Compatible
Sprint: Server Serverless 2023-05-29
Participants:

 Description   

Related to the comment below from a PR :

 
We only need to install the access blocker only if the state of the document is kStarted. We can have a case where the state document is inserted with kDone (See here)

EDIT: I took a closer look into this onInsert opObserver code for namespace kTenantMigrationRecipientsNamespace. we are doing 2 things

  1. Need to acquire lock
  2. Need to install access blocker.

Item#1 is just checking the filed expireAt but not checking the state. I feel the contract should be do 1 & 2 only if the state is kStarted. I like the way donor insert opObserver is written. We should do something similar for more clarity (kStarted does 1 &2; kDone does noting; remaining state should uassert as ErrorCodes::IllegalOperation)
 

 

Just a followup comment, I noticed that we might miss releasing the lock in the following situation
Wuow starts
Insert state doc kStarted
Acquire lock via insert opObObserver
// For some reason, Wuow fails.
// Now, we don't release the lock.
Wuow commit(){{}}
I think we need to do register onRollback handler for this write unit of work to release the lock. I am ok addressing in a same or separate ticket.



 Comments   
Comment by Githook User [ 16/May/23 ]

Author:

{'name': 'Didier Nadeau', 'email': 'didier.nadeau@mongodb.com', 'username': 'nadeaudi'}

Message: SERVER-72370 Fix incorrect serverless lock usage in Tenant Migration
Branch: master
https://github.com/mongodb/mongo/commit/f79b80bee2792f829aa1e6a2aef847b27f34ed23

Comment by Didier Nadeau [ 15/May/23 ]

Most of the work was done in SERVER-74966. I'll do a small one-liner change to close this ticket.

Comment by Steven Vannelli [ 17/Mar/23 ]

Once we confirm that we are completely moving away from tenant migrations, we will close this ticket. Until then, keeping it open.

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