-UseSQLSnapshot - Snapshots persisting on SQL Mirrors

Dec 20, 2012 at 9:49 AM

Hi guys,

I'm seeing a really strange issue with snapshots being created by the scrips.. I'll try and be as descriptive as I can and hopefully someone will have had similar experiences.

I use SQL mirroring, like a lot of people, to add a layer of resiliency to my farm.. Recently my farm has been operating in a fail over state. So the mirror server has been doing all of the work.

After a while I noticed a build up of old snapshots on the mirror server. They all tied in with the backup window.

It looks like when the site collection backups run snapshots are created on the SQL Server that is currently acting as the master for the content database being processed... 

However when SharePoint tries to drop the snapshots I see the following error:

Unknown SQL Exception 3701 occurred. Additional error information from SQL Server is included below.

Cannot drop the database 'SPTest_Content_20121220_095900_4731099', because it does not exist or you do not have permission.

Watching SQL Server Profiler, you can see that the drop command is never issued to the failover partner. It always is executed on the master, and will always fail as even though SharePoint is aware of these snapshots the master isn't.

I can also replicate the error by running the Microsoft SharePoint Foundation Snapshot Management timer job and by running the following commands:

$s = Get-SPSite http://test/sites/sitecollection
$d = $s.ContentDatabase
$d.Snapshots # Shows all of the snapshots
$d.$d.Snapshots.DeleteSnapshots() #Fails because the snapshots don't exist on the master server
And to note.. this doesn't happen when the content databases are active on the master. Snapshots are removed when the backup completes or by the Snapshot Management timer job.
Can anybody advise?
Thanks in advance!