Hello,
We are inserting records into SQLite databases, and in our testing
have discovered that in some circumstances it is possible to be
inserting records inside a transaction, yet not have the fact that
the database journal file is growing be reflected accurately by the
file system. In other words, these steps will reproduce the issue:
1. open an affected database on the command line: sqlite3
myAffectedDatabase.db
2. begin a transaction: sqlite3> begin;
3. insert a record: insert into table values (....);
4. in a separate Terminal window, check the disk free and size
of the database and its journal:
df -k /path/to/myAffectedDatabase.db
ls -l /path/to/myAffectedDatabase*
5. repeat steps 3 and 4 until you pass the point where the
volume should have run out of memory.
I expect to see df and ls reflect changes to the filesystem and I
expect SQLite to report a disk full error. Instead, df and ls output
show changes during the first few inserts, then stop changing no
matter how many records I insert, and I never receive a disk full
error from SQLite. If I have exceeded the amount of free space,
though, attempting to commit the transaction will fail.
Some additional relevant information:
I am working with Mac OS X 10.2 (Jaguar) and 10.4 (Tiger). I have
reproduced the problem with SQLite 3.0.8 and 3.1.3.
The problem only manifests when using certain databases, but if the
problem appears with a given database, then it will consistently do
so for that database. This includes copying the database to another
volume.
We detected the problem on a volume with little free space
(100-200KB), but the symptom also appears with many GB free.
I have tried watching activity with fs_usage, but I don't see
anything unusual, except for the fact that the database path isn't
listed in the fs_usage output.
I have reproduced the problem on HFS+ and FAT16 filesystems.
I suspect this is an OS X-specific issue, but I'm hoping to get some
insight from the list. Any help would be greatly appreciated.
Thanks,
-----
Aaron Burghardt
Booz Allen Hamilton
13200 Woodland Park Drive
Suite 5035
Herndon, VA 20171
703-984-3112