Allow for direct transfer when source instance is in maintenance mode or show appropriate error message
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Current state
Turning on the maintenance mode disables the ability to import by direct transfer; you can initiate a direct transfer, but nothing actually gets imported. Eventually the process fails out with the message in the import history:
BulkImports::NetworkError Gitlab::HTTP_V2::RedirectionTooDeep and the logs citing a timeout.
Maintenance mode is being used so no one makes any changes to the project during the transfer process that wouldn't make it to the destination instance because our documentation says:
After you start a migration, you should not make any changes to imported groups or projects on the source instance because these changes might not be copied to the destination instance.
With direct transfer, the destination instance needs to make a POST request to the source instance’s REST API to have the source start exporting its data. From the maintenance mode docs it sounds like that request would be blocked in maintenance mode.
Proposed solution
Check if starting a direct transfer export of data on the source could qualify as a REST route that could be exempt from maintenance mode.
Alternative solution
Currently we do some validation tests that the source is reachable via the API, but they’re GET requests which wouldn’t tell us that it’s in maintenance mode. If we shouldn’t make it possible to do a DT with a source in maintenance mode, we might need to look into providing some data to the destination instance that the source is in maintenance, so fail earlier.