<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/poky.git/bitbake/lib/prserv/db.py, branch pyro-enea</title>
<subtitle>Mirror of git.yoctoproject.org/poky</subtitle>
<id>https://git.enea.com/cgit/linux/poky.git/atom?h=pyro-enea</id>
<link rel='self' href='https://git.enea.com/cgit/linux/poky.git/atom?h=pyro-enea'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/'/>
<updated>2016-06-02T07:24:02+00:00</updated>
<entry>
<title>bitbake: bitbake: Convert to python 3</title>
<updated>2016-06-02T07:24:02+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2016-05-12T07:30:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=0f2c59367a649de5f57acdccfb4f1fdba9cde730'/>
<id>urn:sha1:0f2c59367a649de5f57acdccfb4f1fdba9cde730</id>
<content type='text'>
Various misc changes to convert bitbake to python3 which don't warrant
separation into separate commits.

(Bitbake rev: d0f904d407f57998419bd9c305ce53e5eaa36b24)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: prserv: Add dump_db()</title>
<updated>2016-02-26T17:20:31+00:00</updated>
<author>
<name>Haris Okanovic</name>
<email>haris.okanovic@ni.com</email>
</author>
<published>2016-02-23T17:36:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=4a12865c7b8a534ac7f7c1380c549c5392eda5f5'/>
<id>urn:sha1:4a12865c7b8a534ac7f7c1380c549c5392eda5f5</id>
<content type='text'>
Returns a script (string) that reconstructs the state of the
entire database at the time this function is called. The script
language is defined by the backing database engine, which is a
function of server configuration.
Returns None if the database engine does not support dumping to
script or if some other error is encountered in processing.

The SQLite3 implementation in db.py calls iterdump() [1] to generate
a script. iterdump() is the library equivalent of the `sqlite3 .dump`
shell command, and the scripts are compatible. Execute the script in
an empty SQLite3 database using the sqlite3 utility to restore a backup
of prserv.

Use case: Backup a live PR server database in a non-racy way, such
that one could snapshot the entire database after a set of bitbake
builds all using a shared server. I.e. All changes made prior to
the start of a dump_db() operation should be committed and captured
in the script. Subsequent changes made during the backup process are
not guaranteed to be captured.

Testing: ~7MB database backs up in ~1s while PR server is under load
from 32 thread bitbake builds on two separate machines.

[1] https://docs.python.org/2/library/sqlite3.html#sqlite3.Connection.iterdump

(Bitbake rev: 004003daf6bd0f0233ce5c2d95f1d7d64ab91bb3)

Signed-off-by: Haris Okanovic &lt;haris.okanovic@ni.com&gt;
Reviewed-by: Ken Sharp &lt;ken.sharp@ni.com&gt;
Reviewed-by: Bill Pittman &lt;bill.pittman@ni.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: prserv/serv: Close the DB connection out of class destructor</title>
<updated>2015-09-28T11:00:32+00:00</updated>
<author>
<name>Leonardo Sandoval</name>
<email>leonardo.sandoval.gonzalez@linux.intel.com</email>
</author>
<published>2015-09-23T13:39:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=134b267ebbcbf7a7bc43915e204da776530911d4'/>
<id>urn:sha1:134b267ebbcbf7a7bc43915e204da776530911d4</id>
<content type='text'>
When launching the PR server daemon, the PRData __del__ function was being
called (no reason found yet) where the DB connection closed, thus following
PR updates were not getting into the DB. This patch closes the connection
explicitly, not relaying on the __del__ function execution.
Closing the connection in turn causes all WAL file transactions to be moved
into the database (checkpoint), thus effectively updating the database.

[YOCTO #8215]

(Bitbake rev: c1b4754f69003df1a83fafc1c80a9ef74400b6dd)

Signed-off-by: Leonardo Sandoval &lt;leonardo.sandoval.gonzalez@linux.intel.com&gt;
Signed-off-by: Ross Burton &lt;ross.burton@intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: prserv/db: Document history modes</title>
<updated>2015-07-12T21:50:40+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2015-07-10T13:13:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=625a6bf6e813c7b753a9379151c95a4bbc6865c3'/>
<id>urn:sha1:625a6bf6e813c7b753a9379151c95a4bbc6865c3</id>
<content type='text'>
I keep having to dig into the archives to remember this information.
Add it as a comment to the file instead.

(Bitbake rev: 21dce82056887d8d28edde61b1b82f78bdf7613c)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: prserv: Use WAL mode</title>
<updated>2014-11-06T16:45:23+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2014-11-05T16:58:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=7105d44d87783e4d54859d212cd6746cda49ab1d'/>
<id>urn:sha1:7105d44d87783e4d54859d212cd6746cda49ab1d</id>
<content type='text'>
Ideally, we want the PR service to have minimal influence from
queued disk IO. sqlite tends to be paranoid about data loss and
locks/fsync calls. There is a "WAL mode" which changes the journalling
mechanism and would appear much better suited to our use case.

This patch therefore switches the database to use WAL mode. With this
change, write overhead appears significantly reduced.

(Bitbake rev: 0cdd48261daeb17efc528b5de0ac81c8836e8565)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: prserv: don't wait until exit to sync</title>
<updated>2014-10-28T15:00:39+00:00</updated>
<author>
<name>Ben Shelton</name>
<email>ben.shelton@ni.com</email>
</author>
<published>2014-10-27T17:27:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=cf82c6756bad8f7a5edc92ce513e02816b88efb3'/>
<id>urn:sha1:cf82c6756bad8f7a5edc92ce513e02816b88efb3</id>
<content type='text'>
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.

(Bitbake rev: 424df64f2e9679043f0ce2b4f7dfc59c3d404304)

Signed-off-by: Ben Shelton &lt;ben.shelton@ni.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: prserv/db: Avoid fsync() calls</title>
<updated>2014-05-03T10:24:48+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2014-05-03T10:18:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=0304d92a9727ec9f8ea30f0cacaa29a66683bdab'/>
<id>urn:sha1:0304d92a9727ec9f8ea30f0cacaa29a66683bdab</id>
<content type='text'>
If the power were to fail, it doesn't matter to us much if the data
makes it to disk or not, we'd have other problems. However an fsync()
call on a multi build autobuilder is painful so lets avoid them.

(Bitbake rev: 4eb2dc8048e2722d64d589f453df1ce6262c71b8)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: prserv: Ensure data is committed</title>
<updated>2013-09-08T09:51:56+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2013-09-08T09:45:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=2ab1bf27f79beadc45e86a26c85fc0b95ae3496f'/>
<id>urn:sha1:2ab1bf27f79beadc45e86a26c85fc0b95ae3496f</id>
<content type='text'>
In exclusive mode, we need to complete the transaction for writes to make
it to the database. Therefore add sync calls to ensure this happens.

Autocommit mode is significantly (100 times) slower so caching the
data is of significant benefit.

(Bitbake rev: 4e55f7821786a59c2cd7dbd8bfa2a22f5f196e99)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: serv/db: Don't use BEGIN/COMMIT</title>
<updated>2013-09-01T14:51:11+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2013-08-31T22:42:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=bd023ef9c093b7e79bf44d8332744161eed56a18'/>
<id>urn:sha1:bd023ef9c093b7e79bf44d8332744161eed56a18</id>
<content type='text'>
Since we don't support using multiple servers on the same database file,
don't use the BEGIN/COMMIT syntax and allow writes to the database
to work ~100 times faster with no transaction locking.

(Bitbake rev: 42144a54979658f93fbbb43f7e271c1fff4d88ff)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: serv/db: Take an excluside lock on the database</title>
<updated>2013-09-01T14:51:11+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2013-08-31T22:42:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=883813deae842c25d9172aeceb5302fdec1258df'/>
<id>urn:sha1:883813deae842c25d9172aeceb5302fdec1258df</id>
<content type='text'>
We only support one server using the database at a time so take an exclusive
lock and avoid later lock overhead.

(Bitbake rev: e3e39be6f2d063858c92971ce8ccd89c95d4f26d)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
</feed>
