View Issue Details

IDProjectCategoryView StatusLast Update
0004071MMW v4DB/FileMonitorpublic2009-09-17 14:30
Reporterjiri Assigned To 
PriorityimmediateSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version3.0 
Fixed in Version3.0 
Summary0004071: Increase security of DB operations
DescriptionSQLite has several options of how to modify database, ranging from slower/more secure to faster/less secure. They are named: FULL, NORMAL and OFF. Their description from SQLite documentation:

---
When synchronous is FULL (2), the SQLite database engine will pause at critical moments to make sure that data has actually been written to the disk surface before continuing. This ensures that if the operating system crashes or if there is a power failure, the database will be uncorrupted after rebooting. FULL synchronous is very safe, but it is also slow. When synchronous is NORMAL, the SQLite database engine will still pause at the most critical moments, but less often than in FULL mode. There is a very small (though non-zero) chance that a power failure at just the wrong time could corrupt the database in NORMAL mode. But in practice, you are more likely to suffer a catastrophic disk failure or some other unrecoverable hardware fault. With synchronous OFF (0), SQLite continues without pausing as soon as it has handed data off to the operating system. If the application running SQLite crashes, the data will be safe, but the database might become corrupted if the operating system crashes or the computer loses power before that data has been written to the disk surface. On the other hand, some operations are as much as 50 or more times faster with synchronous OFF.
---

So far we have used OFF setting (fastest) in MM, but we should give user a chance to use other settings as well.

Note that I don't think that this is the reason for problems reported by some users, but still I'd rather include this.
Steps To ReproduceForum Topic:
http://www.mediamonkey.com/forum/viewtopic.php?f=18&t=42770
TagsNo tags attached.
Fixed in build1138

Activities

jiri

2007-12-04 13:03

administrator   ~0012282

Fixed in build 1112.

I added an option to specify in MM.ini file:

[System]
SQLiteSafety=

possible values are:
0 .. fastest
1 .. average
2 .. slowest

We should document it somewhere with other 'undocumented' features. Possibly a new wiki page could be created for this purpose?

rusty

2007-12-11 02:50

administrator   ~0012459

Verified no obvious regressions with SQLiteSafety=1 and updated faq with documentation.

jiri

2008-02-13 17:18

administrator   ~0013107

I tested speed of scanning a folder using these options with these results:

0 .. 53s
1 .. 55s
2 .. 56s

Since the issue of DB corruption definitely isn't nice and the difference in speed is rather negligible, I think we should try to change the default to the FULL security mode.

jiri

2008-02-13 17:18

administrator   ~0013108

Fixed in build 1138.

peke

2009-09-17 14:30

developer   ~0018864

Closing the bug Jiri Updated Knowledgebase to reflect changes of default behavior to SQLiteSafety=2