[Bug 5905] New: Receiving inconsistent heads / phases data can result in mass phase advancement

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Thu May 31 19:39:04 EDT 2018


            Bug ID: 5905
           Summary: Receiving inconsistent heads / phases data can result
                    in mass phase advancement
           Product: Mercurial
           Version: default branch
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: bug
          Priority: normal
         Component: Mercurial
          Assignee: bugzilla at mercurial-scm.org
          Reporter: gregory.szorc at gmail.com
                CC: mercurial-devel at mercurial-scm.org

https://bugzilla.mozilla.org/show_bug.cgi?id=1462323#c21 documents an issue
where the https://hg.mozilla.org/ load balancer was improperly routing HTTP
requests from the same TCP connection to different servers.

An `hg pull` hitting servers that were themselves in the middle of an `hg pull`
could result in a race condition where the client received wire protocol
responses from servers in different states. e.g. it may obtain the "heads" from
a server with new changesets but the phases data (via a "getbundle" command)
from a server that hadn't received new changesets yet. This somehow resulted in
the client mass updating phase boundaries so practically all draft changesets
were promoted to public.

I'm not sure what exactly caused the mass draft -> public conversion. This is
obviously a bug on the server advertising inconsistent state by routing to
multiple backend servers. But at the same time, it feels weird/wrong for the
client to mass update draft changesets to public, even if server data is
slightly inconsistent (likely advertising a node that doesn't exist or failing
to advertise a node that does).

I'm filing this bug so there is a record of the issue in case anyone wants to
dig into it further.

Sadly, I don't have a very good way to reproduce. I suspect it involves having
a server "lie" in its "heads" or "phase-heads" bundle2 part to simulate either
being a push ahead or a push behind.

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

More information about the Mercurial-devel mailing list