You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement support for in-pack Ref Deltas during Mononoke Git push
Summary:
As highlighted in the previous diff, we currently do not support this. Everytime the pack parser encounters a ref-delta, it assumes that the base of the delta is an existing object that is present on the server. In 99% of the cases, this is true. However, in certain scenarios, Git can push a packfile containing ref deltas where the base of the delta is present in the same packfile.
The strategy to support such deltas involves making the pack parser iterative instead of doing a single pass over the packfile and reporting the result. The steps are as follows:
1. Identify all ref deltas in the pack and collect the ID of all the base objects
2. Fetch all the bases objects from Mononoke, if they are already present in our storage
3. Try to unpack the pack file and use the fetched base objects for resolving deltas in case we encounter any
4. If we encounter a ref delta which points to a base object that is unknown to us, keep track of it and continue instead of erroring out
5. At the end of the iteration, collect all the unpacked objects and add them to the set of base objects already known to us
6. Using the updated set of base objects, continue again from step 3
Any valid packfile will eventually get parsed and unpacked using this strategy. However, we could end up in an infinite loop in case of an invalid packfile with ref delta refering to an invalid base object with the above steps. To avoid this, we have added an upper limit to the max number of iterations.
Differential Revision: D68025406
fbshipit-source-id: 1aa406fe9033490e985c042b3fe4c6c82dde1ae8
Copy file name to clipboardExpand all lines: eden/mononoke/tests/integration/mononoke_git_server/test-mononoke-git-server-push-empty-repo-with-deltas.t
Error in decoding packfile entry: RefDelta { base_id: Sha1(ccce194714ee3fae382fad2f4a67cd6c1a7320cd) }: A delta chain could not be followed as the refbasewith id ccce194714ee3fae382fad2f4a67cd6c1a7320cd could not be found
0 commit comments