From 20b9ce59070509ae1f0765f1be7f3561498f1c64 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Mon, 7 Dec 2020 12:03:13 -0800 Subject: [PATCH] Put jgit pack settings in jgit.config We were setting these values in gerrit.config but it isn't clear if these now need to go in jgit.config instead. I've tried to clarify with upstream maintainers as the documentation is quite confusing. While we wait for clarification why don't we just set the values in both files to ensure we are covered. This converts jgit.config to a jinja2 template so that we can use the variable number of pack files setting. Change-Id: I70c1e6b738ed6e9fdb72d86e7cf3fb8cfecf1323 --- playbooks/roles/gerrit/files/jgit.config | 2 -- playbooks/roles/gerrit/tasks/main.yaml | 4 ++-- playbooks/roles/gerrit/templates/jgit.config.j2 | 6 ++++++ 3 files changed, 8 insertions(+), 4 deletions(-) delete mode 100644 playbooks/roles/gerrit/files/jgit.config create mode 100644 playbooks/roles/gerrit/templates/jgit.config.j2 diff --git a/playbooks/roles/gerrit/files/jgit.config b/playbooks/roles/gerrit/files/jgit.config deleted file mode 100644 index bb705c7586..0000000000 --- a/playbooks/roles/gerrit/files/jgit.config +++ /dev/null @@ -1,2 +0,0 @@ -[receive] - autogc = false diff --git a/playbooks/roles/gerrit/tasks/main.yaml b/playbooks/roles/gerrit/tasks/main.yaml index 29abfe336c..1c4f244a60 100644 --- a/playbooks/roles/gerrit/tasks/main.yaml +++ b/playbooks/roles/gerrit/tasks/main.yaml @@ -88,8 +88,8 @@ when: gerrit_replication is defined - name: Write Gerrit JGit config - copy: - src: jgit.config + template: + src: jgit.config.j2 dest: "{{ gerrit_site_dir }}/etc/jgit.config" owner: "{{ gerrit_user_name }}" group: "{{ gerrit_user_name }}" diff --git a/playbooks/roles/gerrit/templates/jgit.config.j2 b/playbooks/roles/gerrit/templates/jgit.config.j2 new file mode 100644 index 0000000000..a2bc4e4c02 --- /dev/null +++ b/playbooks/roles/gerrit/templates/jgit.config.j2 @@ -0,0 +1,6 @@ +[core] + packedGitOpenFiles = {{ gerrit_packed_git_open_files }} + packedGitLimit = 400m + packedGitWindowSize = 16k +[receive] + autogc = false