Comment 22 for bug 239499

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 239499] Re: corrupt knit index on an old arch-imported bzr repo

This is the first[total unknown] failure:

['<inventory format="5" revision_id="Arch-1:<email address hidden>%guile-gnome-pkg--release--0--patch-9">\n',
 '<file file_id="x_c4c88f41-651e-4015-86e8-d1f9e74649ee" name="AUTHORS" revision="Arch-1:<email address hidden>%guile-gnome-pkg--release--0--patch-8" text_sha1="ca92ebbc17538ccb1dd59844c45debc21d24bdf0" text_size="985" />\n',
 '<file file_id="x_4cb46764-0bed-40e9-9a0d-494c055bee22" name="COPYING" revision="Arch-1:<email address hidden>%pkg--dev--0--base-0" text_sha1="dfac199a7539a404407098a2541b9482279f690d" text_size="17992" />\n',
 '<file file_id="x_1e86ce33-d322-4851-8e3a-56bd94263cde" name="ChangeLog" revision="Arch-1:<email address hidden>%guile-gnome-pkg--release--0--patch-9" text_sha1="19a8f61dd5b637388a654fb0de77303b19d52397" text_size="1758" />\n',
 '<file file_id="x_2ee4832d-64fc-4c45-8622-f5821b373cb4" name="HACKING" revision="Arch-1:<email address hidden>%guile-gnome-pkg--release--0--patch-9" text_sha1="7c6980f271d6e402b11d195fe873975fd62de352" text_size="5148" />\n',
 '<file file_id="x_d566e759-8b32-476f-94b3-99d85d3dbfde" name="INSTALL" revision="Arch-1:<email address hidden>%pkg--dev--0--base-0" text_sha1="98ddba3c54f8cd72a6c937b47a7faf1ed62899b8" text_size="9240" />\n',
 '<file file_id="x_52a01958-7e5a-4012-84b3-326a10756bf0" name="Makefile.am.bottom" revision="Arch-1:<email address hidden>%guile-gnome-pkg--release--0--patch-9" text_sha1="14670fe23531a365e96f450da3ffb5c778331c33" text_size="121" />\n',
 '<file file_id="x_060fd750-5bdd-477e-b9d3-5b3fd46097f5" name="NEWS" revision="Arch-1:<email address hidden>%guile-gnome-pkg--release--0--patch-6" text_sha1="a84176dc394e74d2644aaa0a63eb9db0e9bb8cb5" text_size="706" />\n',
 '<file file_id="x_743dfd52-64cc-467d-bc4c-337be0c37bd8" name="README" revision="Arch-1:<email address hidden>%guile-gnome-pkg--release--0--patch-6" text_sha1="0fea9ff9baeb72fd15d1599f2ec84fd9eb114c6f" text_size="1924" />\n',
 '<file file_id="x_f6bc671e-d292-4f39-b234-4f65344ef9f6" name="autogen-pkg.sh" revision="Arch-1:<email address hidden>%guile-gnome-pkg--release--0--patch-9" text_sha1="822dbc10317ffa523a1c31821765809e9906a1c9" text_size="4442" />\n',
 '<file file_id="x_b0b05af6-2b90-409e-995a-b7406273d6e7" name="autogen-support.sh" revision="Arch-1:<email address hidden>%pkg--dev--0--patch-1" text_sha1="273e8ebd814b7041d446f62ca3d1832d1b975701" text_size="8781" />\n',
 '<file executable="yes" file_id="x_bb155d62-24af-4587-ba66-69ac9713eec7" name="autogen.sh" revision="Arch-1:<email address hidden>%guile-gnome-pkg--release--0--patch-3" text_sha1="5cb28157753bcc45d75d3f474fefce4ccf856b30" text_size="2382" />\n',
 '<file file_id="x_2e3559b8-8e9c-454b-8c7d-ab31bb7d1340" name="common.mk" revision="Arch-1:<email address hidden>%pkg--dev--0--patch-6" text_sha1="a9961c998abb1e51e3f1f46810d927e67d4b4097" text_size="1178" />\n',
 '<file executable="yes" file_id="x_74c14f09-8615-4f8c-9ce6-462008928a41" name="dev-environ.in" revision="Arch-1:<email address hidden>%pkg--dev--0--patch-6" text_sha1="a0015197309491da3403d8b7c3a2d9debdd1f13f" text_size="699" />\n',
 '<file executable="yes" file_id="x_41191028-0a33-4d6a-a60a-b15035a538d4" name="h2def.py" revision="Arch-1:<email address hidden>%pkg--dev--0--base-0" text_sha1="ede7031250baeeb7c54c2dbdfb1a29d20e8eafe7" text_size="15020" />\n',
 '<directory file_id="x_d7166cfd-f538-4ec5-a899-1465d4806061" name="scripts" revision="Arch-1:<email address hidden>%pkg--dev--0--patch-2" />\n',
 '<file executable="yes" file_id="x_e335e391-841a-4614-a800-f51d7a4463c4" name="add-upstream" parent_id="x_d7166cfd-f538-4ec5-a899-1465d4806061" revision="Arch-1:<email address hidden>%pkg--dev--0--patch-3" text_sha1="7565c1f687686ab0b97ee2cf02c4cf88d13c0f64" text_size="461" />\n',
 '<file executable="yes" file_id="x_e81ba1d5-ada4-4e7b-8c3b-84c2e0464ace" name="fork-archive-pkgs" parent_id="x_d7166cfd-f538-4ec5-a899-1465d4806061" revision="Arch-1:<email address hidden>%pkg--dev--0--patch-2" text_sha1="0c9f8cffb68960a8429195976fc521f0cd2f2347" text_size="188" />\n',
 '<file executable="yes" file_id="x_fb58a11a-d896-4c27-9881-72e7f3a833e9" name="submit-merge" parent_id="x_d7166cfd-f538-4ec5-a899-1465d4806061" revision="Arch-1:<email address hidden>%pkg--dev--0--patch-5" text_sha1="49307d4f9c0ad7b5e5a769f4e66beaaac529ba4b" text_size="1358" />\n',
 '<file executable="yes" file_id="x_f83074b3-c42f-4ce0-8085-cedf6a989f5a" name="tla-for-each" parent_id="x_d7166cfd-f538-4ec5-a899-1465d4806061" revision="Arch-1:<email address hidden>%guile-gnome-pkg--release--0--patch-8" text_sha1="6e35f7741dd94bf54c4555feb8716a58128c6832" text_size="337" />\n',
 '<file executable="yes" file_id="x_1e58607e-ba5a-457c-b6b2-28eab623904c" name="update-inventories" parent_id="x_d7166cfd-f538-4ec5-a899-1465d4806061" revision="Arch-1:<email address hidden>%guile-gnome-pkg--release--0--patch-5" text_sha1="173454fa105884362e10f2904b41c31353f7e3e4" text_size="265" />\n',
 '</inventory>\n']

which has:
sha - c9c5790d04d50eb9c94a8300529112a79eff180a
expected sha - 45cb77d073b02f8e0376f2840c29375931e9b554
key - ('Arch-1:<email address hidden>%guile-gnome-pkg--release--0--patch-9',)

stripping the last \n in case its a \n trailing problem:
(Pdb) print sha_strings(text[:-1] + ["</inventory>"])
4bc10a37bd929b0e091c93147c771bef12d37e55

So its not the previously fixed bug.

As the gzip hunk decompressed ok, its not a random bit error (though it could be a multi-bit error).

I think the most likely explanation is a transplanted inventory delta with a bad basis.

E.g.:
repo 1 has rev basis, sha X
repo 2 has rev basis, sha Y
repo 2 creates a new patch ('Arch-1:<email address hidden>%guile-gnome-pkg--release--0--patch-9',) on top of basis

The line delta of ('Arch-1:<email address hidden>%
guile-gnome-pkg--release--0--patch-9',) is fetched as a delta to repo 1.
This line delta applies to make a sensible inventory but because the
inventory in repo 1 is different (specifically I think it has a
different last-changed in one or more files) the sha1 of the resulting
text does not match.

As a commentary, the restructured full-text based inventory we are
working on is much more resilient against these sorts of confusion
regardless of what api's an importer might use.

To fix this, I'm going to write a repair script for your repository
which will rewrite the inventory file assuming all the content is usable
but the sha's are wrong; and then see if the results look sensible.

-Rob