summaryrefslogtreecommitdiff
path: root/larch
AgeCommit message (Collapse)AuthorFilesLines
2015-10-25Prepare release 1.20151025larch-1.20151025Lars Wirzenius1-1/+1
2015-09-27Show dropped B-tree keys in hexadecimalLars Wirzenius2-2/+5
This is less alarming and confusing to people.
2014-01-14Add fsck unit testsLars Wirzenius1-0/+244
Patch-by: Antoine Brenner
2013-11-30Prepare release 1.20131130larch-1.20131130Lars Wirzenius1-1/+1
2013-11-11Remove dead codeLars Wirzenius1-1/+0
2013-11-06Fix typo on tracing messageLars Wirzenius1-1/+1
2013-11-06Don't save refcount groups that haven't changedLars Wirzenius2-11/+14
This bug was exposed by a test data set provided by Rob Kendrick. Saving reference count groups would sometimes overwrite a correct saved group with one that had all counts set to zero. This would happen when the "dirty set" (node ids whose refcounts had been changed but not yet saved) contained, for example, node ids for the Nth and N+2th group, but not the N+1th group between them. The old save_refcounts logic would blithely save that group anyway, and if the in-memory reference counts happened to not be in the refcount dict, it would save zeroes instead. To fix this, save_refcounts now only saves groups that have any dirty refcounts, and skips saving a refcount group that is all clean. To do this efficiently, we need to change the encode_refcounts function signature, to get the set of keys it is to actually put into the group. This set is now computed by save_refcounts. This meant that all call sites for encode_refcounts need to be fixed as well. Luckily the fix is easy: there's only one production use of it, the rest is tests or benchmarks.
2013-11-06Delete wrong testsLars Wirzenius1-11/+0
Since we no longer treat a refcount of 0 specially, these tests no longer make any sense.
2013-11-06Fix KeyError for missing refcountLars Wirzenius1-5/+1
We would sometimes, rarely, have a crash that looked like this: File "..refcountstore.py", line 76, in get_refcount return self.refcounts[node_id] KeyError: 32970 In other words, the object keeping track of reference counts for B-tree nodes would think it doesn't have the reference count for a node, when it should have it. After much debugging, by myself and Itamar Turner-Trauring, and greatly helped by a repeatable test case provided by Rob Kendrick, this was tracked to an optimisation in the set_refcount method, which would remove (to save memory) the refcount for a node (remove the entry for a node's id in the refcount dict), when the refcount was set to zero. Unfortunately this conflicted with an assumption in get_refcount that a refcount for a node that was in the dirty set was actually present in the refcount dict. The bug fix is easy: don't remove the node from the refcount dict, and eat the (very minor) memory consumption hit, in the name of correctness.
2013-09-06Break long linesLars Wirzenius1-4/+10
2013-09-06fsck fixes from Antoine BrennerLars Wirzenius1-5/+50
2013-08-08Prepare release version 1.20130808larch-1.20130808Lars Wirzenius1-1/+1
2013-08-03Bugfix: Use uncomitted journal when read-onlyLars Wirzenius1-17/+28
What used to happen: * Instance 1 would crash in the middle of committing a journal. * Instance 2 would open the B-tree in read-only mode, and not read files from the journal. It would then crash, because the partly modified B-tree made no sense. What happens now: * When a B-tree is opened in read-only mode, and the journal is partly comitted, the journal is checked in preference for files in the B-tree proper. No confusion anymore.
2013-03-16Prepare release version 1.20130316larch-1.201303161.20130316Lars Wirzenius1-1/+1
2013-02-24Improve error messages for missing nodesLars Wirzenius2-5/+7
2013-01-20Fix speed-testLars Wirzenius6-9/+17
2013-01-16Repair non-working example.py and speed-testAntoine Brenner6-9/+10
The introduction of the allow_writes parameter in larch/forest.py:open_forest() broke example.py and speed-test. Just adding the parameter to the open_forest calls was not enough to fix the issue. This patch fixes the issue by adding the allow_writes parameter where it is needed beyond the open_forest calls. Most notably, this patch changes the __init__ signature of the abstract base class larch.NodeStore from __init__(self, node_size, codec) to __init__(self, allow_writes, node_size, codec) This mimicks the current signatures of NodeStoreDisk and NodeStoreMemory, which include the use of allow_writes as first parameter, and which seem required to actually create a forest anyway since forest.py creates node_store instances with allow_writes as first parameter in open_forest
2013-01-16Fix allow_writeBrinx3-4/+5
2013-01-05Show node ids in error messages in hexLars Wirzenius1-6/+6
This makes it easier to find them on disk, since the filenames are already in hex.
2013-01-04(minor) report node numbers in hex format in order to match with filenamesDamien Couroussé1-3/+3
2012-12-19Fix missing node problems by removing them from B-treesLars Wirzenius1-7/+26
2012-12-19Refactor logic for checking index nodesLars Wirzenius1-12/+32
This is a preliminary step for dealing with missing children. We're going to need to do a get_node for the children, but we want to avoid doing that many times per node, so this change makes it so this will be easier to do.
2012-12-19Add missing empty lineLars Wirzenius1-0/+1
2012-12-16Prepare release version 1.20121216larch-1.20121216Lars Wirzenius1-1/+1
2012-12-03Optionally add original exception to NodeMissingLars Wirzenius2-5/+10
2012-12-02Log the exception that gets replaced by NodeMissingLars Wirzenius1-0/+2
2012-12-02Fix an other instance of OSError mis-creationLars Wirzenius1-1/+1
2012-12-02Fix how OSError is createdLars Wirzenius1-2/+2
2012-11-25Set refcount correctlyLars Wirzenius1-1/+2
2012-11-24Fix refcount errorsLars Wirzenius1-0/+16
2012-11-24Check refcountsLars Wirzenius1-6/+25
2012-11-24Simplify fsck so it only checks node reachabilityLars Wirzenius1-148/+17
2012-11-23Report what's being checked with more precisionLars Wirzenius1-6/+10
2012-11-17Return each work item as created, instead of listLars Wirzenius1-6/+5
This makes it possible to do smoother progress reporting.
2012-10-06Update version numbers for release of 1.20121006larch-1.20121006Lars Wirzenius1-1/+1
2012-09-30Prepare release version 1.20120930Lars Wirzenius1-1/+1
2012-06-17Fix indentation problemLars Wirzenius1-1/+1
Thanks, Damien Couroussé, for reporting the bug via Debian.
2012-05-27Release version 1.20120527larch-1.20120527Lars Wirzenius1-2/+2
2012-05-08Release version 0.31larch-0.31Lars Wirzenius1-1/+1
2012-05-05Make all exceptions be subclasses of new class larch.ErrorLars Wirzenius10-75/+39
2012-05-05Raise exceptions if key or node size is missing from metadataLars Wirzenius3-4/+35
2012-05-02Optimize away a further round tripLars Wirzenius1-4/+7
No point in checking for a file to exist, if we're going to be reading at once anyway.
2012-05-02Optimize away some round trips for accessing files in the journalLars Wirzenius1-7/+20
2012-04-29Prepare for release 0.30larch-0.30Lars Wirzenius1-1/+1
2012-04-23Ignore missing files, directories, when removing stuffLars Wirzenius1-1/+4
2012-04-23Fix everything to use flag-files to file removalLars Wirzenius3-9/+99
Also, add a list_files method to the journal so NodeStoreDisk can easily find a list, without having to detect externally whether specific files exist or not, and whether they're in the journal or not.
2012-04-23Fix exists for new way of deleting filesLars Wirzenius1-2/+8
2012-04-23Remove creates flag file, instead of moving actual fileLars Wirzenius1-7/+8
This should be less error prone.
2012-04-23Fix test case for read-only modeLars Wirzenius1-1/+1
If writer removes a file, we should still be able to read it in the reader until the writer commits.
2012-04-21Make open_forest give NodeStoreDisk the allow_writes flagLars Wirzenius4-21/+26