From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Ben Shelton <ben.shelton@ni.com>
Cc: bitbake-devel <bitbake-devel@lists.openembedded.org>
Subject: Re: [PATCH] prserv: don't wait until exit to sync
Date: Tue, 04 Nov 2014 14:13:54 +0000 [thread overview]
Message-ID: <1415110434.23396.29.camel@ted> (raw)
In-Reply-To: <20141103154726.GA9716@bshelton-desktop>
On Mon, 2014-11-03 at 09:47 -0600, Ben Shelton wrote:
> On 11/02, Burton, Ross wrote:
> > On 27 October 2014 17:27, Ben Shelton <ben.shelton@ni.com> wrote:
> >
> > > In the commit 'prserv: Ensure data is committed', the PR server moved to
> > > only committing transactions to the database when the PR server is
> > > stopped. This improves performance, but it means that if the machine
> > > running the PR server loses power unexpectedly or if the PR server
> > > process gets SIGKILL, the uncommitted package revision data is lost.
> > >
> > > To fix this issue, sync the database periodically, once per 30 seconds
> > > by default, if it has been marked as dirty. To be safe, continue to
> > > sync the database at exit regardless of its status.
> > >
> >
> > This appears to be causing random problems for me where bitbake will
> > timeout attempting to access the PR database, my hunch is that it's
> > blocking on disk I/O. Are there any tricks we can do with sqlite to reduce
> > the overhead of committing? (assuming that sqlite isn't causing a full
> > filesystem sync).
> >
> > Ross
>
> After running a few large nightly builds, we've seen some issues with
> this as well. It looks like the issue is in the PR server itself, which
> logs this error:
>
> "OperationalError: cannot start a transaction within a transaction"
>
> However, I'm confused as to why this is happening, since the only place
> new transactions are being created is in the sync() function ("BEGIN
> EXCLUSIVE TRANSACTION"), and AFAIK that's only called by a single
> thread. Any ideas?
I just posted a patch for this. Any SQL transaction will start a new one
if one wasn't already in progress. This was therefore a race between two
threads. Whether it fixes all the problems remains to be seen, WAL mode
may still be a good idea as it does perform better for our use case.
Cheers,
Richard
prev parent reply other threads:[~2014-11-04 14:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-27 17:27 [PATCH] prserv: don't wait until exit to sync Ben Shelton
2014-11-02 21:00 ` Burton, Ross
2014-11-03 15:47 ` Ben Shelton
2014-11-03 17:30 ` Richard Purdie
2014-11-03 18:27 ` Gary Thomas
2014-11-04 8:42 ` Richard Purdie
2014-11-04 10:51 ` Richard Purdie
2014-11-04 13:10 ` Burton, Ross
2014-11-04 14:13 ` Richard Purdie [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1415110434.23396.29.camel@ted \
--to=richard.purdie@linuxfoundation.org \
--cc=ben.shelton@ni.com \
--cc=bitbake-devel@lists.openembedded.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.