Why does it occur ${repo}/objects/pack/tmp_pack* ?

1,846 views
Skip to first unread message

hanji wang

unread,
Aug 10, 2022, 5:39:36 AM8/10/22
to Repo and Gerrit Discussion
Two replica servers, the same repo.
Server A: 222G
Server B: 6.9T
There are many more ${repo}/objects/pack/tmp_pack* files in server B

tmp_pack.png

Sven Selberg

unread,
Aug 10, 2022, 6:38:41 AM8/10/22
to Repo and Gerrit Discussion
On Wednesday, August 10, 2022 at 11:39:36 AM UTC+2 whzsanw...@gmail.com wrote:
Two replica servers, the same repo.
Server A: 222G
Server B: 6.9T
There are many more ${repo}/objects/pack/tmp_pack* files in server B
IIUC this is what happens when `git gc` (or `git repack' really) are interrupted (by the OOM killer, "No space left on device" or similar).
You could check syslog to see if OOM is the culprit or check if your disk-capacity is close to the limit on Server B (there could of course be other reasons why `git repack` is interrupted).
You could try to run
$ git repack -a -d -b
$ git prune
And see if that helps or if the repack fails with some descriptive message.


tmp_pack.png

Matthias Sohn

unread,
Aug 10, 2022, 7:34:06 AM8/10/22
to hanji wang, Repo and Gerrit Discussion
These files could be remainders of cancelled fetch or push requests.
Pack files are created as a temporary file which is renamed atomically when the transport command finishes.
This ensures that git (and jgit) doesn't look at partial pack files which aren't committed yet.

Valid committed pack files are named like
objects/pack/pack-<sha1>.pack
and are accompanied by an index file
objects/pack/pack-<sha1>.idx
and optionally a bitmap index file
objects/pack/pack-<sha1>.bitmap

Do you run git gc regularly on all git repositories of your replicas ?

-Matthias

Sven Selberg

unread,
Aug 10, 2022, 8:03:22 AM8/10/22
to Repo and Gerrit Discussion
On Wednesday, August 10, 2022 at 1:34:06 PM UTC+2 Matthias Sohn wrote:
On Wed, Aug 10, 2022 at 11:39 AM hanji wang <whzsanw...@gmail.com> wrote:
Two replica servers, the same repo.
Server A: 222G
Server B: 6.9T
There are many more ${repo}/objects/pack/tmp_pack* files in server B

tmp_pack.png

These files could be remainders of cancelled fetch or push requests.
Pack files are created as a temporary file which is renamed atomically when the transport command finishes.
This ensures that git (and jgit) doesn't look at partial pack files which aren't committed yet.

Could it be that autogc isn't disabled?
--- /home/$MIRROR_GERRIT_USER/.gitconfig
[receive]
        autogc = false
---

Martin Fick

unread,
Aug 10, 2022, 10:07:34 AM8/10/22
to hanji wang, Repo and Gerrit Discussion
On 8/10/22 3:39 AM, hanji wang wrote:
> Two replica servers, the same repo.
> Server A: 222G
> Server B: 6.9T
> There are many more ${repo}/objects/pack/tmp_pack* files in server B


I believe tmp_pack files are create by git (not Gerrit) during a fetch,
and if the fetch is interrupted, it can leave them behind. So perhaps
you have some cron job that is not completing that is leaving those behind?

-Martin



Reply all
Reply to author
Forward
0 new messages