D5449: pull: fix inconsistent view of bookmarks during pull (issue4700)

Yuya Nishihara yuya at tcha.org
Thu Dec 20 09:11:04 EST 2018


>   AFAIK, the protocol is never stateful (not sure how that'd work with http), so you can't rely on a notion of session-level state on the server to guarantee consistency.

True. I think the new v2 protocol will eventually get around the issue
since it will be more properly batched. @indygreg ?

>   I can see two plausible alternatives:
>   
>   1. doing all the lookup queries and the bookmarks query in a single roundtrip. Is it guaranteed that a group of batchable queries will be sent in one go and won't be split up (if there are many of them for instance)?
>   2. tweak the new lookup query to be instead `lookup(name, bookmark=node)`, which would mean: `lookup(name)` as if there exist a bookmark called `name` pointing to `node`. So kind of the snapshot idea, where you give the server the relevant part of the snapshot.

3. do lookup() again at the end of the transaction to detect race, and abort

If the race doesn't occur frequently, I think it's okay to discard the pulled
data.


More information about the Mercurial-devel mailing list