[Bug 3564] New: obsolete store can be read from partial data
bugzilla-daemon at bz.selenic.com
bugzilla-daemon at bz.selenic.com
Mon Jul 30 13:31:48 CDT 2012
http://bz.selenic.com/show_bug.cgi?id=3564
Priority: normal
Bug ID: 3564
CC: mercurial-devel at selenic.com
Assignee: bugzilla at selenic.com
Summary: obsolete store can be read from partial data
Severity: bug
Classification: Unclassified
OS: Mac OS
Reporter: patrick at mezard.eu
Hardware: PC
Status: UNCONFIRMED
Version: 2.2.3
Component: Mercurial
Product: Mercurial
Writing to localrepo.obsstore is done by locking the store, starting a
transaction and appending markers data.
Reading does not lock anything, relying on the wrong assumption the transaction
and log structured format would prevent every issue. But transactions do not
provide isolation and obsolete._readmarkers() can perfectly read partial data.
An easy fix is to write the obstore with atomictemp=True, as we do with other
metadata files like dirstate or bookmarks. I was a little concerned doing this
with obsstore which can potentially gets much bigger than bookmarks or
branchheads. But we already do it for dirstate...
Or we can have a sibling file storing the obsstore valid data size, which is
updated atomically. It is tempting to try to read the transaction file if any
to get this number, but I do not think there is a reliable way to do that.
(As a side note, obsolete markers being pushed after the changegroup, clients
could pull revisions before the related markers are made available).
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Mercurial-devel
mailing list