Skip to content
Snippets Groups Projects
  1. Jan 29, 2025
  2. Jan 28, 2025
  3. Jan 27, 2025
  4. Jan 24, 2025
    • Olivier Campeau's avatar
      Bundle-uri capability: Only advertise when bundle exist · f4d6f721
      Olivier Campeau authored
      When a client performs a git-clone (SSH or Smarthttp)
      Gitaly instructs the `git-upload-pack` command to
      systematically advertise the bundle-uri capability.
      
      This situation causes the Git client to request a
      bundle-uri even when one does not exists, thus adding
      unnecessary latency to the overall `clone` operation.
      It also makes it hard to properly monitor the usage
      of bundle-uri by clients; we can't correlate a request
      for bundle-uri with an actual usage of it.
      
      The proposed changes have the `git-upload-pack` command
      advertise bundle-uri only when a bundle exists for the
      given repository.
      
      More context:
      
      For SSH, this change does not provide much benefit since
      the whole packfile negociation flow is performed on a single
      connection. In other words, the flow starts when the client
      starts the upload-pack service, and it ends when the client
      received all the objects it needed.
      
      For SmartHTTP, however, this is different. Each request/command
      sent by the client (`ls-refs`, `bundle-uri`, `fetch`) is sent
      on different, stateless, RPC calls. There is no way to know
      what command the client is sending to the git-upload-pack process
      until that process is actually started, which means that the Git
      config injected into the process must be computed in advance for
      every request; this implies computing the SignedURL of the bundle
      if it exist. By advertising `bundle-uri` capability only
      when a bundle exists for the given repository, we make sure
      the client won't send a `bundle-uri` command if no bundle exist.
      
      For SmartHTTP it not only reduces by 1 the number of round-trip
      request and the number of Git config computation, but it also
      makes it easier to monitor the use of `bundle-uri` feature, since
      we can be sure that when a client sends the `bundle-uri` command,
      it is because:
      1. A bundle exists
      2. The server advertised the capability
      3. The client support the capability
      
      References:
      #6572
      f4d6f721
    • Olivier Campeau's avatar
      Merge branch 'rename-bundle-manager' into 'master' · e8cfb90b
      Olivier Campeau authored
      Rename bundleManager to bundleURIManager
      
      See merge request !7573
      
      
      
      Merged-by: default avatarOlivier Campeau <ocampeau@gitlab.com>
      Approved-by: default avatarToon Claes <toon@gitlab.com>
      Approved-by: default avatarEric Ju <eju@gitlab.com>
      Verified
      e8cfb90b
    • Olivier Campeau's avatar
      Rename bundleManager to bundleURIManager · efc643cb
      Olivier Campeau authored
      The name of the bundle URI manager is inconsistent
      across the program and in some part not very
      descriptive.
      
      The bundle URI manager is now renamed to
      `bundleURIManager`.
      
      References:
      
      This commit addresses the following comment:
      !7542 (comment 2298693589)
      efc643cb
    • Mustafa Bayar's avatar
      recovery: Fix WAL entry tar extraction path · 0acb1770
      Mustafa Bayar authored
      We download the archived WAL entry, extract it to a temporary dir and
      then finally move it to the partition's log directory. Currently this
      results in repeated LSN number in the final path such as:
      "/.../+gitaly/partitions/d4/73/2/wal/0000000000005/0000000000005/".
      
      This happens because we are extracting the tar into a path such as
      "/tempDirectory/0000000000005" but the tar file itself also contains
      the directory information such as:
      
      ➜  tar -tvf 0000000000005.tar
      drwxrwsrwx  0 git    git         0 Jan 22 12:28 0000000000005/
      -rw-rw-rw-  0 git    git        41 Jan 22 12:28 0000000000005/1
      -rw-rw-rw-  0 git    git       830 Jan 22 12:28 0000000000005/MANIFEST
      
      And then finally we move it to its final destination in log with path
      like "../wal/0000000000005" using os.Rename(srcPath, destPath), which
      then results in final path with repeated LSN number.
      
      Changes in this MR:
      - Extracted the tar into a staging directory and then validated that
      the log entry exists at the correct path. Afterwards passed the path
      of the log entry directly to the log manager which fixes the issue.
      - Update unit tests to use realistic tar file structure.
      0acb1770
  5. Jan 23, 2025
  6. Jan 22, 2025
  7. Jan 21, 2025
  8. Jan 20, 2025
  9. Jan 18, 2025
  10. Jan 17, 2025
  11. Jan 16, 2025
Loading