Skip to content
Snippets Groups Projects
Commit 849745d7da89 authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

revlog: avoid wrongly updating the data file location on "divert"

If we are in the inline case, we need to align the location of the "data" file
with the temporary location of the file (i.e. "00changelog.i.a"). However we
should not do that for non-inline case… and before this changeset we had been
doing it. In addition `index_file` is already a property taking care of updating
the "segment file" filename when needed. So we can simply remove all that code.

As a result, code trying to read the diverted data before they were committed
ended deeply confused as the "00changelog.i.a" file is nothing like the
"00changelog.d" file.

However nothing corrupted data as all writing where properly handled outside of
the "segment file".

In "best" cases this small in-memory corruption of the filename when unnoticed
until the transaction was committed or rolled back and in the worse case, some
data reading was failing during the transaction and resulted in the transaction
to be rolled back. However wrong data never reached the disk, so this bug should
be have corrupted any repository.

This is not catch by tests because most test use a small repository and
therefor an inline revlog. In addition the bug only triggers when a
changelog read is done in the following "rare" situation:
- after some delayed write
- after that data have been written in a "divert" file (i.e. `00.changelog.i.a`)
- before transaction commit
- outside of a "writing" context

The issue was introduced in d83d788590a8
parent 66417f55ea33
No related branches found
No related tags found
2 merge requests!728Merge stable into default,!722revlog: fix delayed write for non-inline changelog
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment