SQLite Forum

Disk I/O error on cifs volume
Login
I'm adding some extra information for the issue I'm facing.

I managed to compile a version of sqlite3 using the flag <nowiki>SQLITE_ENABLE_IOTRACE</nowiki> which adds the command .iotrace (Enable I/O diagnostic logging to FILE).

Showing below another session replicating the issue and the iotrace log.

<pre>
# sqlite3

SQLite version 3.31.1 2020-01-27 19:55:54
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> .iotrace iotrace.log
sqlite> .open --readonly test.db
sqlite> select * from orders;
Error: disk I/O error
sqlite> select * from orders;
Error: disk I/O error
sqlite> select * from orders;
Error: disk I/O error
sqlite> select * from orders;
Error: disk I/O error
sqlite> select * from orders;
Error: disk I/O error
sqlite> select * from orders;
Error: disk I/O error
sqlite> select * from orders;
Error: disk I/O error
sqlite> select * from orders;
Error: disk I/O error
sqlite> select * from orders;
Error: disk I/O error
sqlite> select * from orders;
O1|A|100
O2|B|200
O3|C|300
sqlite> select * from orders;
O1|A|100
O2|B|200
O3|C|300
sqlite> select * from orders;
O1|A|100
O2|B|200
O3|C|300
sqlite> select * from orders;
O1|A|100
O2|B|200
O3|C|300
sqlite> select * from orders;
Error: disk I/O error
sqlite> .quit

# cat iotrace.log
OPEN 55FE2505E378 /home/site/wwwroot/testdb/test.db
DBHDR 55FE2505E378 0 100
UNLOCK 55FE2505E378 0
UNLOCK 55FE2505E378 0
UNLOCK 55FE2505E378 0
UNLOCK 55FE2505E378 0
UNLOCK 55FE2505E378 0
UNLOCK 55FE2505E378 0
UNLOCK 55FE2505E378 0
UNLOCK 55FE2505E378 0
UNLOCK 55FE2505E378 0
LOCK 55FE2505E378 1
PGIN 55FE2505E378 1
UNLOCK 55FE2505E378 0
LOCK 55FE2505E378 1
CKVERS 55FE2505E378 16
PGIN 55FE2505E378 2
UNLOCK 55FE2505E378 0
LOCK 55FE2505E378 1
CKVERS 55FE2505E378 16
UNLOCK 55FE2505E378 0
LOCK 55FE2505E378 1
CKVERS 55FE2505E378 16
UNLOCK 55FE2505E378 0
LOCK 55FE2505E378 1
CKVERS 55FE2505E378 16
UNLOCK 55FE2505E378 0
UNLOCK 55FE2505E378 0
UNLOCK 55FE2505E378 0
CLOSE 55FE2505E378
</pre>


The iotrace file shows that a lock operation (SHARED mode) is attempted  when doing the Select statement, and also it checks the internal version to see if the database file had changes (CKVERS).

I know that the file won't be changed. Is it possible somehow (pragma?) to prevent sqlite from generating those locks?