[Bug 6181] New: branchmap cache stores non-store-specific caches in shared cache

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Fri Aug 2 20:46:38 UTC 2019


https://bz.mercurial-scm.org/show_bug.cgi?id=6181

            Bug ID: 6181
           Summary: branchmap cache stores non-store-specific caches in
                    shared cache
           Product: Mercurial
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: feature
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla at mercurial-scm.org
          Reporter: hg at pewpew.net
                CC: mercurial-devel at mercurial-scm.org

Created attachment 2054
  --> https://bz.mercurial-scm.org/attachment.cgi?id=2054&action=edit
.t test demonstrating issue

Reproduction setup:

hg init orig
cd orig
echo hi > foo
hg ci -qAm initial_rev0
echo "hi again" >> foo
hg ci -qAm "hi again rev1"
hg prune -r .   # automatically goes to rev0
cd ..
hg share orig other
cd other
hg co -r 1 --hidden
cd ..


We now have:

repo 'orig', with rev0 checked out, and rev1 is considered "hidden"
repo 'other', with rev1 checked out, so it's NOT considered "hidden"

Operations in 'other' will write to orig/.hg/cache/branch2-served saying that
rev1 is part of that set. Operations in 'orig' will write to that same file
saying that it is *not*.


Proof:
hg -R orig log -r 'public()' >/dev/null
cat orig/.hg/cache/branch2-served
hg -R other log -r 'public()' >/dev/null
cat orig/.hg/cache/branch2-served
hg -R orig log -r 'public()' >/dev/null
cat orig/.hg/cache/branch2-served

The branch2-served file will flip-flop between considering rev1 as the tip and
rev0, depending on the most recent repo to access it. 

The attached .t file will also demonstrate this issue.

The other caches, besides -served, are probably fine. The caches are: 
- unfiltered, a superset of visible
- visible-hidden, a superset of visible
- visible, a superset of served
- served.hidden, a superset of served
- served, a superset of immutable
- immutable, a superset of base

Here's what I believe is a description of each cache type:

- base: this appears to be "the set of public (immutable) changes, starting at
0, that have no mutable revision between the min and the max of the set". i.e.
if rev0, rev1, and rev3 are public, but rev2 is draft, this will only include
{0, 1}. This cache is based entirely on phaseroots, and is safe to put in
shared cache.
- immutable: all "public" revisions. Again, based on phaseroots, safe in shared
cache.
- served: any commit not considered "hidden" or in "secret" (or above:
internal/archived) phases. Since "hidden"ness is wdir-dependent, this is NOT
safe in shared cache.
- served.hidden: served + hidden, aka "secret" (or above). Only uses
phaseroots, safe in shared cache.
- visible and visible-hidden appear to be identical: "not hidden". These are
probably also NOT safe in shared cache, but `hg debugupdatecache` doesn't
update visible or visible-hidden, so it's a little harder to prove in testing
currently.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list