Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 01 Mar 2023 02:38:20 +0100] rev 49700
dirstate: set identity whenever we read the dirstate's v2 docket
The docket can be loaded outside of a full read (for exemple when
pre-fetching parents), so the current code would read/set the identity
after loading the data, opening a race condition:
A0: first process docket is read
B0: other process appends new data to the dirstate (and changes the docket)
A1: first process sets the identity (based on pre-B content, but with post-B identity)
A1: first process loads the dirstatemap from the data file
A1: first process does not detect the race and overwrites the update from B.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 21 Feb 2023 15:10:12 +0100] rev 49699
dirstate: factor the identity setting code in the dirstate map
We need it in more locations, so let us start factoring thing out first
to make sure the same code is called everywhere.
This bears some similarity with 85746485a4dd on default, but at a smaller
scope and for a different purpose.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 01 Mar 2023 00:07:26 +0100] rev 49698
dirstate: simplify the dirstate's read race testing
Now that most code behaves properly, we can simplify the expected matching.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 28 Feb 2023 19:36:46 +0100] rev 49697
dirstate: deal with read-race for pure rust code path (rhg)
If we cannot read the dirstate data, this is probably because a writing process
wrote it under our feet. So refresh the docket and try again a handful of time.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 28 Feb 2023 23:35:52 +0100] rev 49696
dirstate: deal with read-race for python code using rust object
If we cannot read the dirstate data, this is probably because a writing process
wrote it under our feet. So refresh the docket and try again a handful of time.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 28 Feb 2023 19:01:20 +0100] rev 49695
dirstate: deal with read-race for pure python code
If we cannot read the dirstate data, this is probably because a writing process
wrote it under our feet. So refresh the docket and try again a handful of time.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 01 Mar 2023 16:05:28 +0100] rev 49694
dirstate: abstract the reading of the data file in v2 in a method
We will need more changes to avoid some race conditions during read,
so we first isolate the simple logic before making it more complicated.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 27 Feb 2023 03:14:30 +0100] rev 49693
dirstate: add append/new-file variants in the dirstate's read race tests
This covers more ground and finds more bugs.
At that point I gave up on making things as `known-bad-output` /
`missing-correct-output` as this gets too messy.
Raphaël Gomès <rgomes@octobus.net> [Tue, 13 Dec 2022 14:51:36 +0100] rev 49692
dirstate: add a synchronisation point in the middle of the read
This will be useful to test some more race conditions around dirstate.
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 26 Feb 2023 16:27:50 +0100] rev 49691
dirstate: add v1-v2 variants to the dirstate's read race tests
More cases mean different issues.