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
2022-03-18housekeeping: Limit concurrency of OptimizeRepository to 1jc-limit-optimize-repository-concurrencyJohn Cai
OptimizeRepository should not run concurrently. It could lead to a data race that ends up deleting objects incorrectly. In order to limit the concurrency to 1, we can use a simple mutex. This change also reorganizes the code so that we can test it more easily by swapping in an implementation of optimizeRepository. Changelog: changed
2022-03-17Merge branch 'update-danger-config-2' into 'master'Toon Claes
Update Danger config to use new type & subtype labels See merge request gitlab-org/gitaly!4387
2022-03-16Merge branch 'fix-error-handling-in-GetTreeEntries' into 'master'John Cai
Fix error handling in GetTreeEntries See merge request gitlab-org/gitaly!4414
2022-03-16Fix error handling in GetTreeEntriesHordur Freyr Yngvason
2022-03-16Merge branch 'pks-housekeeping-improved-metrics' into 'master'John Cai
housekeeping: Improve visibility into performed maintenance tasks Closes #4103 See merge request gitlab-org/gitaly!4406
2022-03-16Update changelog for 14.8.4GitLab Release Tools Bot
[ci skip]
2022-03-16Update VERSION filesv14.9.0-rc5GitLab Release Tools Bot
[ci skip]
2022-03-16Merge branch 'pks-git-v2.35.1.gl1-more-fetch-speedups' into 'master'Patrick Steinhardt
Makefile: Add more patches to speed up git-fetch(1) to v2.35.1.gl1 Closes #4104 See merge request gitlab-org/gitaly!4408
2022-03-16Merge branch 'brodock/create-repository-from-url-mirror' into 'master'James Fargher
CreateRepositoryFromURL switch to mirror flag See merge request gitlab-org/gitaly!4378
2022-03-15Repository: allow opting for --mirror for CreateRepositoryFromURLGabriel Mazetto
Changelog: added
2022-03-15Update `gitlab-dangerfiles` to 2.11.0update-danger-config-2Rémy Coutable
Signed-off-by: Rémy Coutable <remy@rymai.me>
2022-03-15Remove Danger rule that's part of `gitlab-dangerfiles`Rémy Coutable
This rule was introduced in https://gitlab.com/gitlab-org/ruby/gems/gitlab-dangerfiles/-/releases/v2.1.0 Signed-off-by: Rémy Coutable <remy@rymai.me>
2022-03-15Update Danger config to use new type & subtype labelsRémy Coutable
Signed-off-by: Rémy Coutable <remy@rymai.me>
2022-03-15Use the changelog rule from `gitlab-dangerfiles`Rémy Coutable
The rule was introduced in https://gitlab.com/gitlab-org/ruby/gems/gitlab-dangerfiles/-/releases/v2.9.0 Signed-off-by: Rémy Coutable <remy@rymai.me>
2022-03-15Use latest `gitlab-dangerfiles` featuresRémy Coutable
Use features introduced in https://gitlab.com/gitlab-org/ruby/gems/gitlab-dangerfiles/-/releases/v2.6.0 Signed-off-by: Rémy Coutable <remy@rymai.me>
2022-03-15Use the shared `danger-review` job definitionRémy Coutable
Signed-off-by: Rémy Coutable <remy@rymai.me>
2022-03-15Merge branch 'pks-housekeeping-prune-with-grace-period' into 'master'John Cai
housekeeping: Don't prune recent objects See merge request gitlab-org/gitaly!4410
2022-03-15housekeeping: Don't prune recent objectsPatrick Steinhardt
When running git-gc(1), Git automatically executes git-prune(1) with a grace period of two weeks: only when objects are older than that grace period will they be pruned. This is really important to fix a race condition with concurrent commands, which all will first write new objects into the repository before making them reachable via a ref update. This means that there is a brief period between writing the new objects and making them reachable. If objects would be pruned without a grace period, it could kick in right before updating the references and thus cause repository corruption. The two-weeks grace period bridges this gap by giving enough head room to finish the transaction. With the recent introduction of the heuristics-based OptimizeRepository RPC we have also started to use git-prune(1). The assumption was that the two-weeks grace period was the default of git-prune(1), but as it turns out it is only the default of git-gc(1). So because we are now running git-prune(1) without any parameters, we accidentally started to delete all unreachable objects, even if they had just been created. Curiously, this bug only started to surface as we were migrating Rails to use OptimizeRepository. Seemingly, because we previously only were executing the RPC as part of our nightly job, the logic didn't trigger in the right moment and thus never caused any (known) problems. Still, this is a serious bug. Fix this issue by passing `--expire=two.weeks.ago` to git-prune(1). Changelog: fixed
2022-03-15Merge branch 'pks-repository-creation-fix-indeterministic-voting' into 'master'John Cai
repository: Fix indeterministic voting when creating new repos Closes #4100 See merge request gitlab-org/gitaly!4402
2022-03-15Merge branch 'pks-user-squash-fix-error-code-with-improved-error-handling' ↵Sami Hiltunen
into 'master' operations: Fix wrong error code when UserSquash conflicts See merge request gitlab-org/gitaly!4403
2022-03-15Makefile: Add more patches to speed up git-fetch(1) to v2.35.1.gl1pks-git-v2.35.1.gl1-more-fetch-speedupsPatrick Steinhardt
The rollout of Git v2.35.1.gl1 is currently blocked in production because we have discovered various repositories where broken references cause errors with the new version. So right now, the new Git version is still disabled in all deployments, also because the feature flag is default-disabled, as well. This blockade gives us a last chance to sneak in some patches for Git v2.35.1.gl1 which have landed in `next` meanwhile. Missing this chance would mean that we'd have to wait a few more releases until we can land another revision, or otherwise we'd be running with three different Git versions in production at the same time: the current Git v2.33.1.gl3, then Git v2.35.1.gl1, and finally the new version we'd be about to introduce. So let's take this chance and slightly bend the rollout process of new Git versions. Apply commits from 60aae8731c (Merge branch 'ps/fetch-mirror-optim' into next, 2022-03-08) into Git v2.35.1.gl1. These patches optimize fetches by: - Patch 1/5 starts to look up up "want" lines via the commit-graph, resulting in a 7% speedup. - Patch 2/5 avoids repeated lookups of commits that were only required when writing to FETCH_HEAD, providing a 8% speedup. - Patches 3-5/5 start to skip reading packed-refs when searching for symbolic refs in the context of a fetch. This provides a 13% speedup. All benchmarks have been performed in www-gitlab-com. Changelog: performance
2022-03-15housekeeping: Track what kind of repacks OptimizeRepository doespks-housekeeping-improved-metricsPatrick Steinhardt
With OptimizeRepository becoming our new RPC which performs all repository maintenance in one place it's harder to tell what exactly is going on without proper metrics. One bit of information that gets lost is whether repacks are incremental or full repacks, which is quite an important distinction due to the impact on latency. Expose this information both via logs and via Prometheus to keep better track of it. While at it, alos exxpose information about whether we are writing bitmaps or not. Changelog: added
2022-03-15housekeeping: Expose pruned stale files via Prometheus metricPatrick Steinhardt
Expose the number of stale files we have pruned via a Prometheus metric so that it's easier to see what kinds of garbage we frequently need to clean up. Changelog: added
2022-03-15housekeeping: Generalize counter for pruned empty directoriesPatrick Steinhardt
We expose a Prometheus counter that is counting how many empty directories we have pruned. This is a broader concept in our housekeeping code, where we also prune other kinds of stale files. Generalize the counter into a counter vector such that we can reuse the same counter for all the different types of data we prune. While this breaks the metric in case it was used anywhere, there are no references to this counter across the complete GitLab group. Furthermore, we haven't ever guaranteed backwards compatibility for metrics anyway. Changelog: changed
2022-03-15housekeeping: Move global Prometheus metric into managerPatrick Steinhardt
While we have a central manager component which is supposed to hold all state related to housekeeping, we missed to migrate one of our metrics into it. Migrate it to get rid of one more global variable.
2022-03-15housekeeping: Log number of pruned ref dirs with other cleanupsPatrick Steinhardt
Because we may be deleting files which cause reference directories to become empty, pruning of empty reference directories needs to happen last in our housekeeping tasks. Because of this we also don't log info about pruned references in the log message which reports all the other removals. Refactor the code to return the number of pruned empty reference dirs from `removeRefEmptyDirs()` such that we can log them in the calling function with all the other cleanups.
2022-03-15housekeeping: Inline subtests which test pruning of specific filesPatrick Steinhardt
The test which verifies that we correctly prune specific files is using a subfunction to execute subtests, which makes the test hard to extend. Refactor it by inlining the subtests.
2022-03-15ci: Run Coverage job as unprivileged userPatrick Steinhardt
In 889450266 (ci: Run tests as unprivileged user, 2022-01-13) we have converted tests to run as unprivileged user. Back then we forgot to also adjust the Coverage job though, which is still running as a privileged user. Convert the job to also run tests unprivileged. This fixes an upcoming test failure we're about to introduce where housekeeping tasks remove a file that it shouldn't be able to because of a lack of permissions.
2022-03-15repository: Fix indeterministic voting when creating new repospks-repository-creation-fix-indeterministic-votingPatrick Steinhardt
When creating repositories we use transactional voting to determine that the repositories have been created the same on all nodes part of the transaction. This voting happens after we have seeded the repository, and the vote is computed by walking through the repository's directory and hashing all its files. We need to be careful though to skip files which we know to be indeterministic: - FETCH_HEAD may contain URLs which are different for each of the nodes. - Object packfiles contained in the object database are not deterministic, mostly because it may use multiple threads to compute deltas. Luckily, we do not have to rely on either of both types of files in order to ensure that the user-visible state of the repository is the same, so we can indeed just skip them. While we already have the logic to skip these files, this logic didn't work alright because we embarassingly forgot to actually return `fs.SkipDir` in case we see the object directory. So even though we thought we skipped these files, in reality we didn't. This bug has been manifesting in production in form of CreateFork, which regularly fails to reach quorum at random on a subset of nodes. The root cause here is that we use git-clone(1) to seed repository contents of the fork, which triggers exactly the case of indeterministic packfiles noted above. So any successful CreateFork RPC call really only succeeded by pure luck. Fix this issue by correctly skipping over "object" directories. While at it, fix how we skip over FETCH_HEAD by returning `nil`: it's a file and not a directory, so it doesn't make much sense to return `fs.SkipDir`. Changelog: fixed
2022-03-15Merge branch 'nanmu42-update-head' into 'master'Toon Claes
repository: Add updateHeadFromBundle in CreateRepositoryFromBundle Closes #4086 See merge request gitlab-org/gitaly!4401
2022-03-15repository: Add updateHeadFromBundle in CreateRepositoryFromBundleLI Zhennan
2022-03-14Update changelog for 14.8.3GitLab Release Tools Bot
[ci skip]
2022-03-14Merge branch 'smh-extend-invalid-source-repository' into 'master'James Fargher
Extend invalid metadata deletion logic to repos existin on target Closes #4083 See merge request gitlab-org/gitaly!4396
2022-03-11operations: Fix wrong error code when UserSquash conflictspks-user-squash-fix-error-code-with-improved-error-handlingPatrick Steinhardt
With the new improved error hadnling in UserSquash we're now returning errors in some cases where we previously didn't. One of those cases is when the rebase performed during the squash results in a merge conflict. While it is correct to return an error in this case, we're using an Internal error code for this case, which indicates that Gitaly is to blame instead of the parameters which have been passed by the user. Fix the error code to instead be FailedPrecondition. This error code is special-cased by our monitoring infrastructure to not raise any alerts. Note that this change is only fixing issues with monitoring: Rails handles the error alright by inspecting the error details instead of the error code. Changelog: fixed
2022-03-10Update VERSION filesv14.9.0-rc4GitLab Release Tools Bot
[ci skip]
2022-03-10Merge branch 'jc-user-rebase-structured-errors-proto' into 'master'John Cai
proto: Add structured error types for UserRebaseCofirmable See merge request gitlab-org/gitaly!4382
2022-03-10proto: Add structured error types for UserRebaseCofirmableJohn Cai
This commit introduces these changes by creating a new UserRebaseConfirmableError Protobuf message which contains all potential structured errors we want to return from the UserSquash RPC. Changelog: added
2022-03-10Merge branch 'smh-no-implicit-pool-creation' into 'master'Toon Claes
Disable implicit pool creation on link behind a feature flag See merge request gitlab-org/gitaly!4397
2022-03-09Update changelog for 14.7.5GitLab Release Tools Bot
[ci skip]
2022-03-09Merge branch 'pks-doc-git-execution-environments' into 'master'Patrick Steinhardt
doc: Document supported Git execution envinronments See merge request gitlab-org/gitaly!4392
2022-03-09Merge branch 'pks-user-squash-structured-errors' into 'master'John Cai
operations: Implement structured errors for UserSquash See merge request gitlab-org/gitaly!4374
2022-03-09doc: Document supported ways to access Git installationsPatrick Steinhardt
Document the different ways to access Git installations supported by Gitaly. Most importantly, this also documents the way our new bundled Git binaries work and why they were introduced.
2022-03-09Update VERSION filesv14.9.0-rc3GitLab Release Tools Bot
[ci skip]
2022-03-09Merge branch 'add-git2go-squash' into 'master'Patrick Steinhardt
Add squash parameter to git2go merge See merge request gitlab-org/gitaly!4241
2022-03-09Merge branch 'jc-fix-cgroups-memory-race' into 'master'Patrick Steinhardt
cgroups: Remove paths field See merge request gitlab-org/gitaly!4398
2022-03-09Merge branch 'jc-create-repo-default-branch' into 'master'Patrick Steinhardt
repository: allow CreateRepository to take default_branch See merge request gitlab-org/gitaly!4385
2022-03-08cgroups: Remove paths fieldjc-fix-cgroups-memory-raceJohn Cai
The paths field on the CgroupV1Manager was being accessed concurrently, leading to a panic. However, this field is not actually used by anything. Fix this issue by removing the field. Changelog: fixed
2022-03-08Disable implicit pool creation on link behind a feature flagsmh-no-implicit-pool-creationSami Hiltunen
This commit adds a feature flag to disable the implicit pool creation when joining a repository to a non-existent object pool. It looks like this behavior is not needed given Rails should create the object pool prior to considering it ready for joining. Disabling this behavior makes it easier to handle pools in Praefect as Praefect needs to create metadata records for all of the repositories. This implicit behavior might create a repository without Praefect's knowledge. Special handling would be required for this particular RPC only, so let's see if we can remove the behavior rather than implement it in Praefect.
2022-03-07git2go: Add squash parameter to MergeCommandPiotr Stankowski
This change adds support for squashing in gitaly-git2go merge. This will allow developing new RPC for squash that would be more optimized, and wouldn't have to use rebase before performing merge. We simply use the same strategy as for merge, the only difference is that we set only one parent to the merge commit. Changelog: added
2022-03-07git2go: Add optional Committer to MergeCommandPiotr Stankowski
Squash commits in GitLab use different committer and author. Committer is the user that merges, and author is the user that created the MR. As we want to add squashing to this command, we have to make sure that we support Committer* arguments as well. Committer variables are optional, author data is used when they are empty. That way this change is backward compatible. However, if at least one of Committer* variables are set, all of them have to be.