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-09-20backup: Write backup manifest filesbackup_manifestsJames Fargher
Changelog: changed
2023-09-20backup: Add manifest writing locatorJames Fargher
2023-09-20backup: Add more metadata to Backup structJames Fargher
The plan is to introduce a new locator wrapper that will write backup manifest files. In order to properly locate the manifest file, we need to add the backup ID and repository.
2023-09-20backup: Convert locator repos to Repository interfaceJames Fargher
Locators only use repositories to determine paths and so do not need the concrete repository types.
2023-09-20backup: Refactor locators to deal with entire backupsJames Fargher
Previously locators only needed the specific step being backed up, but soon we will be saving manifest files and this will require all steps such that they can be persisted.
2023-09-19Merge branch 'kn-git-242-feature-flag' into 'master'Christian Couder
featureflag: Remove the `GitV242` flag See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6378 Merged-by: Christian Couder <chriscool@tuxfamily.org> Approved-by: Christian Couder <chriscool@tuxfamily.org> Co-authored-by: Karthik Nayak <knayak@gitlab.com>
2023-09-19Merge branch 'pks-gitaly-service-dependencies' into 'master'Patrick Steinhardt
service: Simplify injection of dependencies for servers See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6377 Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: karthik nayak <knayak@gitlab.com> Reviewed-by: James Liu <jliu@gitlab.com> Reviewed-by: karthik nayak <knayak@gitlab.com>
2023-09-19featureflag: Remove the `GitV242` flagKarthik Nayak
The featureflag `GitV242` was introduced to rollout git v2.42. Since the rollout was completed in the previous release (16.4), we can safely remove the flag.
2023-09-19service: Simplify injection of dependencies for server serverPatrick Steinhardt
While we already have a `service.Dependencies` type around for quite a long time, we still pass in dependencies explicitly when constructing the actual server. This makes it harder than necessary to make a server require more dependencies as you will have to adjust all callsites where the server is currently getting constructed. Simplify the code to instead inject the `service.Dependencies` type into the server directly. This will allow us to propagate dependencies more readily in the future.
2023-09-19Merge branch 'pks-ssh-unify-upload-command-execution' into 'master'James Liu
ssh: Unify logic to handle git-upload-pack(1) and git-upload-archive(1) See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6379 Merged-by: James Liu <jliu@gitlab.com> Approved-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Approved-by: James Liu <jliu@gitlab.com> Reviewed-by: Patrick Steinhardt <psteinhardt@gitlab.com> Reviewed-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Reviewed-by: James Liu <jliu@gitlab.com> Co-authored-by: Patrick Steinhardt <psteinhardt@gitlab.com>
2023-09-19service: Simplify injection of dependencies for internal serverPatrick Steinhardt
While we already have a `service.Dependencies` type around for quite a long time, we still pass in dependencies explicitly when constructing the actual server. This makes it harder than necessary to make a server require more dependencies as you will have to adjust all callsites where the server is currently getting constructed. Simplify the code to instead inject the `service.Dependencies` type into the server directly. This will allow us to propagate dependencies more readily in the future.
2023-09-19service: Simplify injection of dependencies for Hook serverPatrick Steinhardt
While we already have a `service.Dependencies` type around for quite a long time, we still pass in dependencies explicitly when constructing the actual server. This makes it harder than necessary to make a server require more dependencies as you will have to adjust all callsites where the server is currently getting constructed. Simplify the code to instead inject the `service.Dependencies` type into the server directly. This will allow us to propagate dependencies more readily in the future.
2023-09-19service: Simplify injection of dependencies for ObjectPool serverPatrick Steinhardt
While we already have a `service.Dependencies` type around for quite a long time, we still pass in dependencies explicitly when constructing the actual server. This makes it harder than necessary to make a server require more dependencies as you will have to adjust all callsites where the server is currently getting constructed. Simplify the code to instead inject the `service.Dependencies` type into the server directly. This will allow us to propagate dependencies more readily in the future.
2023-09-19service: Simplify injection of dependencies for Remote serverPatrick Steinhardt
While we already have a `service.Dependencies` type around for quite a long time, we still pass in dependencies explicitly when constructing the actual server. This makes it harder than necessary to make a server require more dependencies as you will have to adjust all callsites where the server is currently getting constructed. Simplify the code to instead inject the `service.Dependencies` type into the server directly. This will allow us to propagate dependencies more readily in the future.
2023-09-19service: Simplify injection of dependencies for Conflicts serverPatrick Steinhardt
While we already have a `service.Dependencies` type around for quite a long time, we still pass in dependencies explicitly when constructing the actual server. This makes it harder than necessary to make a server require more dependencies as you will have to adjust all callsites where the server is currently getting constructed. Simplify the code to instead inject the `service.Dependencies` type into the server directly. This will allow us to propagate dependencies more readily in the future.
2023-09-19service: Simplify injection of dependencies for SmartHTTP serverPatrick Steinhardt
While we already have a `service.Dependencies` type around for quite a long time, we still pass in dependencies explicitly when constructing the actual server. This makes it harder than necessary to make a server require more dependencies as you will have to adjust all callsites where the server is currently getting constructed. Simplify the code to instead inject the `service.Dependencies` type into the server directly. This will allow us to propagate dependencies more readily in the future.
2023-09-19service: Simplify injection of dependencies for SSH serverPatrick Steinhardt
While we already have a `service.Dependencies` type around for quite a long time, we still pass in dependencies explicitly when constructing the actual server. This makes it harder than necessary to make a server require more dependencies as you will have to adjust all callsites where the server is currently getting constructed. Simplify the code to instead inject the `service.Dependencies` type into the server directly. This will allow us to propagate dependencies more readily in the future.
2023-09-19service: Simplify injection of dependencies for Repository serverPatrick Steinhardt
While we already have a `service.Dependencies` type around for quite a long time, we still pass in dependencies explicitly when constructing the actual server. This makes it harder than necessary to make a server require more dependencies as you will have to adjust all callsites where the server is currently getting constructed. Simplify the code to instead inject the `service.Dependencies` type into the server directly. This will allow us to propagate dependencies more readily in the future.
2023-09-19service: Simplify injection of dependencies for Ref serverPatrick Steinhardt
While we already have a `service.Dependencies` type around for quite a long time, we still pass in dependencies explicitly when constructing the actual server. This makes it harder than necessary to make a server require more dependencies as you will have to adjust all callsites where the server is currently getting constructed. Simplify the code to instead inject the `service.Dependencies` type into the server directly. This will allow us to propagate dependencies more readily in the future.
2023-09-19service: Simplify injection of dependencies for Operations serverPatrick Steinhardt
While we already have a `service.Dependencies` type around for quite a long time, we still pass in dependencies explicitly when constructing the actual server. This makes it harder than necessary to make a server require more dependencies as you will have to adjust all callsites where the server is currently getting constructed. Simplify the code to instead inject the `service.Dependencies` type into the server directly. This will allow us to propagate dependencies more readily in the future.
2023-09-19service: Simplify injection of dependencies for Namespace serverPatrick Steinhardt
While we already have a `service.Dependencies` type around for quite a long time, we still pass in dependencies explicitly when constructing the actual server. This makes it harder than necessary to make a server require more dependencies as you will have to adjust all callsites where the server is currently getting constructed. Simplify the code to instead inject the `service.Dependencies` type into the server directly. This will allow us to propagate dependencies more readily in the future.
2023-09-19service: Simplify injection of dependencies for Diff serverPatrick Steinhardt
While we already have a `service.Dependencies` type around for quite a long time, we still pass in dependencies explicitly when constructing the actual server. This makes it harder than necessary to make a server require more dependencies as you will have to adjust all callsites where the server is currently getting constructed. Simplify the code to instead inject the `service.Dependencies` type into the server directly. This will allow us to propagate dependencies more readily in the future.
2023-09-19service: Simplify injection of dependencies for Commit serverPatrick Steinhardt
While we already have a `service.Dependencies` type around for quite a long time, we still pass in dependencies explicitly when constructing the actual server. This makes it harder than necessary to make a server require more dependencies as you will have to adjust all callsites where the server is currently getting constructed. Simplify the code to instead inject the `service.Dependencies` type into the server directly. This will allow us to propagate dependencies more readily in the future.
2023-09-19service: Simplify injection of dependencies for Cleanup serverPatrick Steinhardt
While we already have a `service.Dependencies` type around for quite a long time, we still pass in dependencies explicitly when constructing the actual server. This makes it harder than necessary to make a server require more dependencies as you will have to adjust all callsites where the server is currently getting constructed. Simplify the code to instead inject the `service.Dependencies` type into the server directly. This will allow us to propagate dependencies more readily in the future.
2023-09-19service: Simplify injection of dependencies for Blob serverPatrick Steinhardt
While we already have a `service.Dependencies` type around for quite a long time, we still pass in dependencies explicitly when constructing the actual server. This makes it harder than necessary to make a server require more dependencies as you will have to adjust all callsites where the server is currently getting constructed. Simplify the code to instead inject the `service.Dependencies` type into the server directly. This will allow us to propagate dependencies more readily in the future.
2023-09-19Merge branch 'qmnguyen0711/implement-resizable-semaphore' into 'master'Patrick Steinhardt
Implement resizable semaphore data structure See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6366 Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: James Liu <jliu@gitlab.com> Reviewed-by: Patrick Steinhardt <psteinhardt@gitlab.com> Reviewed-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Reviewed-by: James Liu <jliu@gitlab.com> Co-authored-by: Quang-Minh Nguyen <qmnguyen@gitlab.com>
2023-09-19ssh: Move large buffer reader to its only place of usePatrick Steinhardt
With the preceding refactorings we have moved the only user of the `largeBufferReaderFrom` structure to a different place, but didn't yet move the implementation of the buffer itself. Let's do so now.
2023-09-19ssh: Rename `monitorStdinCommand()` to `runUploadCommand()`Patrick Steinhardt
With the preceding refactorings of `monitorStdinCommand()` its current name is not quite accurate anymore: it does not only set up monitoring anymore, but also runs the command and handles various bits and pieces of its lifecycle. Let's rename the function to `runUploadCommand()`. At a later point we can also move this functionality into a shared place such that it is reusable for the smarthttp service. While at it, document what the functions intent is.
2023-09-19ssh: Unify logic to handle git-upload-pack(1) and git-upload-archive(1)Patrick Steinhardt
The logic to run git-upload-pack(1) and git-upload-archive(1) is quite complex. Despite the need to splice several standard streams, we also need to handle the case where negotiation of the data that is to be sent does not finish, which is done to address time-of-check-time-of-use attacks. Right now, much of the logic to do this setup is split up across the callers and `monitorStdinCommand()`. As there are multiple callers of the latter function, this means that some of the logic is duplicated. Furthermore, it is quite hard to change `monitorStdinCommand()` to alter its semantics, as it is not at all a self-contained building block. Refactor this to move much of the logic into `monitorStdinCommand()`, which brings us a bunch of advantages: - The monitoring logic is more self-contained so that we can amend it at a later point. This was the original motivation of this patch as it will be required to fix cases where we don't correctly detect that the mentioned negotiation has completed. - It allows us to use the same counting writer for SSHUploadArchive that we already use for SSHUploadPack. We thus get better insight into how much data we're typically returning in this RPC. - It allows us to use the same large buffer reader that we already use for SSHUploadPack. This reader uses a larger-than-usual buffer so that we can avoid many syscalls and should thus help to make SSHUploadArchive more efficient. - We can reuse the bits to detect cancellation via our pktline monitor in case negotiation does not finish in time. - We can reuse the error handling where the remote side hangs up unexpectedly, which is thrown by Git's pktline protocol in case the remote side hangs up in the middle of a write. This allows us to label user-cancelled requests as `codes.Canceled` instead of `codes.Internal` in SSHUploadArchive. So overall we gain quite a lot of benefits with this refactoring while also simplifying our code base. Changelog: fixed
2023-09-19command: Recognize nested exit statusPatrick Steinhardt
The `command.ExitStatus()` function is responsible for extracting an exit code from an `exec.ExitError`. The way this is done is extremely fragile though as we try to directly cast the passed-in error to the target error type. It's quite likely though that the error may be wrapped somewhere in the callchain, which would break the functionality. Refactor the function to instead use `errors.As()` such that it knows to peel the error chain correctly.
2023-09-19Merge branch 'pks-pack-objects-hook-context-cancellation-flake' into 'master'Quang-Minh Nguyen
hook: Fix pack-objects hook test with context cancellation Closes #5548 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6372 Merged-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Approved-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Approved-by: Will Chandler <wchandler@gitlab.com> Co-authored-by: Patrick Steinhardt <psteinhardt@gitlab.com>
2023-09-19Merge branch 'benchmark_backup_repository' into 'master'Justin Tobler
Add benchmark for BackupRepository RPC See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6305 Merged-by: Justin Tobler <jtobler@gitlab.com> Approved-by: Justin Tobler <jtobler@gitlab.com> Reviewed-by: Will Chandler <wchandler@gitlab.com> Co-authored-by: Will Chandler <wchandler@gitlab.com> Co-authored-by: James Fargher <jfargher@gitlab.com>
2023-09-18backup: Comment full backup conditionalWill Chandler
2023-09-18Merge remote-tracking branch 'dev/master'GitLab Release Tools Bot
2023-09-18Merge branch 'pks-log-hide-logrus' into 'master'Will Chandler
log: Roundtrip `log.Logger` type See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6376 Merged-by: Will Chandler <wchandler@gitlab.com> Approved-by: Will Chandler <wchandler@gitlab.com> Reviewed-by: karthik nayak <knayak@gitlab.com> Co-authored-by: Patrick Steinhardt <psteinhardt@gitlab.com>
2023-09-18Update changelog for 16.2.7GitLab Release Tools Bot
[ci skip]
2023-09-18Update changelog for 16.3.4GitLab Release Tools Bot
[ci skip]
2023-09-18Merge branch 'wc/trace-rel-time-rounding' into 'master'Quang-Minh Nguyen
trace2: Don't round offset event times See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6375 Merged-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Approved-by: Toon Claes <toon@gitlab.com> Approved-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Co-authored-by: Will Chandler <wchandler@gitlab.com>
2023-09-18limiter: Fix typo of "BackoffBackoff" fieldQuang-Minh Nguyen
In a prior interation, the field "BackoffBackoff" has a typo. It should be "BackoffFactor".
2023-09-18limiter: Add update hooks to limiter.AdaptiveLimitQuang-Minh Nguyen
limiter.AdaptiveLimit is used to store the adaptive concurrency limit. It is updated by the adaptive calculator. This commit implements a hook system to AdaptiveLimit. It allows callers to register hooks. When the limit's current value is updated, those hooks are triggered. This system allows other components to shrink or grow accordingly. They are essential for queues in limiter, which will be modified in the later commits.
2023-09-18limiter: Implement resizable semaphore data structureQuang-Minh Nguyen
This commit implements `resizableSemaphore`, which provides a way to bound concurrent access to resources. It allows a certain number of concurrent access to the resources. When the concurrency reaches the semaphore size, the callers are blocked until a resource is available again. The size of the semaphore can be resized freely in an atomic manner. This struct is not intended to serve as a general-purpose data structure but is specifically designed for flexible concurrency control with resizable capacity.
2023-09-18global: Replace some uses of the `logrus` packagePatrick Steinhardt
Remove some more uses of the `logrus` package in our codebase where it's not strictly required.
2023-09-18global: Replace `logrus.Fields` with a wrapper typePatrick Steinhardt
Introduce our own wrapper type for the `logrus.Fields` type. This allows us to get rid of the logrus import in many places and thus is another step towards getting rid of the `logrus` dependency altogether in our code base.
2023-09-18log: Roundtrip `log.Logger` typePatrick Steinhardt
The `log.Logger` type still converts to a `logrus.Entry` when calling functions like `WithField()` or `WithError()`. This was hard to change though because a lot of callsites still relied on this conversion. By now we have have fixed all blockers though, which allows us to finally do the conversion and have the `log.Logger` type roundtrip to itself. To do so, we inline the `logrus.FieldLogger` interface and adapt the specific functions to return a `Logger` instead of a `logrus.Entry`. This change also demonstrates that all internal interfaces now use the interface exclusively and that we are free to adapt the interface as required from now on. Note that we also have to add two additional functions to the interface to create the logging interceptors for the gRPC server. This is because we have no way to create these interceptors manually from a `log.Logger` anymore and thus need its help to do so for us.
2023-09-18tests: Stop using `NullLogger` in favor of our own internal loggerPatrick Steinhardt
Stop using logrus' `NullLogger` in favor of our own internal logger that can be set up with the testhelper package.
2023-09-18testhelper: Return our own logger instead of `logrus.FieldLogger`Patrick Steinhardt
Refactor out testhelper functions that create a logger to return our own internal `log.LogrusLogger` instead of a `logrus.FieldLogger`. Add an abstraction layer around adding hooks into the logger such that tests don't need to reach into the logrus logger in general.
2023-09-18Merge branch 'ashmckenzie/support-forking-just-default-branch' into 'master'Patrick Steinhardt
Add support for forking a single branch See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6325 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: Ash McKenzie <amckenzie@gitlab.com> Reviewed-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Co-authored-by: Ash McKenzie <amckenzie@gitlab.com>
2023-09-18Merge branch 'pks-raw-blame-fix-error-handling' into 'master'Patrick Steinhardt
commit: Gracefully handle invalid arguments in RawBlame Closes #5594 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6361 Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: James Liu <jliu@gitlab.com>
2023-09-18commit: Handle paths escaping the repository in RawBlamePatrick Steinhardt
When passing a path to git-blame(1) that would escape the repository root it will return an error. Let's detect this early such that we can gracefully return an `InvalidArgument` error.
2023-09-18Merge branch 'pks-log-wrap-logrus' into 'master'James Fargher
log: Wrap the logrus logger See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6364 Merged-by: James Fargher <jfargher@gitlab.com> Approved-by: James Fargher <jfargher@gitlab.com> Reviewed-by: Patrick Steinhardt <psteinhardt@gitlab.com> Reviewed-by: James Liu <jliu@gitlab.com> Co-authored-by: Patrick Steinhardt <psteinhardt@gitlab.com>