[SERVER-70372] Disable automaticForgetMigration in tenant_migration_logs.js Created: 07/Oct/22  Updated: 29/Oct/23  Resolved: 10/Oct/22

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

Type: Bug Priority: Major - P3
Reporter: Adi Agrawal Assignee: Adi Agrawal
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

Log  > 1024 lines before checking the logs.

Participants:
Linked BF Score: 35

 Description   

The failure in tenant_migration_logs.js happens here (https://github.com/10gen/mongo/blob/master/jstests/replsets/tenant_migration_logs.js#L20). The function checkLog calls the getLog command (https://www.mongodb.com/docs/manual/reference/command/getLog/) which returns the 1024 most recent log lines. The assertion checks if the logs have 
RegExp(`Slow query.*recipientForgetMigration`). The failure happens because we log more than 1024 lines before checking the log. When looked at, the task logs do contain "recipientForgetMigration," however, it is not there in the log lines returned by getLog. 
 
The runMigrationCommand (https://github.com/10gen/mongo/blob/master/jstests/replsets/libs/tenant_migration_test.js) has automaticForgetMigration enabled by default. This calls forgetMigration for the donor and then the recipient once the migration is complete. In the test, after calling runMigration, forgetMigration is manually called again and then we check the logs for RegExp(`Slow query.*recipientForgetMigration`). Before checking the logs, we perform a few other operations. 
 
If we disable automaticForgetMigration and then call forgetMigration manually right before the checking the logs, the chances of more than 1024 lines being logged would be minimal.
 
Another issue that was unearthed during investigation was the possibility of the second forgetMigration failing. The forgetMigration command sets the expiresAt field for garbage collection. If garbage collection happens before the call to the second forgetMigration, we will get a failure since we have already cleaned up. 
 
 



 Comments   
Comment by Githook User [ 10/Oct/22 ]

Author:

{'name': 'Adityavardhan Agrawal', 'email': 'aa729@cornell.edu', 'username': 'Adityav369'}

Message: SERVER-70372: Disable automaticForgetMigration in tenant_migration_logs.
Branch: master
https://github.com/mongodb/mongo/commit/fff51c4b07573c2d27ebccdd4bbe2c722fb7b45e

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