Unlimited storage is not unlimited for IndexedDB
I have been using a DB in IndexedDB for quite a while. As time passed, I increased its permissions allowing it to store unlimited data. Currently the DB I'm using is using ~680MB of storage.
This started happening in firefox 41.0.1 but I can still reproduce it in Nightly.
When I try to open the DB (even before I try doing anything) I get the QuotaExceededError error with the message: "The current transaction exceeded its quota limitations."
This wasn't happening until I updated to firefox 41. How do I solve it?
Note: I posted this question here by request on https://bugzilla.mozilla.org/show_bug.cgi?id=1212985
所有回覆 (3)
Well, it's a little hard for Support volunteers to research, but I took a quick look in the code at what kinds of things cause this error message and they all seem to relate not to a site-specific quota but to available disk space. Or perhaps it's some maximum on IndexedDB as a whole?
(Excerpted from https://dxr.mozilla.org/mozilla-central/source/dom/base/domerr.msg)
DOM4_MSG_DEF(QuotaExceededError, "The current transaction exceeded its quota limitations.", NS_ERROR_DOM_INDEXEDDB_QUOTA_ERR)
(Excerpted from https://dxr.mozilla.org/mozilla-central/source/dom/indexedDB/ActorsParent.cpp)
case NS_ERROR_FILE_NO_DEVICE_SPACE:
return NS_ERROR_DOM_INDEXEDDB_QUOTA_ERR;
NS_WARNING("Refusing to create database because disk space is low!");
return NS_ERROR_DOM_INDEXEDDB_QUOTA_ERR;
if (rv == NS_ERROR_FILE_NO_DEVICE_SPACE) { // mozstorage translates SQLITE_FULL to NS_ERROR_FILE_NO_DEVICE_SPACE, // which we know better as NS_ERROR_DOM_INDEXEDDB_QUOTA_ERR. rv = NS_ERROR_DOM_INDEXEDDB_QUOTA_ERR; if (NS_WARN_IF(IndexedDatabaseManager::InLowDiskSpaceMode())) { NS_WARNING("Refusing to create file because disk space is low!"); return NS_ERROR_DOM_INDEXEDDB_QUOTA_ERR;
Thank you for your patience.
I can give you some feedback on that. The warning message: "Refusing to create database because disk space is low!" Does not appear on any of both consoles. The drive where the firefox profile is, at that time, had aprox 30GB of free storage space.
I also did some scrapping on the source code (thanks for showing me somewhere to start on).
I ended up with stuff such as:
http://mxr.mozilla.org/mozilla-central/source/dom/indexedDB/ActorsParent.cpp#4511 Which leads to: https://www.sqlite.org/rescode.html#full
Which makes me ask... Did firefox change SQLLite's version? Did firefox change filepaths where the temp files are created? I'm talking something that happened between firefox version 39.0.3 and version 41.
There's also this here: http://mxr.mozilla.org/mozilla-central/source/dom/indexedDB/IndexedDatabaseManager.cpp#686 (IndexedDatabaseManager::InLowDiskSpaceMode())
And to find the values, I found this; https://dxr.mozilla.org/mozilla-central/source/hal/gonk/GonkDiskSpaceWatcher.cpp#166 For me, this seems that it should only genuinely consider the disk as full if it has only 10MB or less (after reaching 5MB of space). In other words, it should never ever have considered as being out of space.
Any more ideas?
由 brunoais 於
Sorry, this is beyond my ability to research any further.