Skip extra work during BulkImports if source and destination instances are the same
Whenever a user initiates a new Bulk Import we do the following:
- Export data on source (serialize to json, export to tar.gz, upload to object storage)
- Import data on destination (download tar.gz from object storage over the wire, extract contents, deserialize json)
If both source and destination instances are the same - a lot of things can be skipped and are an unnecessary overhead:
- Exporting data to tar.gz and uploading to object storage is not needed, since we have access to all the data we need already
- Serialization and deserealization is still required (without making too many changes to how import works), but we don't need to write any data to files on disk
Skipping these steps can improve the overall performance of the import in cases when source and destination are the same. This is likely not a popular way of importing, though.