When the timeseries collection doesn't start with the expected 'system.buckets' prefix, we invariant. During the replay of createCollection oplog entry on an inconsistent data (i.e, oplog application mode kInitialSync), if a collection already exits with the same name, we temporarily rename it to temp name (starting with "tempXXX.create") before creating the new collection. So, a timerseries collection db.system.bucket.coll can get temporarily renamed to non-timeseries temp collection db.tempXXX.create. If a user runs the 'listCollection' command before the oplog could finish catching up to make the data consistent, they may observe that the timeseries collection starts with 'tempXXX' rather than 'system.buckets,' potentially triggering an invariant failure.
Though both tenant migration and logical initial sync behaves similarly, considering the fact that we don't allow external user commands when node is in initial sync, this issue only impacts tenant migration where the cloud can run `listCollections` on the recipient primary to get the list of collections to drop on recipient before retrying the migration, following the initial migration attempt failed after partially migrating donor data.
Since this a bug can cause server crash in Serverless, this will affect other tenants located in the recipient. To be noted, The tenant migration will be retired in 7.2, so this is an issue only when with 7.1 and below.