{"id":986,"date":"2008-11-06T23:51:00","date_gmt":"2008-11-06T23:51:00","guid":{"rendered":"\/blogs\/paul\/post\/Corruption-bug-that-people-are-hitting-Msg-8914-PFS-free-space.aspx"},"modified":"2013-01-01T18:53:44","modified_gmt":"2013-01-02T02:53:44","slug":"corruption-bug-that-people-are-hitting-msg-8914-pfs-free-space","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/paul\/corruption-bug-that-people-are-hitting-msg-8914-pfs-free-space\/","title":{"rendered":"Corruption bug that people are hitting: Msg 8914 &#8211; PFS free space"},"content":{"rendered":"<p>\n<font face=\"verdana,geneva\" size=\"2\">(Posted with permission of the dev team)<\/font>\n<\/p>\n<p>\n<font size=\"2\">Here&#39;s an interesting bug that people are hitting. I found out about this while here in Barcelona at TechEd when I got roped into a discussion with a couple of Microsoft colleagues. Their customer was seeing errors like the following:<\/font>\n<\/p>\n<p><font size=\"+0\"><\/p>\n<blockquote>\n<p style=\"margin: 0in 0in 0pt\" class=\"MsoNormal\">\n\t<span class=\"show\"><span style=\"font-size: 8.5pt; color: black; font-family: 'Verdana','sans-serif'\"><font face=\"courier new,courier\" size=\"2\">Msg 8914, Level 16, State 1, Line 1<\/font><\/span><\/span><span style=\"font-size: 8.5pt; color: black; font-family: 'Verdana','sans-serif'\"><br \/>\n\t<span class=\"show\"><font face=\"courier new,courier\" size=\"2\">Incorrect PFS free space information for page (1:35244) in object ID 1683128146, index ID 1, partition ID 223091033422352, alloc unit ID 81405523118118176 (type LOB data). Expected value 0_PCT_FULL, actual value 100_PCT_FULL<\/font><\/span><\/span>\n\t<\/p>\n<\/blockquote>\n<p><\/font><\/p>\n<p>\n<font size=\"2\">This error says that the PFS page (see <a href=\"https:\/\/www.sqlskills.com\/blogs\/paul\/inside-the-storage-engine-gam-sgam-pfs-and-other-allocation-maps\/\">this blog post<\/a>) has the wrong free-space tracking bits for a text page. In SQL Server 2000, the algorithm to keep track of free space in the PFS pages wasn&#39;t perfect so CHECKDB never reported these errors &#8211; it would silently fix them. In 2005 we fixed the algorithm (supposedly), so I turned on the reporting of these errors again in CHECKDB.<\/font>\n<\/p>\n<p>\n<font size=\"2\">When I first saw the description from the customer, my first reaction was that it was an I\/O subsystem problem causing corruption, but the customer has page checksums turned on, so a corruption would result in an 824 error before an 8914 error. My conclusion then was<\/font><font size=\"2\"> that there&#39;s a bug in the new free-space tracking algorithm. After checking with the dev team, it turns out my suspicions were correct &#8211; there is a bug in 2005 SP2. It&#39;s fixed in 2005 SP3 and in 2008, but you may see these 8914 errors if you&#39;re not running one of those.<\/font>\n<\/p>\n<p>\n<font size=\"2\">Here are the technical details of the problem (slightly edited from the dev team explanation):<\/font>\n<\/p>\n<blockquote>\n<p>\n\t<span style=\"color: #1f497d\"><font size=\"+0\"><font size=\"+0\"><font size=\"2\"><font face=\"verdana,geneva\">The issue was that when minimal logging for LOBs was used (under the&nbsp;SIMPLE recovery model, during BULK INSERT\/BCP\/Large insert with TABLOCK), extents are being pre-allocated and the pages were being marked 100% full in the PFS page when the pages were allocated. The idea was that all pages eventually will be filled up with LOB data, and by marking them full during allocation we avoid an extra update to the PFS pages when the data is actually put on the page.<\/font><\/font><\/font><\/font><\/span>\n\t<\/p>\n<p>\n\t<span style=\"color: #1f497d\"><font size=\"+0\"><font size=\"+0\"><font size=\"2\"><font face=\"verdana,geneva\">Suppose now that 64 pages are pre-allocated, and only 40 or so pages are used and have rows on them. When the transaction commits, the Storage Engine&nbsp;is supposed to deallocate the 24 extra pages that were pre-allocated, and marked 100% full, even though they don&rsquo;t have any rows on them yet. There was a bug where in a certain case&nbsp;the deallocation wouldn&#39;t happen, so you end up with empty pages that have a PFS state of 100%, but don&rsquo;t have any rows on them.<\/font><\/font><\/font><\/font><\/span>\n\t<\/p>\n<p>\n\t<span style=\"color: #1f497d\"><\/span><span style=\"color: #1f497d\"><font size=\"+0\"><font size=\"+0\"><font size=\"2\"><font face=\"verdana,geneva\">In general, even though this is a bug in the code, functionality wise, there is nothing wrong with the database, besides a number of additional pages that are empty and allocated to the LOB tree, so as long as the message tells you that the page is supposed to be empty, but is actually marked 100%, nothing can really go wrong with that page. Unfortunately, DBCC will keep reporting these errors. <\/font><\/font><\/font><\/font><\/span>\n\t<\/p>\n<\/blockquote>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">Although I haven&#39;t tried this, my guess is that you can get rid of the empty LOB pages using ALTER INDEX &#8230; REORGANIZE WITH (LOB_COMPACTION = ON). So, if you see some of these errors with no other errors, you may have hit this bug and have nothing really to worry about.<\/font><\/p>\n","protected":false},"excerpt":{"rendered":"<p>(Posted with permission of the dev team) Here&#39;s an interesting bug that people are hitting. I found out about this while here in Barcelona at TechEd when I got roped into a discussion with a couple of Microsoft colleagues. Their customer was seeing errors like the following: Msg 8914, Level 16, State 1, Line 1 [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,30,48,62],"tags":[],"class_list":["post-986","post","type-post","status-publish","format-standard","hentry","category-checkdb-from-every-angle","category-corruption","category-inside-the-storage-engine","category-on-disk-structures"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Corruption bug that people are hitting: Msg 8914 - PFS free space - Paul S. Randal<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlskills.com\/blogs\/paul\/corruption-bug-that-people-are-hitting-msg-8914-pfs-free-space\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Corruption bug that people are hitting: Msg 8914 - PFS free space - Paul S. Randal\" \/>\n<meta property=\"og:description\" content=\"(Posted with permission of the dev team) Here&#039;s an interesting bug that people are hitting. I found out about this while here in Barcelona at TechEd when I got roped into a discussion with a couple of Microsoft colleagues. Their customer was seeing errors like the following: Msg 8914, Level 16, State 1, Line 1 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/paul\/corruption-bug-that-people-are-hitting-msg-8914-pfs-free-space\/\" \/>\n<meta property=\"og:site_name\" content=\"Paul S. Randal\" \/>\n<meta property=\"article:published_time\" content=\"2008-11-06T23:51:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2013-01-02T02:53:44+00:00\" \/>\n<meta name=\"author\" content=\"Paul Randal\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Paul Randal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/corruption-bug-that-people-are-hitting-msg-8914-pfs-free-space\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/corruption-bug-that-people-are-hitting-msg-8914-pfs-free-space\/\",\"name\":\"Corruption bug that people are hitting: Msg 8914 - PFS free space - Paul S. Randal\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\"},\"datePublished\":\"2008-11-06T23:51:00+00:00\",\"dateModified\":\"2013-01-02T02:53:44+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/corruption-bug-that-people-are-hitting-msg-8914-pfs-free-space\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/paul\/corruption-bug-that-people-are-hitting-msg-8914-pfs-free-space\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/corruption-bug-that-people-are-hitting-msg-8914-pfs-free-space\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Corruption bug that people are hitting: Msg 8914 &#8211; PFS free space\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\",\"name\":\"Paul S. Randal\",\"description\":\"In Recovery...\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\",\"name\":\"Paul Randal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g\",\"caption\":\"Paul Randal\"},\"sameAs\":[\"http:\/\/3.209.169.194\/blogs\/paul\"],\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/author\/paul\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Corruption bug that people are hitting: Msg 8914 - PFS free space - Paul S. Randal","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlskills.com\/blogs\/paul\/corruption-bug-that-people-are-hitting-msg-8914-pfs-free-space\/","og_locale":"en_US","og_type":"article","og_title":"Corruption bug that people are hitting: Msg 8914 - PFS free space - Paul S. Randal","og_description":"(Posted with permission of the dev team) Here&#39;s an interesting bug that people are hitting. I found out about this while here in Barcelona at TechEd when I got roped into a discussion with a couple of Microsoft colleagues. Their customer was seeing errors like the following: Msg 8914, Level 16, State 1, Line 1 [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/paul\/corruption-bug-that-people-are-hitting-msg-8914-pfs-free-space\/","og_site_name":"Paul S. Randal","article_published_time":"2008-11-06T23:51:00+00:00","article_modified_time":"2013-01-02T02:53:44+00:00","author":"Paul Randal","twitter_misc":{"Written by":"Paul Randal","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/corruption-bug-that-people-are-hitting-msg-8914-pfs-free-space\/","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/corruption-bug-that-people-are-hitting-msg-8914-pfs-free-space\/","name":"Corruption bug that people are hitting: Msg 8914 - PFS free space - Paul S. Randal","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website"},"datePublished":"2008-11-06T23:51:00+00:00","dateModified":"2013-01-02T02:53:44+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/corruption-bug-that-people-are-hitting-msg-8914-pfs-free-space\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/paul\/corruption-bug-that-people-are-hitting-msg-8914-pfs-free-space\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/corruption-bug-that-people-are-hitting-msg-8914-pfs-free-space\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/paul\/"},{"@type":"ListItem","position":2,"name":"Corruption bug that people are hitting: Msg 8914 &#8211; PFS free space"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/","name":"Paul S. Randal","description":"In Recovery...","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlskills.com\/blogs\/paul\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce","name":"Paul Randal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g","caption":"Paul Randal"},"sameAs":["http:\/\/3.209.169.194\/blogs\/paul"],"url":"https:\/\/www.sqlskills.com\/blogs\/paul\/author\/paul\/"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/986","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/comments?post=986"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/986\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/media?parent=986"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/categories?post=986"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/tags?post=986"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}