D6475: merge: fix race that could cause wrong size in dirstate

valentin.gatienbaron (Valentin Gatien-Baron) phabricator at mercurial-scm.org
Thu Jun 27 04:08:54 EDT 2019


valentin.gatienbaron added a comment.


  In D6475#95879 <https://phab.mercurial-scm.org/D6475#95879>, @martinvonz wrote:
  
  > In D6475#95878 <https://phab.mercurial-scm.org/D6475#95878>, @martinvonz wrote:
  >
  >> Try this:
  >> `hg co -C 4.9; hg debugrebuilddirstate; hg co 5.0; hg st`
  >> Before this patch, that produced an empty output as it should. After this patch, it lists hundreds of modified files (536 to be specific). A workaround is to add `--config worker.enabled=no`. Can you look into it? It's obviously a pretty serious bug that needs to be fixed before we release a new version.
  >
  > I forgot to say that what seems wrong in the dirstate is the size (probably other fields too, but size is probably the important one).
  
  Oops. I looked and the problem is clearly that the size/lstat for the dirstate are getting swapped between files, when over the parallelism threshold. I thought worker.py would split input arguments [0,1,2,3,4,5] into [[0,1,2], [3,4,5]] but it's actually [[0,2,4], [1,3,5]], so the lists of results are jumbled with parallelization.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6475/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6475

To: valentin.gatienbaron, durin42, martinvonz, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list