On 6/7/16, 刘翔 <liuxi...@pset.suntec.net> wrote: > Dear SQLite developers, > > Sqlite version: 3.8.8.3 > Linux version: 3.10.31-ltsi > > Problem: > When update database and power off immediately, it cannnot actually make > changes to database file in the disk. > Although the HAVE_FDATASYNC comile-time option is true. > If manually called sync() after executing a SQL statement, it does flush > the database file to disk.
This is sounds like a hardware or operating system problem. If I understand you correctly - fdatasync() is being called but fdatasync() is not correctly updating the HDD? Is that right? SQLite depends on fdatasync() doing what it is suppose to do. If fdatasync() misbehaves, there is nothing SQLite can do about that. What happens if you compile *without* HAVE_FDATASYNC? Does it work correctly then? > > I think the OSTRACE log can be helpful, so I toke it. > Could you help to analyse it and tell me why fdatasync() doesn't work? > ==================================================================== > LOCK 154 SHARED was NONE(NONE,0) pid=2289 (unix) > LOCK 154 SHARED ok (unix) > READ 154 16 24 0 > LOCK 154 RESERVED was SHARED(SHARED,1) pid=2289 (unix) > LOCK 154 RESERVED ok (unix) > OPENX 168 /var/user/aaa/bbb.db-journal 0400102 > OPEN 168 /var/user/aaa/bbb.db-journal > WRITE 168 512 0 0 > WRITE 168 4 512 0 > WRITE 168 1024 516 0 > WRITE 168 4 1540 0 > LOCK 154 EXCLUSIVE was RESERVED(RESERVED,1) pid=2289 (unix) > LOCK 154 EXCLUSIVE ok (unix) > WRITE 168 4 1544 0 > WRITE 168 1024 1548 0 > WRITE 168 4 2572 0 > READ 168 0 3072 0 > SYNC 168 > DIRSYNC /var/user/aaa/bbb.db-journal (have_fullfsync=0 fullsync=0) > OPENDIR 169 /var/user/aaa > WRITE 168 12 0 0 > SYNC 168 > READ 154 4 24 0 > WRITE 154 1024 0 0 > WRITE 154 1024 20480 0 > SYNC 154 > CLOSE -1 > UNLOCK 154 1 was 4(4,1) pid=2289 (unix) > UNLOCK 154 0 was 1(1,1) pid=2289 (unix) > ==================================================================== > > > Cordially yours > > LiuXiang > > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users