FIX: Error 8959 may occur on IAM page when you query sys.dm_db_index_physical_stats against partitioned columnstore table after partition switch in SQL Server

Applies to: SQL Server 2016 Service Pack 2SQL Server 2016 DeveloperSQL Server 2016 Enterprise


Assume that you have a partitioned table with Clustered Columnstore Index (CCI) in Microsoft SQL Server. When you run SELECT statement on Dynamic Management View (DMV)sys.dm_db_index_physical_statsagainst the table, you may receive an error message that resembles the following on Index Allocation Map (IAM) page after partition switch:
Error Msg 8959, Level 16, State 1, Line LineNumber
Table error: IAM page (1:361) for object ID ObjectID, index ID IndexID, partition ID PartitionID, alloc unit ID UnitID (type In-row data) is linked in the IAM chain for object ID ObjectID, index ID IndexID, partition ID PartitionID, alloc unit ID UnitID (type In-row data) by page (0:0).


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. 


This issue is fixed in the following cumulative updates 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

The cause of the issue is that when you perform apartition switch of the Columnstore table and if any tombstone deltastoreexists in the source partition, this tombstone will not be switched to targetpartition which causes IAM page mismatch error. You can run "sys.dm_db_column_store_row_group_physical_stats"to know the detailed row groups status (including tombstone) about theColumnstore index.


The issue would disappear after some time when backgroundTuple Mover destroyed the tombstone deltastore. 
Or to work around this issue, you can remove thattombstone deltastore immediately to avoid the error by running "ALTER INDEX ... REORGANIZE" one or more times.


Learn about the terminology that Microsoft uses to describe software updates.