Skip to content
Snippets Groups Projects
This project is mirrored from https://gitlab.com/gitlab-org/gitaly.git. Pull mirroring updated .
  1. Sep 03, 2021
    • Sami Hiltunen's avatar
      Workaround Rails filesystem ID tests in Praefect · 2e30806c
      Sami Hiltunen authored
      Rails tests configure Praefect in front of the tests that exercise
      the Rugged direct git access code. As Praefect is now deriving the
      filesystem IDs from the names of the virtual storages, the filesystem
      id checks fail and thus the test fail. This is not a problem in practice
      as one wouldn't use rugged in a real-world setup with Praefect. This
      commit worksaround the tests by returning the filesystem ID from the
      Gitaly node if a virtual storage has only one Gitaly node configured.
      This matches the setup the tests use and thus pass them. The workaround
      and the filesystem ID code can be removed in 15.0 once the rugged patches
      and NFS support are dropped.
      2e30806c
    • Sami Hiltunen's avatar
      Derive virtual storage's filesystem id from its name · add378c8
      Sami Hiltunen authored
      Gitaly storages contain a UUID filesystem ID that is generated by
      the Gitaly for each of its storages. The ID is used to determine
      which storages can be accessed by Rails directly when rugged patches
      are enabled and to see whether two different storages point to the same
      directory when doing repository moves.
      
      When repository moves are performed, the worker first checks whether the
      repository's destination and source storage are the same. If they are, the
      move is not performed. The check is performed by comparing the filesystem
      IDs of the storages'. As Praefect is currently routing the server info RPC
      to a random Gitaly node, the filesystem ID can differ between calls as each
      of the Gitalys have their own ID. This causes the repository moving worker
      to occasionally delete repositories from the virtual storage as it receives
      two different IDs on sequential calls.
      
      The filesystem ID can identify cases when two storages refer to the same
      directory on a Gitaly node as the id is stored in a file in the storage.
      This is not really possible with Praefect. The storage's are only identified
      by the virtual storage's name. If the name changes, we can't really correlate
      the ID between the different names as Praefect would consider them different
      storages. Praefect also supports multiple virtual storages so it's not possible
      to generate a single ID and use it for all of the virtual storages. Given this,
      the approach taken here is to derive a stable filesystem ID from the virtual
      storage's name. This guarantees calls to a given virtual storage always return
      the same filesystem ID.
      
      Configuring two storages that point to the same filesystem should be considered
      an invalid configuration anyway. Historically, there's been cases when that has
      been done for plain Gitalys. This is not done for Praefect and wouldn't work as
      Praefect wouldn't find the repositories with an alternative virtual storage name.
      With that in mind, we don't have to consider the case where two virtual storages
      of different names point to the same backing Gitaly storages.
      
      The use cases for the filesystem ID seem to be limited and we may be able to
      remove it in the future once the rugged patches are removed.
      
      Changelog: fixed
      add378c8
  2. Sep 02, 2021
  3. Sep 01, 2021
    • Patrick Steinhardt's avatar
      coordinator: Only schedule replication for differing error states · ed5ab9bb
      Patrick Steinhardt authored
      When finalizing a transaction, we always schedule replication jobs in
      case the primary has returned an error. Given that there are many RPCs
      which are expected to return errors in a controlled way, e.g. if a
      commit is missing, this causes us to create replication in many contexts
      where it's not necessary at all.
      
      Thinking about the issue, what we really care for is not whether an RPC
      failed or not. It's that primary and secondary nodes behaved the same.
      If both primary and secondaries succeeded, we're good. But if both
      failed with the same error, then we're good to as long as all
      transactions have been committed: quorum was reached on all votes and
      nodes failed in the same way, so we can assume that nodes did indeed
      perform the same changes.
      
      This commit thus relaxes the error condition to not schedule replication
      jobs anymore in case the primary failed, but to only schedule
      replication jobs to any node which has a different error than the
      primary. This has both the advantage that we only need to selectively
      schedule jobs for disagreeing nodes instead of targeting all
      secondaries and it avoids scheduling jobs in many cases where we do hit
      errors.
      
      Changelog: performance
      (cherry picked from commit 73839029)
      ed5ab9bb
  4. Aug 31, 2021
  5. Aug 17, 2021
  6. Aug 03, 2021
  7. Aug 02, 2021
  8. Jul 28, 2021
  9. Jul 22, 2021
  10. Jul 21, 2021
  11. Jul 20, 2021
  12. Jul 15, 2021
  13. Jul 14, 2021
  14. Jul 13, 2021
  15. Jul 12, 2021
    • James Fargher's avatar
      Remove feature gitaly_fetch_internal_remote_errors · ffbd9a31
      James Fargher authored
      Since FetchInternalRemote has been inlined into ReplicateRepository we
      no longer need to make this RPC errors more verbose.
      ffbd9a31
    • Zeger-Jan van de Weg's avatar
      Merge branch 'ps-code-style-fix' into 'master' · a8d42fb6
      Zeger-Jan van de Weg authored
      Fix various static lint issues
      
      See merge request gitlab-org/gitaly!3666
      a8d42fb6
    • Zeger-Jan van de Weg's avatar
      Merge branch 'smh-perform-lazy-failovers' into 'master' · 87104617
      Zeger-Jan van de Weg authored
      Perform failovers lazily
      
      Closes #3207
      
      See merge request gitlab-org/gitaly!3543
      87104617
    • Jacob Vosmaer's avatar
      Add StreamRPC library code · 8a925b40
      Jacob Vosmaer authored
      Changelog: other
      8a925b40
    • Pavlo Strokov's avatar
      Standardise package aliases · f6be3b55
      Pavlo Strokov authored
      It is not common to use snake case names for packages
      and package aliases in Go.
      The change renames aliases to a preferred single word name.
      We also use 'gitaly' prefix for the project-defined packages
      that clashes with standard or 3-rd party package names.
      f6be3b55
    • Pavlo Strokov's avatar
      Remove unused declarations · 74514560
      Pavlo Strokov authored
      Some functions, types, fields and other variables are not
      used. There is no reason to keep them and support.
      Some of them became redundant starting from declaration
      and some after the code changes.
      74514560
    • Pavlo Strokov's avatar
      Redundant condition check in the for loop · a6a4d567
      Pavlo Strokov authored
      The done variable is never assigned any value, so
      the condition always evaluates into true.
      a6a4d567
    • Pavlo Strokov's avatar
      Fix instantiation of the structs with fields assignment · a20f8bc8
      Pavlo Strokov authored
      If struct has a list of fields declared the values for
      those fields could be assigned during struct instance creation
      by providing values in the same order as the fields are declared
      or in any order if field names are used to assign the values.
      The preferred way is to use a field name assigment as it is less
      error prone if you define a new field in the middle of the struct
      and as well more readable as you see the list of the initialized
      fields.
      a20f8bc8
    • Sami Hiltunen's avatar
      Export unavailable repositories metric · 12061b1c
      Sami Hiltunen authored
      The current read-only repository count metric describes unavailable
      repositories rather than read-only repositories. We have to keep the
      name for backwards compatibility as some alerting rules and dashboards
      depend on it. To make it possible to migrate to a more accurate metric
      later, this commit adds another metric on the side with more accurate
      name and description.
      12061b1c