Delete corrupt loose objects during LooseObjectsStep#1094
Merged
derrickstolee merged 11 commits intomicrosoft:masterfrom May 7, 2019
Merged
Delete corrupt loose objects during LooseObjectsStep#1094derrickstolee merged 11 commits intomicrosoft:masterfrom
derrickstolee merged 11 commits intomicrosoft:masterfrom
Conversation
Contributor
Author
|
In addition to the functional test, I tried this on my machine. The object gets deleted as expected, along with additional logging. Good news: if the corrupt loose object already exists in a pack, then the |
dfd1cad to
ae50663
Compare
jeschu1
reviewed
May 2, 2019
jeschu1
reviewed
May 2, 2019
jeschu1
reviewed
May 2, 2019
jeschu1
reviewed
May 2, 2019
jeschu1
reviewed
May 2, 2019
jeschu1
suggested changes
May 2, 2019
Member
jeschu1
left a comment
There was a problem hiding this comment.
I think this is very close, few questions comments
derrickstolee
commented
May 3, 2019
kewillford
approved these changes
May 3, 2019
Member
kewillford
left a comment
There was a problem hiding this comment.
Looks good to me. Can we write some Unit tests for the new public methods that are being added?
jrbriggs
reviewed
May 3, 2019
jeschu1
approved these changes
May 6, 2019
3c6a148 to
b594a74
Compare
jeschu1
reviewed
May 7, 2019
GVFS/GVFS.FunctionalTests/Tests/EnlistmentPerTestCase/LooseObjectStepTests.cs
Outdated
Show resolved
Hide resolved
jeschu1
reviewed
May 7, 2019
GVFS/GVFS.FunctionalTests/Tests/EnlistmentPerTestCase/LooseObjectStepTests.cs
Show resolved
Hide resolved
jeschu1
reviewed
May 7, 2019
GVFS/GVFS.FunctionalTests/Tests/EnlistmentPerTestCase/LooseObjectStepTests.cs
Outdated
Show resolved
Hide resolved
jeschu1
reviewed
May 7, 2019
GVFS/GVFS.FunctionalTests/Tests/EnlistmentPerTestCase/LooseObjectStepTests.cs
Outdated
Show resolved
Hide resolved
derrickstolee
commented
May 7, 2019
GVFS/GVFS.FunctionalTests/Tests/EnlistmentPerTestCase/LooseObjectStepTests.cs
Outdated
Show resolved
Hide resolved
We will need to enumerate a batch of loose objects independently of writing them to a stream. Pull out the loop and consume it as an enumerator instead.
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
derrickstolee
added a commit
that referenced
this pull request
May 9, 2019
… LooseObjectsStep These are the same commits as #1094 and #1116, now targeting `releases/shipped`. If we have a corrupt loose object, the `git pack-objects` command will fail as it cannot put that object into a pack-file. This stops all future iterations of the `LooseObjectsStep` from succeeding, so users will be stuck in a bad situation. * Refactor `WriteLooseObjectIds()` to rely on a new `LooseObjectsBatch()` method. * On failure to create a pack, check all objects in the batch (using `LooseObjectsBatch()` and libgit2) and delete those that fail. * Start disposing the repo in the dehydrate verb for safety. * Create a functional test that verifies this behavior. Move the `LooseObjectStepTests` to have a new enlistment for each test, since we are messing with the object store. Part of the issue is that .NET doesn't allow us to move files that are marked as read-only, which becomes problematic as tests create pack-indexes and other files. Resolves #1079
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If we have a corrupt loose object, the
git pack-objectscommand will fail as it cannot put that object into a pack-file. This stops all future iterations of theLooseObjectsStepfrom succeeding, so users will be stuck in a bad situation.Refactor
WriteLooseObjectIds()to rely on a newLooseObjectsBatch()method.On failure to create a pack, check all objects in the batch (using
LooseObjectsBatch()and libgit2) and delete those that fail.Start disposing the repo in the dehydrate verb for safety.
Create a functional test that verifies this behavior. Move the
LooseObjectStepTeststo have a new enlistment for each test, since we are messing with the object store. Part of the issue is that .NET doesn't allow us to move files that are marked as read-only, which becomes problematic as tests create pack-indexes and other files.Resolves #1079