On 06/06/2014 11:37 AM, Török Edwin wrote: > On 05/27/2014 01:49 PM, Török Edwin wrote: >> On 05/27/2014 01:40 PM, Richard Hipp wrote: >>> If you are getting PROTOCOL errors, then the thing to do is to describe the >>> circumstances under which the errors occur so that we can begin to try to >>> understand what is going wrong. >> >> The circumstances are very similar to those described in this commit (in a >> different application though): >> https://github.com/NixOS/nix/commit/d05bf044441dbf8e000036d545df9689bdec0b72 >> >> I'll create a testcase that illustrates my problem and get back to you. > > Hi, > > I made a little progress on the testcase: now I have a machine where > SQLITE_PROTOCOL triggers at least once if I import large amounts of data > overnight. > So I can test patches, but unfortunately I wasn't able to create a small > self-contained testcase yet. I added some debugging code to sqlite3.c to know > which WAL_RETRYs trigger (it collects them all and prints them when cnt>100): > http://gitweb.skylable.com/gitweb/?p=sx.git;a=blob_plain;f=3rdparty/libsqlite3/sqlite3.c;hb=HEAD > > And this is what I got in my logs: > > walTryBeginRead: WAL_RETRY exceeded > walTryBeginRead WAL_RETRY locs: 49000 49000 49000 49000 49000 49000 49000 > 49000 49000 49000 49000 49000 49000 49000 49000 49000 49000 49000 49000 49000 > 49 > 000 49000 49000 49000 49000 49000 49000 49000 49000 > walTryBeginRead WAL_RETRY locs: 49000 49000 49000 49000 49000 49000 49000 > 49000 49000 49000 49000 49000 49000 49000 49000 49000 49000 49000 49000 49000 > 49 > 000 49000 49000 49000 49000 49000 49000 49000 49000 > walTryBeginRead WAL_RETRY locs: 49000 49000 49000 49000 49000 49000 49000 > 49000 49000 49000 49000 49000 49000 49000 49000 49000 49000 49000 49000 49000 > 49 > 000 49000 49000 49000 49000 49000 49000 49000 49000 > walTryBeginRead WAL_RETRY locs: 49000 49000 49000 49000 49000 49000 49000 > 49000 49000 49000 49000 49000 49000 > statement aborts at 33: [INSERT INTO topush (block, size, node) VALUES (:b, > :s, :n)] locking protocol > > So it looks like it triggers here all the time: > rc = walLockShared(pWal, WAL_READ_LOCK(mxI)); > if( rc ){ > pWal->retry_locs[cnt] = __LINE__;// added for debugging > return rc==SQLITE_BUSY ? WAL_RETRY : rc; > } >
Do you need more information to fix the PROTOCOL errors? Is it safe to retry the query if I get a PROTOCOL error? (only SQlite3 itself is using the DB/WAL files, and all SQlite3 versions match) Best regards, --Edwin _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users