Improvement: Enhance VDI Protocol with VDC_Complete command in SQL Server 2012

Improvement
In the current implementation of the SQL Server Virtual Backup Device Interface (VDI) protocol, the last message sent from SQL Server to the VDI client will be a VDC_Flush command. To prevent data loss, the VDI client must finish the backup before responding to the VDC_Flush command.

Starting with SQL Server 2008 and the introduction of FILESTREAM, the VDC_Flush command can be sent multiple times during a backup. This operation causes an issue that the VDI client has to finish the backup multiple times during the backup operation. This is not possible for some VDI clients. Additionally, if the VDI client responds to a VDC_Flush command without ensuring the backup is hardened when more data is coming after the VDC_Flush, SQL Server may truncate the transaction log. However, if the backup eventually fails on the VDI client, and the transaction log is also truncated, data loss might occur.

This update adds a new VDI command VDC_Complete that indicates SQL Server has completed sending data to the VDI client. Therefore, the VDI client will be able to finish the backup before it sends response to SQL Server.

This functionality allows the VDI client to fail the backup in case something goes wrong, and also prevents the transaction log being truncated by mistake.

Note To support the new VDC_Complete command, this update also adds two new VDI features VDF_RequestComplete and VDF_CompleteEnabled.
Update information
This improvement is included in the following cumulative update for SQL Server:

About cumulative updates for SQL Server
Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included with the previous cumulative update. Check out the latest cumulative updates for SQL Server:
More information
To use the new VDC_Complete command, the following implementations have to be applied to your VDI client:
  1. Request the new VDI feature VDF_RequestComplete. If SQL Server supports the VDC_Complete command, it will return a not NULL response. Otherwise, it would return a NULL response for the requested feature. The code sample here shows how to request the feature: 
    m_pvdiComponents->m_pvdConfig->features = VDF_RequestComplete; printf("Requested features to SQL Server: 0x{0:X}", m_pvdiComponents->m_pvdConfig->features);
  2. Determine whether the SQL Server supports the new VDC_Complete command by using the GetConfiguration function.
    hr = m_pvdiComponents->m_pvdDeviceSet->GetConfiguration(timeout, m_pvdiComponents->m_pvdConfig);        if (!(m_pvdiComponents->m_pvdConfig->features & VDF_CompleteEnabled))       {              printf("Server does not support VDC_Complete.");              return VD_E_NOTSUPPORTED;       }
  3. When you process the VDI messages that are fetched by the GetCommand function, add an additional case statement to process the VDC_Complete command.
    case VDC_Complete:              // Close the media and ensure that book keeping is completed.              backupMedia->Close();              completionCode = ERROR_SUCCESS;              break;
Note The VDC_Complete message has to be incorporated into the backup application so that it can use the improvement.
References
Learn about the terminology that Microsoft uses to describe software updates.
속성

문서 ID: 3188454 - 마지막 검토: 09/21/2016 17:22:00 - 수정: 2.0

Microsoft SQL Server 2012 Service Pack 3

  • kbqfe kbfix kbsurveynew kbexpertiseadvanced KB3188454
피드백