Re: [sqlite] Is there any way to close a connection without checkpointing the WAL?

2016-12-05 Thread Simon Slavin

On 5 Dec 2016, at 9:46pm, Scott Hess  wrote:

> I don't think so, that seems like it could result in corruption.
> Unless you mean something more like causing the OS to block all fsync
> calls on the filesystem and release them as a single uber-sync?

Yeah, that’s what I meant.  It would just cause the device to suspend all 
writing until you gave it another command which released it all.  Obviously 
it’d have to sync anyway if it ran out of caching space.

Seems like the sort of call a device driver might have.  And Chromium should be 
able to talk to its storage at that level.  But I don’t recall if I’ve ever 
seen it.  So I’m glad the development team has your back inside SQLite.

Simon.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Is there any way to close a connection without checkpointing the WAL?

2016-12-05 Thread Scott Hess
On Mon, Dec 5, 2016 at 1:34 PM, Simon Slavin  wrote:
> On 5 Dec 2016, at 9:26pm, Scott Hess  wrote:
>> An obvious solution would be to simply not call sqlite3_close(),
>> though that has various other unfortunate side effects.
>
> Yeah.  Don’t do that, eh ?

:-).  OK, the biggest unfortunate effect is that you don't release the
various resources like memory and file descriptors, which in turn
means that you spend your time populating exception policies for
automated leak detectors and the like.  Also, it means you have to
have high confidence that you're skipping the close because of
shutdown rather than some other reason (like you're closing the
database before deleting it).  All of this can probably be ground
through eventually, but this kind of thing is likely to cause people
to wonder if the code is doing the right thing.

> What you’re actually trying to do is disable/delay fsync() for
> a time for a particular storage device.  Can that not be done
> at device-driver level ?  It would then affect all the programs
> writing "I just quit" to their log files too, which would be an
> additional benefit.

I don't think so, that seems like it could result in corruption.
Unless you mean something more like causing the OS to block all fsync
calls on the filesystem and release them as a single uber-sync?

-scott
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Is there any way to close a connection without checkpointing the WAL?

2016-12-05 Thread Scott Hess
On Mon, Dec 5, 2016 at 1:38 PM, Richard Hipp  wrote:
> On 12/5/16, Scott Hess  wrote:
>> Is there any clean way to request no WAL checkpoint on sqlite3_close()?
>
> sqlite3_db_config(SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE, db).  See
> https://www.sqlite.org/draft/c3ref/c_dbconfig_enable_fkey.html at the
> bottom.

Oh!  Now I wonder if I asked about this earlier :-).

Thanks,
scott
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Is there any way to close a connection without checkpointing the WAL?

2016-12-05 Thread Richard Hipp
On 12/5/16, Scott Hess  wrote:
>
> Is there any clean way to request no WAL checkpoint on sqlite3_close()?

sqlite3_db_config(SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE, db).  See
https://www.sqlite.org/draft/c3ref/c_dbconfig_enable_fkey.html at the
bottom.

-- 
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


Re: [sqlite] Is there any way to close a connection without checkpointing the WAL?

2016-12-05 Thread Simon Slavin

On 5 Dec 2016, at 9:26pm, Scott Hess  wrote:

> An obvious solution would be to simply not call sqlite3_close(),
> though that has various other unfortunate side effects.

Yeah.  Don’t do that, eh ?

What you’re actually trying to do is disable/delay fsync() for a time for a 
particular storage device.  Can that not be done at device-driver level ?  It 
would then affect all the programs writing "I just quit" to their log files 
too, which would be an additional benefit.

Simon.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Is there any way to close a connection without checkpointing the WAL?

2016-12-05 Thread Scott Hess
At Chromium shutdown, various services desire to write data to their
SQLite databases, which results in a (small) thundering herd of
fsyncs, which makes shutdown slower than it could be.  Normally, one
could enable WAL mode to amortize the fsync cost across longer periods
than a single transaction, but as best I can tell, sqlite3_close()
requires the WAL checkpoint, so won't help.

Is there any clean way to request no WAL checkpoint on sqlite3_close()?

An obvious solution would be to simply not call sqlite3_close(),
though that has various other unfortunate side effects.

Thanks,
scott
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users