After we failed over from our current primary to our secondary replica, we started, for some, to get two backups of nearly identical size and only slightly different names (one character is different) being created at the same time on the same server node.
We have an AlwaysOn High Availability Environment that consists of a primary and secondary synchronous replicas. In the maintenance plan, we have selected for AlwaysOn Availability Groups "Only back up the primary". Though this is expected behavior for the 'system' databases, this is occurring even for the 'User' Databases.
If we had an outage, we wouldn't know which backup to use for the restore.
We see that the two backups above are both created by the the first server, the primary. Nothing is returned for the secondary.
SELECT machine_name,server_name,physical_device_name,backup_finish_date,user_name
FROM MSDB..backupset bs inner join MSDB..backupmediafamily bf on bs.media_set_id = bf.media_set_id
WHERE physical_device_name = '<path to bsckup file\backup file>'
We also see this when we run the below query on the LiteSpeedLocal database of both the primary and secondary servers of this always on group:
SELECT [ServerName] ,[BackupFileID] ,[ActivityID] ,[BackupFileName] ,[BackupFileSize]
FROM [dbo].[LitespeedBackupFile]
WHERE BackupFileName = '<path to backup\backup name>
We ran the query once for each duplicate backup. The results will show which server created both backups: the primary.