Commit Graph

6 Commits

Author SHA1 Message Date
Durham Goode
20f9ac38f6 remotefilelog: handle corrupt loose files more gracefully
Summary:
If the history portion of a loose file was corrupt, users would often
get errors like "ValueError: substring not found" when trying to split on the
null separators. Let's catch that and handle it where appropriate. For cache
stores, we move it out of the way and return a KeyError, so the union store will
move on to try to fetch it from the server again. For local stores, we return a
ValueError and surface it to the user since their local data may be corrupt.

Reviewed By: quark-zju

Differential Revision: D13976499

fbshipit-source-id: 39e63f19fc752ca0179fbc5b0908a28d46de3a3a
2019-02-07 13:40:42 -08:00
Durham Goode
2def6874f5 remotefilelog: default file blobs to version 1
Summary:
We're seeing cache corruption issues due to mixing and matching loose
file versions. Let's just default to 1.

Reviewed By: quark-zju

Differential Revision: D13980892

fbshipit-source-id: 1e8cc9a53b8b92e05dc08b202505bb8f453a3074
2019-02-07 11:08:01 -08:00
Stanislau Hlebik
ff74d1cc82 remotefilelog: add an option to verify all the hashes
Reviewed By: DurhamG

Differential Revision: D13838772

fbshipit-source-id: e7220ba8a0e07f3003693199086e3a3512023857
2019-02-05 15:03:24 -08:00
Mark Thomas
02a0c8503d remotefilelog: store loose file filenames alongside the data
Summary:
Loose files don't contain the original filename inside them, but rather the
directory name is based on the sha1 hash of the filename.  This means that
given a remotefilelog data file, we can't find out the name of the file that
it contains.

Repack needs to know this (plus it's also useful for debug purposes), so add
an additional file in the directory, `filename`, which contains the original
filename of all the data files in the directory.

It follows that `sha1(read(filename)) == basename(dirname(filename))`

Reviewed By: DurhamG

Differential Revision: D10516851

fbshipit-source-id: aeeb1a116e0d50a134c274c3bb31c7c26aa8015c
2018-10-26 01:16:13 -07:00
Jun Wu
1cde63d99c codemod: drop hacks changing PYTHONPATH in tests
Summary:
Now they are unnecessary since `run-tests.py` will set up `PYTONPATH`
correctly.

Differential Revision: D6865042

fbshipit-source-id: ca95314f725968e14349a9d916434aa832c596f9
2018-04-13 21:51:00 -07:00
Durham Goode
fe980ff373 remotefilelog: move to hgext/
Summary:
Moves the remotefilelog extension into hgext/ and it's tests into
tests/.

I did not fix up all the check-module errors, since it's a ton of work for
very little impact at this point.

Test Plan: make local && ./run-tests.py

Reviewers: #mercurial

Differential Revision: https://phabricator.intern.facebook.com/D6680030
2018-01-08 18:58:08 -08:00