Possible solution (work around)
- Exit Storage Emulator;
- Open administrative Sql Server Management Studio 2012;
- Attach the file
C:\Users\<username>\DevelopmentStorageDb201206.mdf
(where <username>
is the name of the affected user); - If it does not allow you to attach, copy the mdf and log files to another disk and then join, otherwise you can access LocalDB (
(localdb)\v11.0
); - Find the stored procedure
CommitBlockList
; - Change
SET UncommittedBlockIdLength = NULL
to SET UncommittedBlockIdLength = 0
; - Execute it;
- Close Management Studio;
- Copy these edited mdf files, log files to the original location;
- Run the storage emulator;
How did i get there
I found that approximately every seven days, BLOBs were deleted.
Creating these blobs again for testing purposes was painful, while in the middle of development / testing.
I tried to find the source code of the storage emulator, but could not find it.
Enabling the log when C:\Users\<username>\AppData\Local\DevelopmentStorage
adding the following to DevelopmentStorage.201206.config
<LogPath>C:\Users\<username>\AppData\Local\DevelopmentStorage\Logs</LogPath> <LoggingEnabled>true</LoggingEnabled>
After a painful wait, the following in the magazines:
DefragmentBlobFiles Name BlobInfo 40f5e12f-65a5-4a3a-ae46-41c71c8514c0 / file1.txt, ContainerName storage1, Directory c: \ users \ username \ appdata \ local \ developmentstorage \ ldb \ blockblobroot \ 1 \ 12735b4b-f9f9b-f9f9b-f9f1bfb-f9 ROFile, RWFile c: \ users \ username \ appdata \ local \ developmentstorage \ ldb \ blockblobroot \ 1 \ 12735b4b-f9ed-481b-a091-78387facf05b \ 1, Size5
I donβt think that there were problems with defragmentation.
Another log found:
BlockBlob: loading interval failed. IsGC: True, Exception in System.Number.ParseDouble (String value, NumberStyles, NumberFormatInfo numfmt options) in Microsoft.WindowsAzure.DevelopmentStorage.Store.BlockBlobGarbageCollector.GetTimerIntervalOrDefault (Boolean isGC)
So, for BlockBlobs, Unblocked blocks are collected using this BlockBlobGarbageCollector block. Nowhere could I find how often these uncommitted blocks collect garbage. I do not think that even this causes a problem.
Another magazine:
BlockBlob: check the directory C: \ Users \ username \ AppData \ Local \ DevelopmentStorage \ LDB \ BlockBlobRoot \ 1 \ 0477877c-4cb3-4ddb-a035-14a5cf52d86f in the list of valid directories
BlockBlob: delete the directory C: \ Users \ username \ AppData \ Local \ DevelopmentStorage \ LDB \ BlockBlobRoot \ 1 \ 0477877c-4cb3-4ddb-a035-14a5cf52d86f
THIS HIGHER MODE COMPLETES THE PROBLEM. The emulator must determine the correct blockblob directories.
Proven DevelopmentStorageDb201206
database schema. Multiple columns found, for example IsCommitted
and UncommittedBlockIdLength
. Found ClearUncommittedBlocks
set UncommittedBlockIdLength
to null
. Any Blob objects that were not deleted were set to UncommittedBlockIdLength
0. So we checked the CommitBlockList
stored procedure and changed UncommittedBlockIdLength
to 0 instead of null
. I think that the emulator in the previous version should check IsCommitted
and UncommittedBlockIdLength
both to determine the correct blockblob directories, whereas in this version it can only check UncommittedBlockIdLength
as null
and delete all these block block files.
As I said, it takes about seven days to find out if this fixes a decision. I have 4 more days to check it out.
If this is a workaround that works ... Microsoft owes me 6 hours;)