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
2021-06-16operations/merge: Merge merge2 stuff into mergeadd-merge2-using-merge-ortChristian Couder
2021-06-15operations: Remove merge2.goChristian Couder
2021-06-15operations/merge2: gofmt fixesChristian Couder
2021-06-15operations: Use merge2 instead of mergeChristian Couder
2021-06-15operations: add merge2.go using merge-ortChristian Couder
2021-06-14Update changelog for 13.12.4GitLab Release Tools Bot
[ci skip]
2021-06-14Merge branch 'pks-tx-remove-praefect-server' into 'master'Christian Couder
transaction: Drop fallback code to connect to Praefect via server info See merge request gitlab-org/gitaly!3585
2021-06-14Merge branch 'pks-blob-lfs-pointer-pipeline' into 'master'Patrick Steinhardt
Refactor blob service to use Go pipelines for LFS objects See merge request gitlab-org/gitaly!3584
2021-06-14blob: Convert `ListLFSPointers()` to use pipelinePatrick Steinhardt
Now that the pipelining code is in place, convert `ListLFSPointers()` to use the new pipeline. The change is currently implemented behind a feature flag to catch any issues with it, but eventually we can get rid of the old implementation and only retain the new and much more flexible pipeline architecture.
2021-06-14blob: Move verification of revisions into ListLFSPointersPatrick Steinhardt
We're about to add a second implementation to the current existing `ListLFSPointers()` implementation. Given that both callsites will require validation of specified revisions, let's move it into `ListLFSPointers()` directly such that the code is shared. Given that no other callers of `findLFSPointersByRevision()` exist, this doesn't relax any semantics.
2021-06-14blob: Add tests which exercise complete pipelinePatrick Steinhardt
Now that we have the infrastructure in place to set up a complete pipeline which reads a set of revisions, extracts information about each of the objects and then finally reads the objects from disk, this commit adds a bunch of tests which do end-to-end tests of the assembled pipeline.
2021-06-14blob: Add pipeline filtersPatrick Steinhardt
While we now have a fully functional pipeline in place, it's not yet able to filter down objects based on the information we got. This is now implemented via a set of filters which can be inserted as intermediate steps to reduce the number of objects passed onto the next stage.
2021-06-14blob: Implement pipeline step for git-cat-file(1) batchingPatrick Steinhardt
In order to unify infrastructure when filtering down a list of revisions to a list of objects, we're creating a set of pipeline steps which first enumerate all objects, then extract information about these objects and finally read the whole objects. This pipeline will allow us to flexibly put together steps and filter down the object set at intermediate steps. This commit implements the final pipeline step, which receives as input a channel of object infos and reads each of the associated objects fully via `git cat-file --batch`.
2021-06-14blob: Implement pipeline step for git-cat-file(1) batch-checkingPatrick Steinhardt
In order to unify infrastructure when filtering down a list of revisions to a list of objects, we're creating a set of pipeline steps which first enumerate all objects, then extract information about these objects and finally read the whole objects. This pipeline will allow us to flexibly put together steps and filter down the object set at intermediate steps. This commit implements the second pipeline step, which receives as input a channel of object IDs and outputs information about each of the objects via `git cat-file --batch-check`.
2021-06-14blob: Implement pipeline step for git-rev-list(1)Patrick Steinhardt
In order to unify infrastructure when filtering down a list of revisions to a list of objects, we're creating a set of pipeline steps which first enumerate all objects, then extract information about these objects and finally read the whole objects. This pipeline will allow us to flexibly put together steps and filter down the object set at intermediate steps. This commit implements the first pipeline step, which enumerates all objects reachable from a set of revisions via git-rev-list(1).
2021-06-14txinfo: Remove Praefect server infoPatrick Steinhardt
Givven that all transactional voting nowadays happens via the backchannel ID, there is no need anymore for the old Praefect server structure. Let's delete it.
2021-06-14tests: Remove unused Praefect server structurePatrick Steinhardt
We do not use the Praefect server structure for anything anymore. Let's strip it out from our tests such that we can remove it altogether.
2021-06-14coordinator: Stop injecting Praefect server infoPatrick Steinhardt
Given that all transactional voting happens via the backchannel now, there is no need to inject the Praefect server info anymore. Let's drop it.
2021-06-14hook: Remove Praefect server from hooks payloadPatrick Steinhardt
Now that all transactional voting uses the backchannel to connect back to Praefect, we do not need the Praefect server info anymore. Let's drop it.
2021-06-14ruby: Stop injecting Praefect server infoPatrick Steinhardt
Now that we only use the backchannel to connect back to Praefect for transactional voting, there is no need to inject Praefect server info into the Ruby sidecar anymore. Let's drop it.
2021-06-14transaction: Drop server info from voting functionsPatrick Steinhardt
We do not need the Praefect server info in any of the transactional voting functions anymore given that we now always use the backchannel, and the backchannel ID is redundantly encoded both in the Praefect server structure and in the transaction information. Drop the Praefect server parameter from voting functions.
2021-06-14transaction: Drop fallback code to connect to Praefect via server infoPatrick Steinhardt
Given that the backchannel voting code has been unconditionally enabled in v13.12, we can now drop the old fallback code which was using the Praefect server info if no backchannel was set.
2021-06-14repository: Fix voting when cloning from internal poolsPatrick Steinhardt
The `CloneFromPoolInternal()` RPC is responsible for first creating the desired target repo by closing from a pool repository and then updating the pool via a fetch from the source repo. While the former step happens via a direct call to git-clone(1), we connect to the remote service's `FetchInternalRemote()` RPC for the latter. This second step is problematic in the context of transactions though: we call `FetchInternalRemote()` with the incoming context having been converted to an outgoing context. The outgoing context thus retains information about any ongoing transactions and also about the backchannel ID. Given that this is a mutating RPC, the remote side will now try vote on the transaction and dial back via the backchannel, but given that the backchannel ID referred to the original Praefect node and not to the now-intermediate Gitaly node, this cannot work and will thus fail. Now that we have `FetchInternalRemote()` exposed directly without having to connect to the remote service, we can now easily fix the issue by just calling this function directly. No new tests are added because this failure will be exposed by subsequent commits which remove the `PraefetcServer` structure.
2021-06-14repository: Remove useless cast for setup of reftx hooksPatrick Steinhardt
The `git.WithRefTxHook()` nowadays only requires a `repository.GitRepo` structure as input, but we still perform a cast to `gitalypb.Repository` in `cloneFromPool()`. Drop this useless cast and pass in the repo directly.
2021-06-14remote: Make `FetchInternalRemote()` callable without a serverPatrick Steinhardt
We'll need to be able to call `FetchInternalRemote()` on the same Gitaly node without creating a connection to the remote service. Split out the logic of `FetchInternalRemote()` into a separate non-receiver function to allow for this.
2021-06-14remote: Make `getRemoteDefaultBranch()` a standalone functionPatrick Steinhardt
We'll need to call `getRemoteDefaultBranch()` from a context where we don't have a remote server as receiver. Pass in the connection pool expicitly and make it a normal function to prepare for this.
2021-06-14ref: Refactor `SetDefaultBranchRef()` to receive repo executorPatrick Steinhardt
Instead of having to pass around the command factory, we nowadays often use the `git.RepositoryExecutor` interface which gets implemented by our localrepo structure. Let's refactor `SetDefaultBranchRef()` to use this interface.
2021-06-14Merge branch 'pks-blackbox-cleanups' into 'master'Patrick Steinhardt
blackbox: Code cleanups for blackbox and related stats package See merge request gitlab-org/gitaly!3578
2021-06-14stats: Rename file to more closely match its contentsPatrick Steinhardt
The "analyzehttp.go" file's most prominent member is the `Clone` structure. Let's rename the file to "clone.go" to better match its contents. This requires us to fix one last missing comment on the `Clone` structure.
2021-06-14stats: Disentangle parameters and results for `Clone()`Patrick Steinhardt
The `Clone` structure currently holds both parameters and results. Such usage is always a code smell as it conflates two different concerns and makes it harder to use correctly for the caller. Let's disentangle both concerns by instead accepting parameters as part of a refactored `PerformClone()` function. This function is not a receiver anymore, but instead returns a newly constructed `Clone` structure which only contains results.
2021-06-14stats: Refactor the `Post` structurePatrick Steinhardt
The `Post` structure hosts statistics about a POST request against git-upload-pack(1). Without knowing details about how git-upload-pack(1) works though, one wouldn't be able to tell what it actually represents: everything related to fetching the packfile. Let's rename the structure to `HTTPFetchPack`, which more clearly labels what it actually is about. While at it, this also refactors the way it's constructed: instead of being constructed via the `Clone` structure, it's now a standalone structure and can be constructed via `performFetchPack()`. This disentangles concerns and makes it easier to reason about the code.
2021-06-14stats: Refactor the `Get` structurePatrick Steinhardt
The `Get` structure hosts statistics about a GET request against git-upload-pack(1). Without knowing details about how git-upload-pack(1) works though, one wouldn't be able to tell what it actually represents: everything related to the reference discovery. Let's rename the structure to `HTTPReferenceDiscovery`, which more clearly labels what it actually is about. While at it, this also refactors the way it's constructed: instead of being constructed via the `Clone` structure, it's now a standalone structure and can be constructed via `performReferenceDiscovery()`. This disentangles concerns and makes it easier to reason about the code.
2021-06-14stats: Move wants refs from GET to POSTPatrick Steinhardt
When doing a POST to git-upload-pack(1), then we send along a set of "want"s which tell the remote side which references we want to receive. So while this depends on us knowing which references exist in the first place, it still is inarguably a property of the POST and not of the GET which discovers available refs. Let's make the relation more explicit by 1. moving wants into the `Post` structure and 2. accepting announced references as parameter when doing the post.
2021-06-14stats: Un-inline statistics for the clone structurePatrick Steinhardt
Right now, it's really hard to reason about which functions on the `Clone`, `Get` and `Post` structures come from where given that we use inlined structures all the time. To clean this up a bit and make code easier to follow, this commit de-inlines all embedded structures into proper member variables.
2021-06-14stats: Split out fetch pack parsingPatrick Steinhardt
The code to parse the git-fetch-pack(1) body is tightly coupled with the code which drives the actual request. This makes it hard to reason about both concerns and also makes it hard to just parse a fetch pack body without doing the actual request. Refactor the code and split out a new `FetchPack` structure which contains all logic to parse from an `io.Reader` without having to care about the request itself. This structure is the equivalent to the already existing `ReferenceDiscovery` structure.
2021-06-14stats: Always use `printInteractive()` to print interactive messagesPatrick Steinhardt
Now that `printInteractive()` doesn't append a newline anymore, we can convert other callers which up to now had to manually check whether the `interactive` flag was set.
2021-06-14stats: Let callers append newlines for `printInteractive()`Patrick Steinhardt
When `printInteractive()` is called, the assumption is that all lines should be terminated by a newline. While that's true right now, this assumption keeps us from using this function in other places which thus need to manually check whether the `interactive` flag is set. Do not append the newline in `printInteractive()` and adjust callers accordingly to prepare for wider use of that function.
2021-06-14stats: Drop error code of `printInteractive()`Patrick Steinhardt
The gitaly-debug executable can be used to clone from a remote repository and print several statistics about the clone itself, like for example how long several stages took. Because of this, the stats package supports an "interactive" flag which causes it to print various events to stdout: only if it's set to true will `printInteractive()` actually print anything. One code smell we have right now is that `printInteractive()` returns an error, but it's never actually checked. And we probably don't even want to: it's only used for gitaly-debug to print to stdout, so it's harmless enough if it would fail. Get rid of the error code and just ignore when `fmt.Printf()` fails and remove the golang-ci exemption.
2021-06-14blackbox: Move Prometheus metrics into Blackbox structPatrick Steinhardt
Now that we have a Blackbox structure which can host all dependencies, let's move Prometheus metrics into this structure to get rid of one more source of globals.
2021-06-14blackbox: Implement logic on a Blackbox struct receiverPatrick Steinhardt
Right now, the implenetation of Blackbox logic always gets a configuration passed in as it is not associated to any structure. This shortcoming keeps us from having all logic like for example also the Prometheus counters as part of the struct, which means that they currently live as globals. Let's prepare to get rid of these globals by creating a new `Blackbox` structure and implement blackbox logic as receiver functions. For now, the struct only hosts the configuration.
2021-06-14blackbox: Pass around configuration as valuePatrick Steinhardt
We typically pass configuration structures around as a value instead of as a pointer to make the configuration immutable to the receiving side. One exemption to thi sis the blackbox code, where we pass it around as a pointer. Bring the code more in line with our own best practices and pass it as simple value.
2021-06-14blackbox: Make sleep duration privatePatrick Steinhardt
We have two representations of the sleep duration in the blackbox Config: once a normal integer which gets parsed from the config file, and once the converted `time.Duration`. Ideally, we'd have used a `time.Duration` from the inception such that it's possible to specify human-readable durations in the config file and not require any conversion, but that train has departed by now given that the gitaly-blackbox is already in use. While we cannot merge those two variables now, we can at least make the `SleepDuration` private to the package as it's not used anywhere else.
2021-06-14blackbox: Add missing documentationPatrick Steinhardt
The blackbox code is lacking some documentation on public symbols. Add it as required and remove the golang-ci exemptions.
2021-06-11Merge branch 'pks-drop-reference-transactions-feature-flag' into 'master'Toon Claes
featureflag: Remove reference transactions feature flag See merge request gitlab-org/gitaly!3575
2021-06-11featureflag: Remove reference transactions feature flagPatrick Steinhardt
Reference transactions have now been baking for several releases and is performing well. With backchannel voting having landed in release 13.12, the last blocker which has kept customers from deploying these has been removed. As a result, we can now finally drop the feature flag altogether and always enable reference transactions. Changelog: changed
2021-06-11Merge branch 'ml-test-with-feature-flags-enabled' into 'master'Patrick Steinhardt
Enable tx_config and tx_remote feature flags by default See merge request gitlab-org/gitaly!3572
2021-06-11Merge branch 'ash2k/upgrade-proto' into 'master'Patrick Steinhardt
Upgrade protoc, protobuf, gRPC, Go and gRPC protoc plugins See merge request gitlab-org/gitaly!3403
2021-06-11Fix issues in testsMikhail Mazurskiy
Changelog: changed
2021-06-11Fix linting issuesMikhail Mazurskiy
2021-06-11Embed Unimplemented* structsMikhail Mazurskiy