Commit graph

22897 commits

Author SHA1 Message Date
Joey Hess
823cc9b800 Merge branch 'master' into database 2015-02-18 14:12:34 -04:00
Joey Hess
17cb219231 more robust handling of deferred commits
Still not robust enough. I have 3 fscks running concurrently, and am
seeing:

("commit deferred",user error (SQLite3 returned ErrorBusy while attempting
to perform step.))

and

git-annex: user error (SQLite3 returned ErrorBusy while attempting to perform prepare "SELECT \"fscked\".\"key\"\nFROM \"fscked\"\nWHERE \"fscked\".\"key\" = ?\n": database is locked)
2015-02-18 14:11:27 -04:00
Joey Hess
ca4cd9f960 comment 2015-02-17 17:55:37 -04:00
Joey Hess
149d4bda61 comment 2015-02-17 17:53:08 -04:00
Joey Hess
5896944f3f comment 2015-02-17 17:51:29 -04:00
Joey Hess
6154cbf4aa comment 2015-02-17 17:49:39 -04:00
Joey Hess
318cc814b0 comment 2015-02-17 17:45:24 -04:00
Joey Hess
9f3785e8ee comment 2015-02-17 17:42:53 -04:00
Joey Hess
881bed8046 comment 2015-02-17 17:40:43 -04:00
Joey Hess
1f19bd941e wrapping 2015-02-17 17:38:40 -04:00
Joey Hess
d857e2104d wtf 2015-02-17 17:37:36 -04:00
Joey Hess
2bac643436 Merge branch 'master' of ssh://git-annex.branchable.com 2015-02-17 17:12:16 -04:00
Joey Hess
12048f5d17 devblog 2015-02-17 17:10:47 -04:00
Joey Hess
689a497b13 comment 2015-02-17 17:09:42 -04:00
Joey Hess
7fb2e4ec14 fix title 2015-02-17 17:09:35 -04:00
Joey Hess
39a82a76c1 close bug 2015-02-17 17:09:21 -04:00
Joey Hess
3414229354 fsck: Multiple incremental fscks of different repos (some remote) can now be in progress at the same time in the same repo without it getting confused about which files have been checked for which remotes. 2015-02-17 17:08:11 -04:00
Joey Hess
a3370ac459 allow for concurrent incremental fsck processes again (sorta)
Sqlite doesn't support multiple concurrent writers
at all. One of them will fail to write. It's not even possible to have two
processes building up separate transactions at the same time. Before using
sqlite, incremental fsck could work perfectly well with multiple fsck
processes running concurrently. I'd like to keep that working.

My partial solution, so far, is to make git-annex buffer writes, and every
so often send them all to sqlite at once, in a transaction. So most of the
time, nothing is writing to the database. (And if it gets unlucky and
a write fails due to a collision with another writer, it can just wait and
retry the write later.) This lets multiple processes write to the database
successfully.

But, for the purposes of concurrent, incremental fsck, it's not ideal.
Each process doesn't immediately learn of files that another process has
checked. So they'll tend to do redundant work.

Only way I can see to improve this is to use some other mechanism for
short-term IPC between the fsck processes. Not yet done.

----

Also, make addDb check if an item is in the database already, and not try
to re-add it. That fixes an intermittent crash with
"SQLite3 returned ErrorConstraint while attempting to perform step."

I am not 100% sure why; it only started happening when I moved write
buffering into the queue. It seemed to generally happen on the same file
each time, so could just be due to multiple files having the same key.
However, I doubt my sound repo has many duplicate keys, and I suspect
something else is going on.

----

Updated benchmark, with the 1000 item queue: 6m33.808s
2015-02-17 16:56:12 -04:00
Joey Hess
bd6e41f8e6 Merge branch 'master' into database
Conflicts:
	debian/changelog
2015-02-17 16:15:00 -04:00
195.234.136.80
d6f618366d poll vote (OpenStack SWIFT) 2015-02-17 17:59:25 +00:00
Joey Hess
afb3e3e472 avoid crash when starting fsck --incremental when one is already running
Turns out sqlite does not like having its database deleted out from
underneath it. It might suffice to empty the table, but I would rather
start each fsck over with a new database, so I added a lock file, and
running incremental fscks use a shared lock.

This leaves one concurrency bug left; running two concurrent fsck --more
will lead to: "SQLite3 returned ErrorBusy while attempting to perform step."
and one or both will fail. This is a concurrent writers problem.
2015-02-17 13:30:24 -04:00
Joey Hess
ea76d04e15 show error when sqlite crashes worker thread
Better than "blocked indefinitely in MVar"..
2015-02-17 13:03:57 -04:00
sairon
c6ff9385e6 Added a comment 2015-02-17 15:04:55 +00:00
https://www.google.com/accounts/o8/id?id=AItOawlmLuHhscJsoAqb9q0N3LdtHum6LjY1LK4
0f9c158222 removed 2015-02-17 14:44:58 +00:00
https://www.google.com/accounts/o8/id?id=AItOawlmLuHhscJsoAqb9q0N3LdtHum6LjY1LK4
f3b3319f9d Added a comment 2015-02-17 14:43:20 +00:00
https://www.google.com/accounts/o8/id?id=AItOawlmLuHhscJsoAqb9q0N3LdtHum6LjY1LK4
1feec604ac Added a comment 2015-02-17 14:43:02 +00:00
https://www.google.com/accounts/o8/id?id=AItOawnPgn611P6ym5yyL0BS8rUzO0_ZKRldMt0
dee48b959d Added a comment: Reseting to the git-annex branch 2015-02-17 09:21:12 +00:00
https://id.koumbit.net/anarcat
589ecfd470 Added a comment: document in the manpage? 2015-02-17 05:28:33 +00:00
https://id.koumbit.net/anarcat
54683714a8 Added a comment 2015-02-17 05:22:00 +00:00
https://id.koumbit.net/anarcat
dfe67f643e Added a comment: the actual process i use 2015-02-17 00:58:38 +00:00
https://id.koumbit.net/anarcat
f86f4fd551 hopefully i nailed the title better here :) 2015-02-17 00:46:24 +00:00
Joey Hess
8346ce18a8 Merge branch 'master' of ssh://git-annex.branchable.com 2015-02-16 19:38:19 -04:00
Joey Hess
88fbb13ee3 Linux standalone: Improved process names of linker shimmed programs. 2015-02-16 19:36:26 -04:00
https://id.koumbit.net/anarcat
20f830cc4a Added a comment: watch out for direct mode 2015-02-16 23:22:19 +00:00
https://id.koumbit.net/anarcat
4d0cc62e8e Added a comment 2015-02-16 21:26:22 +00:00
Joey Hess
99a1287f4f avoid fromIntegral overhead 2015-02-16 17:22:00 -04:00
Joey Hess
f4c677feeb Merge branch 'master' of ssh://git-annex.branchable.com 2015-02-16 17:15:08 -04:00
Joey Hess
f400e0ebec devblog 2015-02-16 17:14:33 -04:00
Joey Hess
0ad35db26b update plan 2015-02-16 17:14:13 -04:00
Joey Hess
4e0a678a99 update 2015-02-16 17:08:58 -04:00
Joey Hess
7d36e7d18d commit new transaction after 60 seconds
Database.Handle can now be given a CommitPolicy, making it easy to specify
transaction granularity.

Benchmarking the old git-annex incremental fsck that flips sticky bits
to the new that uses sqlite, running in a repo with 37000 annexed files,
both from cold cache:

old: 6m6.906s
new: 6m26.913s

This commit was sponsored by TasLUG.
2015-02-16 17:05:42 -04:00
https://id.koumbit.net/anarcat
02b49f9d60 fix link 2015-02-16 20:33:03 +00:00
Joey Hess
d2766df914 commit more transactions when fscking
This makes interrupt and resume work, robustly.

But, incremental fsck is slowed down by all those transactions..
2015-02-16 16:07:36 -04:00
Joey Hess
91e9146d1b convert incremental fsck to using sqlite database
Did not keep backwards compat for sticky bit records. An incremental fsck
that is already in progress will start over on upgrade to this version.

This is not yet ready for merging. The autobuilders need to have sqlite
installed.

Also, interrupting a fsck --incremental does not commit the database.
So, resuming with fsck --more restarts from beginning.

Memory: Constant during a fsck of tens of thousands of files.
(But, it does seem to buffer whole transation in memory, so
may really scale with number of files.)

CPU: ?
2015-02-16 15:35:26 -04:00
https://www.google.com/accounts/o8/id?id=AItOawnwNDA50ZupMvOgpgDqzDRyu5B-mYlVwa4
7caded119a Added a comment 2015-02-16 17:32:32 +00:00
https://www.google.com/accounts/o8/id?id=AItOawldTFGlKsKUyq6F6CJ22CNBnmYJ0LQbLUQ
c37d13b56f 2015-02-16 10:08:15 +00:00
https://www.google.com/accounts/o8/id?id=AItOawldTFGlKsKUyq6F6CJ22CNBnmYJ0LQbLUQ
5ba1eb2285 2015-02-16 10:06:41 +00:00
BojanNikolic
597e0a8964 Added a comment: Publishing using rsync/directory layout 2015-02-16 10:04:41 +00:00
https://www.google.com/accounts/o8/id?id=AItOawldTFGlKsKUyq6F6CJ22CNBnmYJ0LQbLUQ
28da6ae77c 2015-02-16 10:00:29 +00:00
Joey Hess
e79c3fff23 update 2015-02-15 14:29:27 -04:00