On 11 July 2016 at 12:18, 刘翔 <[email protected]> wrote:

> Dear SQLite developers,
>
> Sqlite version: 3.8.8.3
> Linux version: 3.10.31-ltsi
>
> Question:
> We found when updated a sqlite database in emmc disk, it cannot remove
> journal file as soon as the transaction finished.
> We know after the transaction finishes, SQLite will unlink the journal
> file.
> But when we update a database and shut down in about 2~3s, the journal
> file still exists after system startups.
> It seems unlink() file would not remove it immediately, until kernel call
> sync() to flush disk.
>

You can't be sure that unlink() has been committed to disk until the
_directory_ containing the file has been synced. SQLite does not sync the
directory at every transaction, unless you specify "PRAGMA synchronous =
EXTRA".

It may make more sense to sync the whole disk as part of your shutdown
process.
-Rowan
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to