Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-19424

Git shallow clones and fetches are slow on Bitbucket versions running with Git 2.43.x, 2.44.x, and 2.45.x.

XMLWordPrintable

      Summary

      Bitbucket versions running Git 2.43.x, 2.44.x, and 2.45.x on the Bitbucket server might encounter a slow shallow clone(--depth) issue and slow fetches because of the changes introduced in Git version 2.43 and later.

      More info regarding this Git version that's causing this issue can be found here https://lore.kernel.org/git/Zjk9eH9e4fByGG9Z@nand.local/T/#m5848151d6c4b3fbd4c3439c4459bd8a7cd3d796d

      This is reproducible on Data Center: YES

      Steps to Reproduce

      • Set up Bitbucket Data center that supports Git 2.43.x, 2.44.x, and 2.45.x
      • Setup the $BITBUCKET_HOME/shared with NFS share(when on local Mount the slowness is not so evident)
      • Try bare clone(git clone {}bare{-}{}) or git fetch with (-depth) option
      • Clones are fetches are slow on the Enumerating objects or pack-objects phase

      Expected Results

      Clone or Fetch speeds on Bitbucket Server run Git 2.43.x, 2.44.x, and 2.45.x is similar to Git version 2.42.x or lower

      Actual Results

      Clones and fetches take 2x the time or even more depending on the structure of the Repository due to the changes to Git on version 2.43.x, 2.44.x, and 2.45.x

      Bitbucket profiler logs will show a lot of time spent on git pack-objects operation when compared to the previous version of Git

      2024-05-10 04:42:26,304 | git-hook:thread-2 | 48033OOGx245x15173x2
      [2218806.8ms] - git hook: process callback(e1d7737c20e79484efe4-1)
       [2218800.7ms] - git: git-pack-objects hook
        [2218771.8ms] - cache:miss [b251a71999d4d9adf891172fe2616e568c05f4d87ac68ae48df33ef5356112d5]
         [518357.8ms] - git pack-objects --revs --thin --stdout --progress --delta-base-offset
      

      Workaround

      To prevent experiencing Git Shallow clone slowness issues on the Bitbucket Server, it's advisable to refrain from using Git versions 2.43.x, 2.44.x, and 2.45.x or later on the Bitbucket Server this is also mentioned on the bitbucket Supported Platforms page

      If any Git slowness issues arise after upgrading Git to Git 2.43.x, 2.44.x, and 2.45.x on the Bitbucket server, downgrading to Git version 2.42.x or lower which is supported by your Bitbucket version should resolve the slowness issue.

      The Git Shallow clone slowness issue is fixed in Git version 2.46.x, which is supported on the following Bitbucket versions >= 8.9.19, 9.2.0, 9.1.1, and 8.19.9. To resolve the issue, you can upgrade to any of these Bitbucket versions and use Git 2.46.x.

      Fix Notes

      We still do not recommend using Git 2.43.x, 2.44.x, and 2.45.x with the fixed Bitbucket versions listed above.  The fix applied here is to provide support for Git 2.46.x, which does not have the slowness issue.

              mgoyal2@atlassian.com Manish
              5338c0aa34f9 Danny Samuel
              Votes:
              3 Vote for this issue
              Watchers:
              33 Start watching this issue

                Created:
                Updated:
                Resolved: