Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-08-01Add build tags to exlcude praefect testserverjmd/exclude-praefect-test-server-from-buildJohn McDonnell
RunPraefectServer is intended to be used only for testing purposes so we should exclude it from builds to avoid any logic in the file from leaking into the actual build.
2023-08-01Merge branch 'qmnguyen0711/fix-TestGetSpawnToken-flake' into 'master'karthik nayak
Fix flaky TestGetSpawnToken_CommandStats test See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6147 Merged-by: karthik nayak <knayak@gitlab.com> Approved-by: karthik nayak <knayak@gitlab.com> Reviewed-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Reviewed-by: karthik nayak <knayak@gitlab.com> Co-authored-by: Quang-Minh Nguyen <qmnguyen@gitlab.com>
2023-08-01Merge branch 'renovate/github.com-rubenv-sql-migrate-1.x' into 'master'Quang-Minh Nguyen
go: Update module github.com/rubenv/sql-migrate to v1.5.2 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6152 Merged-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Approved-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Co-authored-by: GitLab Renovate Bot <gitlab-bot@gitlab.com>
2023-08-01Fix flaky TestGetSpawnToken_CommandStats testQuang-Minh Nguyen
This test aims to test the metrics of spawn tokens. One particularly interesting metric is the `gitaly_spawn_token_waiting_length` gauge. It measures the length of the queue waiting for a spawn token. In the test, we set up two main and secondary goroutines. The spawn token parallelism is set to 1. The main goroutine acquires the goroutine first, second one in parallel follows. However, the second goroutine may not start on time, or the acquiring function hasn't been called at the time the metrics are asserted. Even after the second goroutine starts, there is a small possibility for the metric collection to run before the second goroutine lines up for the token. There is no way to get a precise signal when the second goroutine is waiting. Hence, the only solution is to poll for the metric until it changes.
2023-08-01Merge branch 'pks-commit-signatures-sha256' into 'master'Quang-Minh Nguyen
commit: Implement SHA256 support for CommitSignatures See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6156 Merged-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Approved-by: karthik nayak <knayak@gitlab.com> Approved-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Co-authored-by: Patrick Steinhardt <psteinhardt@gitlab.com>
2023-08-01Merge branch 'renovate/golang.org-x-exp-digest' into 'master'Quang-Minh Nguyen
go: Update golang.org/x/exp digest to b0cb94b See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6161 Merged-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Approved-by: karthik nayak <knayak@gitlab.com> Approved-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Co-authored-by: GitLab Renovate Bot <gitlab-bot@gitlab.com>
2023-08-01Merge branch 'wc/repo-count-metric' into 'master'Quang-Minh Nguyen
counter: Add repository counter middleware See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6071 Merged-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Approved-by: karthik nayak <knayak@gitlab.com> Approved-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Reviewed-by: Steve Xuereb <sxuereb@gitlab.com> Reviewed-by: James Fargher <jfargher@gitlab.com> Reviewed-by: Will Chandler <wchandler@gitlab.com> Reviewed-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Reviewed-by: karthik nayak <knayak@gitlab.com> Co-authored-by: Will Chandler <wchandler@gitlab.com>
2023-08-01Merge branch 'nh/fallback-to-direct-when-proxy-is-unavailable' into 'master'Justin Tobler
Fallback to 'direct' for GOPROXY when 'https://proxy.golang.org' is unavailable See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6162 Merged-by: Justin Tobler <jtobler@gitlab.com> Approved-by: Stan Hu <stanhu@gmail.com> Approved-by: Justin Tobler <jtobler@gitlab.com> Reviewed-by: Justin Tobler <jtobler@gitlab.com> Co-authored-by: Nao Hashizume <nhashizume@gitlab.com>
2023-08-01Fallback to 'direct' for GOPROXY when 'https://proxy.golang.org' is unavailableNao Hashizume
2023-07-31Merge branch '5395-feature-flag-git-merge-tree-for-resolveconflicts' into ↵Justin Tobler
'master' conflicts: Remove git2go implementation of `ResolveConflicts` Closes #5436 and #5395 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6122 Merged-by: Justin Tobler <jtobler@gitlab.com> Approved-by: John Cai <jcai@gitlab.com> Approved-by: Justin Tobler <jtobler@gitlab.com> Reviewed-by: Justin Tobler <jtobler@gitlab.com> Reviewed-by: karthik nayak <knayak@gitlab.com> Co-authored-by: Karthik Nayak <knayak@gitlab.com>
2023-07-31Merge branch 'jt-sha256-create-repo-from-bundle' into 'master'karthik nayak
repository: Refactor `CreateRepositoryFromBundle` tests See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6111 Merged-by: karthik nayak <knayak@gitlab.com> Approved-by: karthik nayak <knayak@gitlab.com> Reviewed-by: Patrick Steinhardt <psteinhardt@gitlab.com> Reviewed-by: Justin Tobler <jtobler@gitlab.com> Reviewed-by: karthik nayak <knayak@gitlab.com> Co-authored-by: Justin Tobler <jtobler@gitlab.com>
2023-07-28Merge branch 'jc/remove-squash-ff' into 'master'Will Chandler
operations: Remove SquashInGit feature flag See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6145 Merged-by: Will Chandler <wchandler@gitlab.com> Approved-by: Will Chandler <wchandler@gitlab.com> Co-authored-by: John Cai <jcai@gitlab.com>
2023-07-28go: Update golang.org/x/exp digest to b0cb94bGitLab Renovate Bot
2023-07-28operations: Remove SquashInGit feature flagJohn Cai
Now that the git implementation has been working fine for two weeks, let's remove the feature flag. Also, now that the mergeWithGit2go function is unused, we can remove that as well.
2023-07-28counter: Count repositories on startupWill Chandler
To get an estimate of the existing repositories on disk, we add a startup task to walk all configured storages and update the `gitaly_repository_count` metric with the number of repositories found. This is run in a goroutine to prevent walking a very large storage from blocking Gitaly's startup. We avoid reporting this metric to collectors until after the walker has finished to avoid having the value jump suddently. However, the walker will still race with new repository creations received while it is running and the metric will not be fully deterministic. For example: - Repo `@hashed/ff/ff/ffff...` is created immediately after Gitaly starts up and the metric is incremented. - The storage walker reaches `@hashed/ff/ff/ffff...` and increments the metric a second time. We could drop events receiving during the walk, but it's equally likely that the walker has already finished the new repo's directory before the event arrives and we would then undercount. Walking should finish relatively quickly, so this will probably not be too much of an issue in practice. The walker uses `ValidateRepository` to confirm if a directory is a git repository, so in addition to the work done by `filepath.WalkDir` we are running five stat(2) calls per repository: - The storage's root directory - The directory being checked - Its objects directory - Its refs directory - Its HEAD file - Its packed-refs file A non-repository directory would perform three `stat`s, storage, repository, and a failed check for objects. Changelog: added
2023-07-28counter: Wire up RepositoryCounter to repoutilWill Chandler
All repository creation and removal is done via `repoutil`, so hooking `RepositoryCounter` in here will allow us to track changes without dealing with the idiosyncracies of the many RPCs that may create repositories. Add a `RepositoryCounter` as a parameter to the `repoutil.Create` and `repoutil.Remove` functions and wire it up to necessary services. The exception to this is the `RemoveAll` RPC which deletes an entire storage, we use the counter directly here.
2023-07-28counter: Add RepositoryCounterWill Chandler
Gitaly currently does not expose a way to determine the number of repositories present on a storage. In a cluster an admin could query the Praefect database, but this is undocumented and is not available for non-cluster nodes. Introduce a `RepositoryCounter` to manage the new `gitaly_total_repositories_count` gauge. For our purposes object pools are considered to be separate repositories and no effort is made to associate them with their children. The metric will include the storage name and the first relevant directory of the repository path as `prefix`. The latter is included to allow admins to understand which types of repositories are present. For a standalone gitaly node `prefix` would be the first directory up from the storage, e.g. `@hashed`, `@pools`, or `@snippets`. For a Gitaly Cluster node it would be the child directory of `@cluster`, e.g. `repositories` or `pools`.
2023-07-28repository: Refactor `CreateRepositoryFromBundle` testsJustin Tobler
The tests for the `TestCreateRepositoryFromBundle` RPC use seeded repositories preventing execution during SHA256 repository testing. The tests still fail with SHA256 because the Git repository initialized by the RPC always uses the SHA1 object format. Refactor these tests to be table driven and remove seeded repositories.
2023-07-28repository: Remove unused `sanitizedError` functionJustin Tobler
In d54bd2a5, the `CreateRepositoryFromBundle` RPC was modified to no longer invoke the `sanitizedError` function, but was left even though it is now only invoked by its associated test `TestSanitizedError`. Remove this function and its test.
2023-07-28proto: Add missing documentation for `CreateRepositoryFromBundle` RPCJustin Tobler
The `CreateRepositoryFromBundle` RPC and its supporting data types do not currently have any documentation in their Protobuf definitions. Add this missing documenation.
2023-07-28storage: expose Praefect path prefixWill Chandler
We will need to reference the '@cluster' prefix when counting repositories on disk, but this is not set as a constant currently. Expose the root path used in storages and join the pool and repository paths off of that.
2023-07-28Merge branch 'qmnguyen0711/implement-cgroup-resource-watcher' into 'master'Justin Tobler
limiter: Implement Cgroup resource watchers See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6129 Merged-by: Justin Tobler <jtobler@gitlab.com> Approved-by: Justin Tobler <jtobler@gitlab.com> Reviewed-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Reviewed-by: John Cai <jcai@gitlab.com> Reviewed-by: Justin Tobler <jtobler@gitlab.com> Co-authored-by: Quang-Minh Nguyen <qmnguyen@gitlab.com>
2023-07-28Merge branch 'wc/force-ci' into 'master'Toon Claes
ci: Add variable to force pipeline to run See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6110 Merged-by: Toon Claes <toon@gitlab.com> Approved-by: Toon Claes <toon@gitlab.com> Co-authored-by: Will Chandler <wchandler@gitlab.com>
2023-07-28Merge branch 'jt-remove-git-240' into 'master'Toon Claes
Makefile: Remove Git v2.40 configuration See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6154 Merged-by: Toon Claes <toon@gitlab.com> Approved-by: Toon Claes <toon@gitlab.com> Co-authored-by: Justin Tobler <jtobler@gitlab.com>
2023-07-28Merge branch 'smh-transation-repository' into 'master'Patrick Steinhardt
Implement functionality to automatically configure repositories with transaction's quarantine See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6032 Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Reviewed-by: Patrick Steinhardt <psteinhardt@gitlab.com> Reviewed-by: Sami Hiltunen <shiltunen@gitlab.com> Reviewed-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Co-authored-by: Sami Hiltunen <shiltunen@gitlab.com>
2023-07-28Merge branch '5435-adapt-service-commit-part-2-tests-to-support-sha256' into ↵Patrick Steinhardt
'master' Migrate some more RPCs to make them SHA256 compatible See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6134 Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com> Reviewed-by: Patrick Steinhardt <psteinhardt@gitlab.com> Reviewed-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Reviewed-by: karthik nayak <knayak@gitlab.com> Co-authored-by: Karthik Nayak <knayak@gitlab.com>
2023-07-28commit: Implement SHA256 support for CommitSignaturesPatrick Steinhardt
Implement support for the SHA256 object format in the CommitSignatures RPC. Changelog: added
2023-07-28commit: Fix parsing of gpgsig fields with trailing dataPatrick Steinhardt
In order to extract commit signatures we scan the commit message for "gpgsig" fields. Starting from any line with such a prefix we then scan until we find a line that terminates the signature, e.g. an empty line. The logic to do this is buggy though as we didn't include the trailing space that separates the field name from its data. Consequentially, we currently recognize all fields that start with "gpgsig" as signature data, even if they have an arbitrary suffix like "-garbage". This suffix is instead appended to the signed commit data that we extract. Fix this bug by checking for the space. While at it, prepare the code for SHA256 support already by reformatting it a bit. Signatures in SHA256 repositories use the "gpgsig-sha256" field instead, which is how this bug was indeed found. Changelog: fixed
2023-07-28commit: Refactor CommitSignatures testsPatrick Steinhardt
Refactor CommitSignatures tests to be fully table-driven and generate their test data at runtime. This prepares us for adding SHA256 support to this RPC.
2023-07-28commit: Make `TestCountCommits` SHA256 compatibleKarthik Nayak
Since the tests in `TestCountCommits` no longer use seeded repositories, we can make them SHA256 compatible.
2023-07-28commit: Migrate `TestCountCommits` to table driven testsKarthik Nayak
The tests in `count_commits_test.go` use seeded repositories and old convention of testing. Migrate all the tests to table driven tests and get rid of seeded repositories.
2023-07-28commit: Make `TestCommitsByMessage` SHA256 compatibleKarthik Nayak
Since the tests in `TestCommitsByMessage` no longer use seeded repositories, we can make them SHA256 compatible.
2023-07-28commit: Migrate `TestCommitsByMessage` to table driven testsKarthik Nayak
The tests in `commits_by_message_test.go` use seeded repositories and old convention of testing. Migrate all the tests to table driven tests and get rid of seeded repositories.
2023-07-28catfile: Recognize SHA256 GPG signaturesPatrick Steinhardt
Commit signatures are usually denoted by a "gpgsig" field in the commit. When using the SHA256 object format though, Git uses "gpgsig-sha256" as field name instead. We do not recognize this field name in the catfile package yet and will thus fail to parse such commits. Add the logic to detect this field as well as a test to verify that we can parse such commits as expected.
2023-07-28Merge branch 'adlternative/zh-no-cgroup-linux-fix' into 'master'karthik nayak
cgroup: using a noop manager on linux without cgroup Closes #4511 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6150 Merged-by: karthik nayak <knayak@gitlab.com> Approved-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Approved-by: karthik nayak <knayak@gitlab.com> Reviewed-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Reviewed-by: karthik nayak <knayak@gitlab.com> Co-authored-by: ZheNing Hu <adlternative@gmail.com>
2023-07-28limiter: Implement Cgroup memory resource watcherQuang-Minh Nguyen
This commit implements Cgroup memory resource watcher to monitor the memory usage of the parent Cgroup. When the usage exceeds 90% of the memory limit or the cgroup is under OOM, the watcher considers it as a backoff event. We target the parent cgroup only for the sake of simplicity. Observing the memory usage of repository cgroups adds a lot of overhead. In addition, when the parent cgroup reaches its limit, all commands are affected. The impact of repository cgroup exceeding limit is local to some certain repositories.
2023-07-28limiter: Implement Cgroup CPU resrouce watcherQuang-Minh Nguyen
This commit implements Cgroup CPU research watcher for notifying CPU throttling of cgroup. When configured, the adaptive calculator polls this watcher periodically. When it returns a backoff event, the calculator adjusts the concurrency limit accordingly. Cgroup doesn't have an easy way to gauge how bad the CPU is percentage. Hence, this watcher compares the recorded total throttled time between two polls. If the throttled time exceeds 50% of the observation window, it returns a backoff event. The watcher uses `throttled_time` (CgroupV1) or `throttled_usec` (CgroupV2) stats from the cgroup manager.
2023-07-28cgroup: Implement Stats() function to collect generic cgroup metricsQuang-Minh Nguyen
This commit implements Stats() function to cgroup managers. This function collects the usage statistics of the cgroups managed by the cgroup manager. This information is fetched from cgroupfs files, especially `cpu.stat`, `memory.events`, and some `memory.*` files.
2023-07-28cgroup: Add Ready() to cgroup managerQuang-Minh Nguyen
This commit adds the Ready() function to the cgroup manager. This function is to check if the manager is configured properly and ready to use.
2023-07-28cgroup: Enhance cgroup mock setupQuang-Minh Nguyen
Cgroup testing suite has an utility to mock underlying cgroupfs files. This mocking utility hard-codes the values or accepts a very limited set of configs. This commits adds a map that allows this utility to mock custom values of files.
2023-07-28cgroup: using a noop manager on linux without cgroupZheNing Hu
Due to the lack of consideration for non-cgroup scenarios on Linux systems, Gitaly exits with the error message "unknown cgroup version", which hinders the usage for these Linux users. Therefore, using noop implementation of the cgroup manager for Linux systems without cgroup is necessary to solve this issue. Signed-off-by: ZheNing Hu <adlternative@gmail.com>
2023-07-28Merge branch 'jc/remove-merge-to-ref-in-git-ff' into 'master'Justin Tobler
Operations: Remove MergeToRefWithGit feature flag See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6153 Merged-by: Justin Tobler <jtobler@gitlab.com> Approved-by: Justin Tobler <jtobler@gitlab.com> Co-authored-by: John Cai <jcai@gitlab.com>
2023-07-27Operations: Remove MergeToRefWithGit feature flagJohn Cai
Now that the git implemenmtation of MergeToRef has been running for 3 weeks without issue, let's remove the feature flag.
2023-07-27Makefile: Remove Git v2.40 configurationJustin Tobler
Now Git v2.41 is the default, remove Makefile configuration to build and install Git v2.40.
2023-07-27ci: Add variable to force pipeline to runWill Chandler
For debugging CI it is often useful to be able to run a pipeline outside of the context of an MR. The GitLab project has a `FORCE_GITLAB_CI` variable that forces a pipeline to run even when the workflow requirements are not met. Add an equivalent `FORCE_GITALY_CI` variable to allow us to manually run pipelines as needed.
2023-07-27Update changelog for 15.11.13GitLab Release Tools Bot
[ci skip]
2023-07-27go: Update module github.com/rubenv/sql-migrate to v1.5.2GitLab Renovate Bot
2023-07-27Merge branch 'kn-user-create-branch' into 'master'John Cai
operations: make UserCreateBranch SHA256 compatible See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6109 Merged-by: John Cai <jcai@gitlab.com> Approved-by: John Cai <jcai@gitlab.com> Reviewed-by: Sami Hiltunen <shiltunen@gitlab.com> Co-authored-by: Karthik Nayak <knayak@gitlab.com>
2023-07-27commit: Make `TestCommitIsAncestor` SHA256 compatibleKarthik Nayak
Since the tests in `TestCommitIsAncestor` no longer use seeded repositories, we can make them SHA256 compatible.
2023-07-27commit: Migrate `TestCommitIsAncestor` to table driven testsKarthik Nayak
The tests in `isancestor_test.go` use seeded repositories and old convention of testing. Migrate all the tests to table driven tests and get rid of seeded repositories.