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-07-11create repositories with sha256jc/test-sha256John Cai
2023-07-10Merge branch 'jc/danger-remove-auto-group-labeling' into 'master'Andras Horvath
Danger: Do not label devops::systems indiscriminantly See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6035 Merged-by: Andras Horvath <ahorvath@gitlab.com> Approved-by: Andras Horvath <ahorvath@gitlab.com> Co-authored-by: John Cai <jcai@gitlab.com>
2023-07-07Merge branch 'jc/streamline-ci-jobs' into 'master'Will Chandler
.gitlab-ci.yml: Skip tests for non code changes Closes #5419 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5997 Merged-by: Will Chandler <wchandler@gitlab.com> Approved-by: Will Chandler <wchandler@gitlab.com> Reviewed-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Co-authored-by: John Cai <jcai@gitlab.com>
2023-07-07Merge branch 'pks-houskeeping-enable-geometric-repacking' into 'master'Toon Claes
housekeeping: Always enable geometric repacking strategy Closes #5031 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6031 Merged-by: Toon Claes <toon@gitlab.com> Approved-by: Toon Claes <toon@gitlab.com> Approved-by: Justin Tobler <jtobler@gitlab.com> Co-authored-by: Patrick Steinhardt <psteinhardt@gitlab.com>
2023-07-07Merge branch 'renovate-tools/golangci-lint/golang.org-x-tools-0.x' into 'master'Toon Claes
tools/golangci-lint: Update module golang.org/x/tools to v0.11.0 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6034 Merged-by: Toon Claes <toon@gitlab.com> Approved-by: Toon Claes <toon@gitlab.com> Approved-by: Christian Couder <chriscool@tuxfamily.org> Co-authored-by: GitLab Renovate Bot <gitlab-bot@gitlab.com>
2023-07-07Merge branch 'smh-fix-get-custom-hooks-test' into 'master'Toon Claes
Fix broken test GetCustomHooks_nonExistentHooks See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6020 Merged-by: Toon Claes <toon@gitlab.com> Approved-by: James Fargher <jfargher@gitlab.com> Co-authored-by: Sami Hiltunen <shiltunen@gitlab.com>
2023-07-07Merge branch 'jc/remove-user-commit-files-ff' into 'master'Toon Claes
operations: Remove CommitFilesInGit feature flag See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5984 Merged-by: Toon Claes <toon@gitlab.com> Approved-by: Toon Claes <toon@gitlab.com> Reviewed-by: karthik nayak <knayak@gitlab.com> Co-authored-by: John Cai <jcai@gitlab.com>
2023-07-07Merge branch 'renovate-tools/goimports/golang.org-x-tools-0.x' into 'master'karthik nayak
tools/goimports: Update module golang.org/x/tools to v0.11.0 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6033 Merged-by: karthik nayak <knayak@gitlab.com> Approved-by: karthik nayak <knayak@gitlab.com> Co-authored-by: GitLab Renovate Bot <gitlab-bot@gitlab.com>
2023-07-07Merge branch 'smh-add-missing-fsyncs' into 'master'qmnguyen0711/implement-aimd-algorithmJohn Cai
Add missing fsyncs Closes #5072 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5999 Merged-by: John Cai <jcai@gitlab.com> Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: John Cai <jcai@gitlab.com> Reviewed-by: Patrick Steinhardt <psteinhardt@gitlab.com> Reviewed-by: Sami Hiltunen <shiltunen@gitlab.com> Co-authored-by: Sami Hiltunen <shiltunen@gitlab.com>
2023-07-07Danger: Do not label devops::systems indiscriminantlyJohn Cai
Currently we add the devops::systems label irregardless of what group the author is part of. triage-ops already takes care of applying labels based on the MR author so this ends up being noisy and unnecessary. Let's just not set devops::systems since triage-ops already sets the group label.
2023-07-07Merge branch 'smh-remove-all-annotations' into 'master'Justin Tobler
Add operation type annotations on RemoveAll See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6030 Merged-by: Justin Tobler <jtobler@gitlab.com> Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: Justin Tobler <jtobler@gitlab.com> Co-authored-by: Sami Hiltunen <shiltunen@gitlab.com>
2023-07-06.gitlab-ci.yml: Skip tests for non code changesJohn Cai
We don't need the full pipeline to run for things in the .gitlab/ folder, nor any documentation in .md files. Create a rule to skip tests if we detect such files.
2023-07-06Merge branch 'pks-update-ref-improved-errors' into 'master'Patrick Steinhardt
Introduced generic error metadata and improve updateref errors See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6029 Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: karthik nayak <knayak@gitlab.com> Reviewed-by: Patrick Steinhardt <psteinhardt@gitlab.com> Reviewed-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Reviewed-by: karthik nayak <knayak@gitlab.com>
2023-07-06Merge branch 'renovate/gocloud.dev-0.x' into 'master'Quang-Minh Nguyen
go: Update module gocloud.dev to v0.30.0 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5974 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-07-06updateref: Drop use of Ruby-style errorPatrick Steinhardt
When we have migrated the Operations service into Gitaly, many of the RPCs were embedding errors into a successful response via a special field. These errors were in fact consumed and often also displayed by Rails, which meant that we were not in a position to actually change them. This led to a bunch of error messages that don't really carry a lot of information. We have since migrated most of the RPCs to instead use structured errors and are thus free to change those errors to be more meaningful. One such instance is the dreaded "Could not update $ref. Please refresh and try again." error message. This error can indeed be caused by a multitude of different errors, but what the actual root cause is is quite unclear. Refactor the code and get rid of this error, instead propagating the actual root cause to the caller. This greatly clarifies the reason why a reference update has failed and should help us debug such cases better in the future. Note that there is once instance left with `UserRevert()` where we have to return the old-style error as it is still getting embedded into a successful response. This commit simply inlines that error and adds a TODO comment on top of it.
2023-07-06updateref: Convert `NonCommitObjectError` to use error metadataPatrick Steinhardt
Convert the `NonCommitObjectError` to use error metadata instead of embedding the information into the error message.
2023-07-06updateref: Convert `NonExistentObjectError` to use error metadataPatrick Steinhardt
Convert the `NonExistentObjectError` to use error metadata instead of embedding the information into the error message.
2023-07-06updateref: Convert `InTransactionConflictError` to use error metadataPatrick Steinhardt
Convert the `InTransactionConflictError` to use error metadata instead of embedding the information into the error message.
2023-07-06updateref: Convert `FileDirectoryConflictError` to use error metadataPatrick Steinhardt
Convert the `FileDirectoryConflictError` to use error metadata instead of embedding the information into the error message.
2023-07-06updateref: Convert `InvalidReferenceFormatError` to use error metadataPatrick Steinhardt
Convert the `InvalidReferenceFormatError` to use error metadata instead of embedding the information into the error message.
2023-07-06updateref: Convert `AlreadyLockedError` to use error metadataPatrick Steinhardt
Convert the `AlreadyLockedError` to use error metadata instead of embedding the information into the error message.
2023-07-06updateref: Detect mismatched state errorsPatrick Steinhardt
We don't gracefully handle the case where updating a reference fails because the expected value the reference points to is different from the actual value. Detect this case and return a proper error type so that we provide better error reporting.
2023-07-06structerr: Allow addding metadata to any error typePatrick Steinhardt
In order to add metadata to an error one must create a `structerr.Error` right now. This is a bit roundabout though in the case where you already have a custom error type that you wish to add metadata to. While you can play games and implement an `Unwrap()` function on your error type that returns a `structerr.Error` with metadata, this is indeed quite tedious and roundabout. Instead, provide a new `structerr.ErrorMetadater` interface that can be implemented by custom error types. This allows them to attach metadata to the custom error type directly via a `ErrorMetadata()` function.
2023-07-06structerr: Provide convenience function to extract metadata from errorsPatrick Steinhardt
Callers that wish to extract error metadata from a generic error need to manually extract the `structerr.Error` first and then call `Metadata()` on it, which is a bit cumbersome. Furthermore, we're about to extend the logic to also allow for any other error types to carry metadata via an interface, which would require them to also be on the lookout for any such interface types. Refactor the code and pull out the logic to extract error metadata into a standalone `structerr.ExtractMetadata()` function. Given a generic error, it will return all error metadata that is contained in the error chain. This makes it easy to extend the logic going forward. Adjust existing callsites to use this new function.
2023-07-06Merge branch 'pks-write-ref-improve-error-reporting' into 'master'Sami Hiltunen
Improve error reporting for locked references See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6012 Merged-by: Sami Hiltunen <shiltunen@gitlab.com> Approved-by: Sami Hiltunen <shiltunen@gitlab.com> Co-authored-by: Patrick Steinhardt <psteinhardt@gitlab.com>
2023-07-06Merge branch 'smh-request-constructor' into 'master'Quang-Minh Nguyen
Implement a request constructor in protoregistry See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6021 Merged-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Co-authored-by: Sami Hiltunen <shiltunen@gitlab.com>
2023-07-06Merge branch 'renovate/golang.org-x-sys-0.x' into 'master'Sami Hiltunen
go: Update module golang.org/x/sys to v0.10.0 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6024 Merged-by: Sami Hiltunen <shiltunen@gitlab.com> Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: Sami Hiltunen <shiltunen@gitlab.com> Co-authored-by: GitLab Renovate Bot <gitlab-bot@gitlab.com>
2023-07-06Sync object pool removalsSami Hiltunen
Object pool removals are currently not synced which may lead to them coming back in full or in a partial state after a crash. This commit adds the missing sync. Changelog: fixed
2023-07-06Sync migrated quarantine directory contentsSami Hiltunen
Quarantine directory's contents are not synced currently when they get migrated to the repository's object database. This may lead to some objects missing after a host crash. This commit adds the missing syncs for the migrated objects and directories. There's still a chance of repository corruption as the objects are not migrated in a dependency order. We may successfully migrate a commit into the target repository without its tree for example. This should be handled separately. Changelog: fixed
2023-07-06Sync repository movesSami Hiltunen
Moving a repository doesn't currently get synced to the disk. This may lead to the repository not being in the expected location if the host crashes. Add the missing syncs. Since we don't know if the entire target directory hierarchy was just created, we'll sync it always. Changelog: fixed
2023-07-06Sync repository removalsSami Hiltunen
Repository removals are currently not synced to the disk. This may lead to the repository appearing back on the disk either in full or in corrupted state with deletion partially applied. As we are moving the repository to a temporary directory before deleting it, we need to just sync the move the removal from the parent directory in order to avoid the issues. Changelog: fixed
2023-07-06Sync repository creations to diskSami Hiltunen
Repository creations are currently not flushed to disk. This can lead to data loss if the host crashes before the writes have been persisted to disks. Sync the writes the the disk prior to acknowleding a repository creations to avoid this. As we don't know whether the directory hierarchy in the storage existed, we sync them always regardless, and assume that the root storage directory's entry in the parent directroy is synced already. Changelog: fixed
2023-07-06Merge branch 'smh-sequentialize-last-commits' into 'master'karthik nayak
Run TestListLastCommitsForTree subtests sequentially See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6022 Merged-by: karthik nayak <knayak@gitlab.com> Approved-by: Justin Tobler <jtobler@gitlab.com> Approved-by: karthik nayak <knayak@gitlab.com> Co-authored-by: Sami Hiltunen <shiltunen@gitlab.com>
2023-07-06Merge branch 'backup_repository_validation' into 'master'Patrick Steinhardt
Stop validating vanity repo exists in BackupRepository See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6017 Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: Christian Couder <chriscool@tuxfamily.org> Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com> Co-authored-by: James Fargher <jfargher@gitlab.com>
2023-07-06Merge branch 'pks-smarthttp-receive-pack-test-sha256' into 'master'Sami Hiltunen
smarthttp: Enable SHA256 object format tests for PostReceivePack See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5990 Merged-by: Sami Hiltunen <shiltunen@gitlab.com> Approved-by: Will Chandler <wchandler@gitlab.com> Approved-by: Sami Hiltunen <shiltunen@gitlab.com> Co-authored-by: Patrick Steinhardt <psteinhardt@gitlab.com>
2023-07-06housekeeping: Always enable geometric repacking strategyPatrick Steinhardt
We have enabled geometric repacking by default in fdd48e61b9 (housekeeping: Default-enable geometric repacking, 2023-05-09), which is almost two months ago at this time and didn't observe any negative consequences in production systems. So let's remove the feature flag and unconditionally enable geometric repacking.
2023-07-06Merge branch 'jt-bump-git-version' into 'master'Patrick Steinhardt
git: Bump minimum version of Git to 2.41 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6016 Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com> Reviewed-by: Patrick Steinhardt <psteinhardt@gitlab.com> Reviewed-by: Justin Tobler <jtobler@gitlab.com> Co-authored-by: Justin Tobler <jtobler@gitlab.com>
2023-07-06Remove intercepted_method optionSami Hiltunen
The `intercepted_method` option was used to mark a method as being handled by Praefect. Since the operation type and scope annotations were mostly for Praefect's proxy, marking a method as intecepted allowed for dropping the annotations as they were not needed. As we've now annotated again the methods that had the option set, let's remove the option as it is no longer needed.
2023-07-06go: Update module gocloud.dev to v0.30.0GitLab Renovate Bot
2023-07-06Add operation type annotations on RemoveAllSami Hiltunen
RemoveAll is missing operation type and scope annotations. These are needed to handle starting transactions for RPCs in a general manner. The RPC is missing the annotations as it is intercepted by Praefect and the annotations were previously only used by Praefect for deciding how to proxy the requests. As Gitaly will soon need the annotations itself, this commit adds the missing annotations. TransactionService and PraefectInfoService service remain without annotations. These are only implemented by Praefect and thus Gitaly doesn't need annotations for them. ServerService is also still left without annotations as there is no suitable scope for them anymore. Previously they were annotated with the now removed Server scope.
2023-07-06repository: Detect locking issues in WriteRefPatrick Steinhardt
When WriteRef fails because it cannot lock the reference that is to be updated it returns an internal error. Given that this is quite a likely error scenario though and that we already have the infrastructure in place to detect such issues we can do better though and return a more telling error. Refactor the RPC to instead return an explicit error with metadata. This should make it easier for us to detect lock contention better going forward.
2023-07-06ref: Change error code for locked refs in DeleteRefs to AbortedPatrick Steinhardt
When trying to delete a reference that is already locked we return a structured error in DeleteRefs with `codes.FailedPrecondition`. This fails the litmus test documented in `grpc/codes` though: > A litmus test that may help a service implementor in deciding > between FailedPrecondition, Aborted, and Unavailable: > > (a) Use Unavailable if the client can retry just the failing call. > (b) Use Aborted if the client should retry at a higher-level > (e.g., restarting a read-modify-write sequence). > (c) Use FailedPrecondition if the client should not retry until > the system state has been explicitly fixed. E.g., if an "rmdir" > fails because the directory is non-empty, FailedPrecondition > should be returned since the client should not retry unless > they have first fixed up the directory by deleting files from it. > (d) Use FailedPrecondition if the client performs conditional > REST Get/Update/Delete on a resource and the resource on the > server does not match the condition. E.g., conflicting > read-modify-write on the same resource. FailedPrecondition should be returned only when the client should not retry, but given that we are looking at a locking issue that is usually caused by concurrent calls holding the lock this is wrong. Instead, Aborted is a better fit as a retry should typically work alright. Refactor the code to do so.
2023-07-06updateref: Recognize locking errors when committing transactionsPatrick Steinhardt
When a reference is locked already, then git-update-ref(1) will fail and tell us. This information is getting parsed by Gitaly and gets returned to the caller via a special `AlreadyLockedError` so that they can handle this case more gracefully. The regular expression we use to parse the error message is lacking though: while the error may happen in the `prepare` phase, it can also happen in the `commit` phase when the caller skips explicit preparation of the transaction. And as Git will prefix the phase to the error, we need to recognize both of them. Right now, we only recognize `prepare` errors though. Fix the issue by extending the regular expression to also detect `commit` phase errors.
2023-07-06updateref: Refactor `AlreadyLockedError` to be more consistentPatrick Steinhardt
The `AlreadyLockedError` is quite inconsistent with the other errors declared in the `updateref` package as it abbreviates the embedded reference name and is a pointer receiver. Refactor it to improve our code hygiene.
2023-07-05git: Remove `GeometricRepackingSupportsAlternates()`Justin Tobler
The `GeometricRepackingSupportsAlternates()` function detects whether the given Git version knows to perform geometric repacking in repositories which are connected to an alternate object database. Since the required minimum Git version has been increased to v2.41, this check always returns true. Remove the function and clean up its call sites.
2023-07-05tools/golangci-lint: Update module golang.org/x/tools to v0.11.0GitLab Renovate Bot
2023-07-05tools/goimports: Update module golang.org/x/tools to v0.11.0GitLab Renovate Bot
2023-07-05Merge branch 'pks-write-ref-sha256' into 'master'Will Chandler
repository: Make WriteRef compatible with SHA256 object format See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6001 Merged-by: Will Chandler <wchandler@gitlab.com> Approved-by: Justin Tobler <jtobler@gitlab.com> Approved-by: Will Chandler <wchandler@gitlab.com> Co-authored-by: Patrick Steinhardt <psteinhardt@gitlab.com>
2023-07-05git: Remove `MidxDeletesRedundantBitmaps()`Justin Tobler
The `MidxDeletesRedundantBitmaps()` function detects whether the given Git version deletes redundant pack-based bitmaps when writing multi-pack-indices. Since the required minimum Git version has been increased to v2.41, this check always returns true. Remove the function and clean up its call sites.
2023-07-05git: Remove `PatchIDRespectsBinaries()`Justin Tobler
The `PatchIDRespectsBinaries()` function detects whether the given Git version correctly handles binary diffs when computing a patch ID. Since the required minimum Git version has been increased to v2.41, this check always returns true. Remove the function and clean up its call sites.