On 7 Jan 2021, at 07:18, Yingchun Li <sword.l...@gmail.com> wrote:Hi, AllMy Gerrit version is 3.3.0, when I run `git gc` in ther server side, itfailed with following message:git gcfatal: bad object refs/changes/54/754/metafatal: failed to run repack
the following messages were reported bygit fsck --fullChecking object directories: 100% (256/256), done.Checking objects: 100% (96104/96104), done.error: refs/changes/54/754/meta: invalid sha1 pointer ab6cd47eaf4cd2fee0b565ce55380a0ce0749345error: refs/changes/62/762/2: invalid sha1 pointer 1ca0211a41f0d205aae4faf012e5a7e4df6701dc
dangling commit cd0640e7c50f06d1489b1d24ef842e0e953c94c3dangling commit 7c07280af730b6abc4aaffa93112352952dc7e65dangling commit e40e98ab5fd31bbdff27e979dab3f8f0f1d74d69dangling commit f417e0c55dafd66ce6b86b5c648dc1150593e1afdangling commit 46197862a20ce93fdae5742b21e01398af7a429fSo what I should do to fix this issue?Br,
Yingchun
--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/473f1b5b-f190-4aa3-bbab-5358cfed939fn%40googlegroups.com.
On 7 Jan 2021, at 07:18, Yingchun Li <sword.l...@gmail.com> wrote:Hi, AllMy Gerrit version is 3.3.0, when I run `git gc` in ther server side, itfailed with following message:git gcfatal: bad object refs/changes/54/754/metafatal: failed to run repackAre you running ‘git gc’ while Gerrit is serving read/write traffic?If yes, you may have corrupted the repository in that way.
the following messages were reported bygit fsck --fullChecking object directories: 100% (256/256), done.Checking objects: 100% (96104/96104), done.error: refs/changes/54/754/meta: invalid sha1 pointer ab6cd47eaf4cd2fee0b565ce55380a0ce0749345error: refs/changes/62/762/2: invalid sha1 pointer 1ca0211a41f0d205aae4faf012e5a7e4df6701dcIt looks like your change #762 and #754 are corrupted.
Do you have any backups? Any replicas to recover the git refs?If not, you would have to remove the refs and run an offline reindex.
Thank you Luca!On 7 Jan 2021, at 07:18, Yingchun Li <sword.l...@gmail.com> wrote:Hi, AllMy Gerrit version is 3.3.0, when I run `git gc` in ther server side, itfailed with following message:git gcfatal: bad object refs/changes/54/754/metafatal: failed to run repackAre you running ‘git gc’ while Gerrit is serving read/write traffic?If yes, you may have corrupted the repository in that way.That's maybe the cause, my server was still running when I did `git gc`,So that means when do `git gc`, I would always stop gerrit?
Is the command`ssp -p 29418 myserver gerrit gc --all1` more safe?
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/8aa6147e-d6c5-4420-9b98-93f872e61a22n%40googlegroups.com.
Thank you Luca!On 7 Jan 2021, at 07:18, Yingchun Li <sword.l...@gmail.com> wrote:Hi, AllMy Gerrit version is 3.3.0, when I run `git gc` in ther server side, itfailed with following message:git gcfatal: bad object refs/changes/54/754/metafatal: failed to run repackAre you running ‘git gc’ while Gerrit is serving read/write traffic?If yes, you may have corrupted the repository in that way.That's maybe the cause, my server was still running when I did `git gc`,So that means when do `git gc`, I would always stop gerrit?
Yes, or at least read-onlyIs the command`ssp -p 29418 myserver gerrit gc --all1` more safe?Yep.HTHLucathe following messages were reported bygit fsck --fullChecking object directories: 100% (256/256), done.Checking objects: 100% (96104/96104), done.error: refs/changes/54/754/meta: invalid sha1 pointer ab6cd47eaf4cd2fee0b565ce55380a0ce0749345error: refs/changes/62/762/2: invalid sha1 pointer 1ca0211a41f0d205aae4faf012e5a7e4df6701dcIt looks like your change #762 and #754 are corrupted.It is strange, checked the #762 and #754 changes, and I can still read thecontent, the diff..., was I wrong?(I just find #754 and #762 in the gerrit search box)Do you have any backups? Any replicas to recover the git refs?If not, you would have to remove the refs and run an offline reindex.HTHLuca.Ok, How to remove the refs, just `rm refs/changes/54/754/`, and refs/changes/62/762?
On Thursday, January 7, 2021 at 9:29:10 AM UTC+1 lucamilanesio wrote:Thank you Luca!On 7 Jan 2021, at 07:18, Yingchun Li <sword.l...@gmail.com> wrote:Hi, AllMy Gerrit version is 3.3.0, when I run `git gc` in ther server side, itfailed with following message:git gcfatal: bad object refs/changes/54/754/metafatal: failed to run repackAre you running ‘git gc’ while Gerrit is serving read/write traffic?If yes, you may have corrupted the repository in that way.That's maybe the cause, my server was still running when I did `git gc`,So that means when do `git gc`, I would always stop gerrit?What happens is that:1. Gerrit writes objects to disk2. gc removes the parent-less objects3. Gerrit writes the ref that points to objects to diskYou can fix this by only disallowing the gc to remove objects that have just been created.We have a quite cautious limit, I'm sure you should be able to get away with seconds:git prune --expire=1.hours.ago
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/45b15ebf-07b2-43bb-9c9d-9a4475877de8n%40googlegroups.com.
We configure all repositories to use this configuration# enable reflog
core.logallrefupdates = true
# switch off auto gc
gc.auto = 0
gc.autodetach = false
gc.autopacklimit = 0
receive.autogc = false
# do not remove old reflogs, we need them for auditing e.g. force pushes
gc.reflogexpire = never
gc.reflogexpireunreachable = never
# pack configuration
gc.packrefs = true
pack.compression = 9
pack.depth = 50
pack.indexversion = 2
pack.window = 250
repack.usedeltabaseoffset = true
# create bitmap index for performance
repack.writebitmaps = truewith this configuration we never saw corruption caused by running git gc within the 10 years we use Gerritand we do not shutdown or make read-only Gerrit while git gc is running
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/CAKSZd3Q%3DVxGTWcZWgxHOeMv5MiziCEiEnACK%3DKRZb%3DVmq%2BFteg%40mail.gmail.com.
If you have reflogexpireunreachable = never, you’ll never get rid of the 1GB BLOB, isn’t it?
# pack configuration
gc.packrefs = true
pack.compression = 9
pack.depth = 50
pack.indexversion = 2
pack.window = 250
repack.usedeltabaseoffset = true
# create bitmap index for performance
repack.writebitmaps = truewith this configuration we never saw corruption caused by running git gc within the 10 years we use Gerritand we do not shutdown or make read-only Gerrit while git gc is runningWe unfortunately did see and a few times, that’s the reason behind my suggestion.We’ve fixed lot of problems, but I am unsure if we got all of them sorted :-(P.S. You also worked on one of them, the racy-JGit problem, and the last was discovered during the test of Gerrit v3.3.