forked from etcd-io/etcd
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'openshift/openshift-4.12' into rebase-e…
…tcd-3.5.12-openshift-4.12
- Loading branch information
Showing
28 changed files
with
992 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
build_root_image: | ||
name: builder | ||
namespace: ocp | ||
tag: rhel-8-etcd-golang-1.16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Go version setup | ||
|
||
on: | ||
workflow_call: | ||
outputs: | ||
goversion: | ||
value: ${{ jobs.version.outputs.goversion }} | ||
|
||
jobs: | ||
version: | ||
name: Set Go version variable for all the workflows | ||
runs-on: ubuntu-latest | ||
outputs: | ||
goversion: ${{ steps.goversion.outputs.goversion }} | ||
steps: | ||
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | ||
- id: goversion | ||
run: | | ||
GO_VERSION=$(cat .go-version) | ||
echo "Go Version: $GO_VERSION" | ||
echo "goversion=$GO_VERSION" >> $GITHUB_OUTPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
approvers: | ||
- deads2k | ||
- hasbro17 | ||
- dusk125 | ||
- Elbehery | ||
- tjungblu | ||
reviewers: | ||
- deads2k | ||
- dusk125 | ||
- hasbro17 | ||
- Elbehery | ||
- tjungblu | ||
component: "Etcd" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
# Maintaining openshift/etcd | ||
|
||
OpenShift is based on upstream etcd. With every release of etcd that is | ||
intended to be shipped as OCP, it is necessary to incorporate the upstream changes | ||
while ensuring that our downstream customizations are maintained. | ||
|
||
## Maintaining this document | ||
|
||
An openshift/etcd rebase is a complex process involving many manual and | ||
potentially error-prone steps. If, while performing a rebase, you find areas where | ||
the documented procedure is unclear or missing detail, please update this document | ||
and include the change in the rebase PR. This will ensure that the instructions are | ||
as comprehensive and accurate as possible for the person performing the next | ||
rebase. | ||
|
||
## Getting started | ||
|
||
Before incorporating upstream changes you may want to: | ||
|
||
- Read this document | ||
- Find the best tool for resolving merge conflicts | ||
- Use diff3 conflict resolution strategy | ||
(https://blog.nilbus.com/take-the-pain-out-of-git-conflict-resolution-use-diff3/) | ||
- Teach Git to remember how you’ve resolved a conflict so that the next time it can | ||
resolve it automatically (https://git-scm.com/book/en/v2/Git-Tools-Rerere) | ||
|
||
## Preparing the local repo clone | ||
|
||
Clone from a personal fork of etcd via a pushable (ssh) url: | ||
|
||
``` | ||
git clone git@github.com:<user id>/etcd | ||
``` | ||
|
||
## Updating with `rebase.sh` | ||
|
||
To finally rebase, a script that will merge and rebase along the happy path without automatic conflict resolution and at the end will create a PR for you. | ||
|
||
Here are the steps: | ||
1. Create a new OCPBUGS JIRA ticket with the respective OpenShift version to rebase. Please include the change logs in the ticket description. You can clone a previous rebase we did in [OCPBUGS-947](https://issues.redhat.com/browse/OCPBUGS-947) and adjust. | ||
2. It's best to start off with a fresh fork of [openshift/etcd](https://github.com/openshift/etcd/). Stay on the master branch. | ||
3. This script requires `jq`, `git`, `podman` and `bash`. `gh` is optional. | ||
4. In the root dir of that fork run: | ||
``` | ||
openshift-hack/rebase.sh --etcd-tag=v3.5.4 --openshift-release=openshift-4.12 --jira-id=666 | ||
``` | ||
|
||
where `etcd-tag` is the [etcd-io/etcd](https://github.com/etcd-io/etcd/) release tag, the `openshift-release` | ||
is the OpenShift release branch in [openshift/etcd](https://github.com/openshift/etcd/) and the `jira-id` is the | ||
number of the OCPBUGS ticket created in step (1). | ||
|
||
5. In case of conflicts, it will ask you to step into another shell to resolve those. The script will continue by committing the resolution with `UPSTREAM: <drop>`. | ||
6. At the end, there will be a "rebase-$VERSION" branch pushed to your fork. | ||
7. If you have `gh` installed and are logged in, it will attempt to create a PR for you by opening a web browser. | ||
|
||
## Building and testing | ||
|
||
- Build the code with `make` | ||
- Test the code with `make test` | ||
|
||
## Payload testing | ||
|
||
After all the above are green and your PR pre-submits are too, you can start with payload testing. This is to ensure the nightly jobs won't break on etcd after the merge, they also test all of OpenShift (including upgrades) well enough. | ||
|
||
You should run those two: | ||
|
||
> /payload 4.x nightly informing | ||
> | ||
> /payload 4.x nightly blocking | ||
Replace 4.x with the respective OpenShift release you're merging against. | ||
|
||
It pays off to inspect some Prometheus metrics (CPU, memory, disk usage) with an upgrade job through PromeCIus. This is to ensure we don't increase resource usage inadvertently. | ||
|
||
## Testing with ClusterBot | ||
|
||
Sometimes it's easier to debug an issue using cluster bot. Here you can simply run the given OpenShift release using your rebase PR: | ||
|
||
> launch openshift/etcd#155 | ||
This is particularly helpful when you want to test specific providers, for example Bare Metal or VSphere, or just other variants like SNO. | ||
|
||
## Performance Testing | ||
|
||
We currently do not do performance testing after an etcd rebase in OpenShift, however the upstream community and [SIG Scalability in k/k does](https://github.com/etcd-io/etcd/issues/14138#issuecomment-1247665949). | ||
|
||
The OpenShift scalability team also regularly runs performance tests with upcoming 4.y.0 releases. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package clientv3 | ||
|
||
import ( | ||
"context" | ||
pb "go.etcd.io/etcd/api/v3/etcdserverpb" | ||
) | ||
|
||
// NonLinearizeableMemberLister is used by the discover-etcd-initial-cluster command to get a list of members to ensure that *this* | ||
// member has been added to the list. This is needed on restart scenarios when there isn't quorum. We need the first | ||
// two etcd servers to start without quorum having been established by finding themselves in the member list and moving | ||
// past the gate. | ||
type NonLinearizeableMemberLister interface { | ||
// NonLinearizeableMemberList is like MemberList only without linearization. | ||
NonLinearizeableMemberList(ctx context.Context) (*MemberListResponse, error) | ||
} | ||
|
||
func (c *cluster) NonLinearizeableMemberList(ctx context.Context) (*MemberListResponse, error) { | ||
// it is safe to retry on list. | ||
resp, err := c.remote.MemberList(ctx, &pb.MemberListRequest{}, c.callOpts...) | ||
if err == nil { | ||
return (*MemberListResponse)(resp), nil | ||
} | ||
return nil, toErr(ctx, err) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.