[SERVER-51753] Handle applyOps during tenant migrations Created: 19/Oct/20  Updated: 29/Oct/23  Resolved: 11/Mar/21

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

Type: Task Priority: Major - P3
Reporter: Esha Maharishi (Inactive) Assignee: Cheahuychou Mao
Resolution: Fixed Votes: 0
Labels: pm-1791_milestone-A, pm-1791_non-cloud-blocking
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-56188 Nested applyOps can hold onto global ... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2021-03-22
Participants:

 Description   

First, we need to decide if applyOps needs to be synchronized with tenant migrations. applyOps is not supported in API Version 1, but MongoMirror uses it. So, we should check if MongoMirror and a tenant migration could ever be run simultaneously against a serverless replica set.

My guess is we should synchronize applyOps with tenant migrations, to be on the safe side.

When we made TenantMigrationConflict include the shared_ptr<TenantMigrationAccessBlocker>, we noticed that if TenantMigrationConflict was thrown in the op observer for applyOps, the shared_ptr got lost somewhere on the way back up to migrationConflictHandler.

Therefore, we disabled making applyOps wait for the migration to commit or abort.

This ticket is to:

  • make applyOps wait for the migration to commit or abort at the point where it catches the TenantMigrationConflict error,
  • confirm that TenantMigrationCommitted/TenantMigrationAborted are reported in line with how other errors are reported for applyOps. In particular, for non-atomic applyOps, it may be possible that some of the operations occurred but others didn't. Does the applyOps response need to indicate this in some way?

I think for applyOps, the oplog entries are written here or here, and TenantMigrationConflict gets caught here.



 Comments   
Comment by Githook User [ 11/Mar/21 ]

Author:

{'name': 'Cheahuychou Mao', 'email': 'mao.cheahuychou@gmail.com', 'username': 'cheahuychou'}

Message: SERVER-51753 Handle applyOps during tenant migrations
Branch: master
https://github.com/mongodb/mongo/commit/d2b168db25d982ca5d3bb62e3d4465f05f797ff5

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