简体   繁体   中英

Disk I/O errors even after removing the file

I'm getting various errors when running tests on an SQLite database when I specify the database to be located at /tmp/a . Errors include SQLITE_IOERR_DELETE_NOENT (5898) and SQLITE_READONLY_DBMOVED (1032) . These errors persist even after I remove the file /tmp/a . Strangely enough, if I specify the database to be located at /tmp/b , then everything works as expected. Also, noteworthy is that the errors at /tmp/a occur after database initialization, meaning that the database has been initialized with various tables; this implies that writing does work to a certain point. Also, file permissions look identical for both files:

$ ls -ahlv /tmp/a
-rw-r--r-- 1 rik users 24K Jan 15 18:00 /tmp/a

$ ls -ahlv /tmp/b
-rw-r--r-- 1 rik users 24K Jan 15 18:00 /tmp/b

Maybe this some issue with SSD caching? I'll keep an eye on it and update this post if new things happen.

Your temporary file name may not be random enough to not have another rogue process interact with the same file. You may want either to use or more random file name to avoid conflict on the same file. Or if the file is really temporary you may want to use the :memory: file name which implies to not write anything on the disk and keep the full database in memory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM