unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Clément Lassieur" <clement@lassieur.org>
To: Danny Milosavljevic <dannym@scratchpost.org>
Cc: 33210@debbugs.gnu.org
Subject: [bug#33210] Cuirass: Use a SQLite in single-thread mode
Date: Tue, 06 Nov 2018 15:07:40 +0100	[thread overview]
Message-ID: <875zxa5mfn.fsf@lassieur.org> (raw)
In-Reply-To: <20181106122036.25bad548@scratchpost.org>

Hey Danny,

Danny Milosavljevic <dannym@scratchpost.org> writes:

> Hi Clément,
>
> On Tue, 06 Nov 2018 01:50:11 +0100
> Clément Lassieur <clement@lassieur.org> wrote:
>
>> > This is not supposed to happen in relational database systems.  The reason
>> > why it happens here is because we use the same transaction (session) for
>> > both the updates done by the evaluator and the queries done by the web
>> > interface.  It would be much better if the queries by the web interface
>> > had their own transaction.  It was fine before but in some refactoring,
>> > "evaluate" ceased to be an external program and I didn't notice what
>> > happened to it.  
>> 
>> Yes, I know, but I remember that I told you[1] that there was an easy
>> (one line) fix for this. :-)
>
> That would really only be a workaround (arguably still better than what we
> have now - which is basically you ask for a banana and I give you an apple
> - what if other procedures in cuirass assume it's a banana? :) ).
>
> We would be doing the work that SQLite would have done, but we'd do it in a bad
> way (by blocking everyone else).
>
> It's not really useful to undo all the progress relational databases have made.
>
> If we had multiple transactions in progress touching the same row, SQLite would
> use MVCC to hold diverging copies of the same row at the same time, blocking
> nobody.

It blocks everyone indeed, because we take care of the scheduling in a
rather basic way.  But if I understand correctly, the overall spent time
is more or less the same: only the order of the requests differs.  There
is an essential difference however: if we take care of the scheduling,
we won't have SQLITE_BUSY blocking the Fibers scheduler all the time.
And blocking the Fibers scheduler has an impact on all other possibly
unrelated Fibers clients.  When guile-sqlite3 handles SQLITE_BUSY
correctly, I'll be happy to switch back to a multi-threading SQLite.
While waiting for it, I believe our users want a fast Cuirass, and I'd
like the time spent in the Fibers scheduler to be balanced by removing
the SQLite now useless mutexes.

Does that make sense?

Clément

  reply	other threads:[~2018-11-06 14:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-30 20:35 [bug#33210] Cuirass: Use a SQLite in single-thread mode Clément Lassieur
2018-10-30 20:47 ` [bug#33210] [PATCH 1/3] gnu: Add sqlite-with-single-thread Clément Lassieur
2018-10-30 20:47   ` [bug#33210] [PATCH 2/3] gnu: Add guile-sqlite3-with-single-thread Clément Lassieur
2018-10-30 20:47   ` [bug#33210] [PATCH 3/3] gnu: cuirass: Use SQLite in single-thread mode Clément Lassieur
2018-11-04 23:08 ` [bug#33210] Cuirass: Use a " Ludovic Courtès
2018-11-05  8:02   ` Clément Lassieur
2018-11-06  0:11     ` Danny Milosavljevic
2018-11-06  0:50       ` Clément Lassieur
2018-11-06 11:20         ` Danny Milosavljevic
2018-11-06 14:07           ` Clément Lassieur [this message]
2018-11-06 20:10             ` Danny Milosavljevic
2018-11-07 11:38               ` Clément Lassieur
2018-11-07 23:59                 ` Danny Milosavljevic
2018-11-08  7:45                   ` Clément Lassieur
2018-11-06 14:40     ` Ludovic Courtès
2018-12-13 13:57       ` bug#33210: " Clément Lassieur

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875zxa5mfn.fsf@lassieur.org \
    --to=clement@lassieur.org \
    --cc=33210@debbugs.gnu.org \
    --cc=dannym@scratchpost.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).