dan [Fri, 4 Jun 2010 11:56:22 +0000 (11:56 +0000)]
If an attempt to sync the database file as part of a checkpoint fails, do not update the shared "nBackfill" variable. Otherwise, another process could wrap the log and overwrite content before it is synced into the database.
dan [Thu, 3 Jun 2010 09:17:38 +0000 (09:17 +0000)]
If an error (OOM or SQLITE_FULL error) occurs while executing an SQL statement and a statement-transaction is automatically rolled back as a result, if a second error occurs during the statement rollback do a full transaction rollback instead. Otherwise the client can be left with an inconsistent cache.
dan [Wed, 2 Jun 2010 17:15:24 +0000 (17:15 +0000)]
If an error occurs while writing frames to the log to commit a transaction, do not mark the pages as clean in the cache. Otherwise, the subsequent rollback does not roll them back (leaving the client to continue with a cache that makes it appear that the transaction was committed - inconsistent with the database on disk).
drh [Wed, 2 Jun 2010 15:59:05 +0000 (15:59 +0000)]
Make sure the directory used by os_unix.c for shared-memory files is always
the same, regardless of individual client permissions and environment
variable settings.
drh [Wed, 2 Jun 2010 15:43:18 +0000 (15:43 +0000)]
When walTryBeginRead() encounters an I/O error trying to set a lock
(as opposed to SQLITE_BUSY) be sure to propagate that error back up
the call stack.
drh [Wed, 2 Jun 2010 12:58:22 +0000 (12:58 +0000)]
Undo one of the "const" markers from the previous check-in because the
value needs to be changable, even if it is not actually ever changed in
the current implementation.
drh [Tue, 1 Jun 2010 21:02:51 +0000 (21:02 +0000)]
The shared-memory used by WAL on linux now really is shared memory in /dev/shm.
On other unix flavors, the file is in a temporary directory rather than in the
same directory as the database.
dan [Tue, 1 Jun 2010 15:44:57 +0000 (15:44 +0000)]
Delay the decision to restart the log file until data is actually ready to be written to the log file (instead of at the start of a write transaction).
drh [Mon, 31 May 2010 16:56:14 +0000 (16:56 +0000)]
Fix an inconsistent #ifdef in wal.c. Fix os_unix.c so that it does not allow
moving an SHM lock directly exclusive to shared without going through unlocked.
drh [Sun, 30 May 2010 19:55:15 +0000 (19:55 +0000)]
Initial code for incremental checkpoint in WAL mode. This check-in compiles
on unix and runs as long as you do not engage WAL mode. WAL mode crashes and
burns. Consider this check-in a baseline implementation for getting the new
capability up and running.
drh [Wed, 26 May 2010 15:06:38 +0000 (15:06 +0000)]
Change the semantics of xShmGet() such that it will never increase the size
of shared memory. xShmSize() must be used to grow the size of shared memory.
A shared memory segment size cannot be shrunk (except by dropping it).
drh [Tue, 25 May 2010 13:40:03 +0000 (13:40 +0000)]
Update header comments in wal.c to correctly describe the WAL file format.
Update the locking region offsets in os_unix.c and os_win.c and add assert()
statement to verify that the locking region offsets are correct.
dan [Tue, 25 May 2010 10:50:56 +0000 (10:50 +0000)]
If a writer exits unexpectedly in the middle of a transaction, have the following writer remove any wal-index hash-table entries left by the interrupted transaction.
dan [Mon, 24 May 2010 13:57:42 +0000 (13:57 +0000)]
Change the checksum used in WAL files so that each frames checksum depends on the content of the WAL header and all frame headers and content up to and including the frame to which the checksum is attached.
dan [Mon, 24 May 2010 10:39:36 +0000 (10:39 +0000)]
Change the WAL file format to support two kinds of checksums - one that is fast to calculate on little-endian architectures and another that is fast on big-endian architectures. A flag in the wal-header indicates which the file uses.
drh [Sat, 22 May 2010 00:55:39 +0000 (00:55 +0000)]
Add several EXPENSIVE_ASSERT code blocks to validate the wal-index hash table.
Fix the bugs that these code blocks fine. Rename walClearHash() to
walCleanupHash() and simplify its interface.
drh [Thu, 20 May 2010 23:51:06 +0000 (23:51 +0000)]
Add a new xShmBarrier method to the VFS - a shared-memory fence operation.
Implement the same in both unix and win32. Use it to make the WAL subsystem
more robust.
drh [Thu, 20 May 2010 16:45:58 +0000 (16:45 +0000)]
Convert the wal-header and frame-header to 24 bytes. Extra information in
both headers is designed to enhance robustness after crashes, though the
extra information is currently unused. This is a snapshot of a work in
progress.
drh [Wed, 19 May 2010 19:26:05 +0000 (19:26 +0000)]
Add the SQLITE_FCNTL_SIZE_HINT operator to sqlite3_file_control() and use it
to give the VFS hints about the ultimate size of a database file when the
file is growing.
drh [Tue, 18 May 2010 23:29:52 +0000 (23:29 +0000)]
Update the wal-index hash format so that hash-table space is reused following
a rollback, thus preventing hash table overflows. Add assert()s to verify
that hash tables do not overfill. Further refactoring of the wal-index code.
dan [Sat, 15 May 2010 10:24:46 +0000 (10:24 +0000)]
Add a note to the documentation of sqlite3_wal_hook() to say not to return SQLITE_ROW or SQLITE_DONE. Or any other value that is not a valid SQLite error code.