pax_global_header00006660000000000000000000000064146701067750014527gustar00rootroot0000000000000052 comment=f20bbadd404b57c776d1e8876cefd1ac29b03fb5 etcd-3.5.16/000077500000000000000000000000001467010677500125425ustar00rootroot00000000000000etcd-3.5.16/.github/000077500000000000000000000000001467010677500141025ustar00rootroot00000000000000etcd-3.5.16/.github/ISSUE_TEMPLATE.md000066400000000000000000000000711467010677500166050ustar00rootroot00000000000000 Please read https://etcd.io/docs/latest/reporting_bugs/ etcd-3.5.16/.github/ISSUE_TEMPLATE/000077500000000000000000000000001467010677500162655ustar00rootroot00000000000000etcd-3.5.16/.github/ISSUE_TEMPLATE/distributors-application.md000066400000000000000000000020121467010677500236400ustar00rootroot00000000000000--- name: Distributors Application title: Distributors Application for about: Apply for membership of security@etcd.io --- **Actively monitored security email alias for our project:** **1. Have a user base not limited to your own organization.** **2. Have a publicly verifiable track record up to present day of fixing security issues.** **3. Not be a downstream or rebuild of another distribution.** **4. Be a participant and active contributor in the community.** **5. Accept the Embargo Policy.** **6. Be willing to contribute back.** **7. Have someone already on the list vouch for the person requesting membership on behalf of your distribution.** etcd-3.5.16/.github/PULL_REQUEST_TEMPLATE.md000066400000000000000000000001321467010677500176770ustar00rootroot00000000000000 Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow. etcd-3.5.16/.github/SECURITY.md000066400000000000000000000001131467010677500156660ustar00rootroot00000000000000 Please read https://github.com/etcd-io/etcd/blob/main/security/README.md. etcd-3.5.16/.github/stale.yml000066400000000000000000000037041467010677500157410ustar00rootroot00000000000000# Configuration for probot-stale - https://github.com/probot/stale # Number of days of inactivity before an Issue or Pull Request becomes stale daysUntilStale: 90 # Number of days of inactivity before an Issue or Pull Request with the stale label is closed. # Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. daysUntilClose: 21 # Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled) onlyLabels: [] # Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable exemptLabels: - "area/security" - "Investigating" # Set to true to ignore issues in a project (defaults to false) exemptProjects: false # Set to true to ignore issues in a milestone (defaults to false) exemptMilestones: false # Set to true to ignore issues with an assignee (defaults to false) exemptAssignees: false # Label to use when marking as stale staleLabel: stale # Comment to post when marking as stale. Set to `false` to disable markComment: > This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions. # Comment to post when removing the stale label. # unmarkComment: > # Your comment here. # Comment to post when closing a stale Issue or Pull Request. # closeComment: > # Your comment here. # Limit the number of actions per hour, from 1-30. Default is 30 limitPerRun: 30 # Limit to only `issues` or `pulls` # only: issues # Optionally, specify configuration settings that are specific to just 'issues' or 'pulls': # pulls: # daysUntilStale: 30 # markComment: > # This pull request has been automatically marked as stale because it has not had # recent activity. It will be closed if no further activity occurs. Thank you # for your contributions. # issues: # exemptLabels: # - confirmed etcd-3.5.16/.github/workflows/000077500000000000000000000000001467010677500161375ustar00rootroot00000000000000etcd-3.5.16/.github/workflows/codeql-analysis.yml000066400000000000000000000046141467010677500217570ustar00rootroot00000000000000# For most projects, this workflow file will not need changing; you simply need # to commit it to your repository. # # You may wish to alter this file to override the set of languages analyzed, # or to provide custom queries or build logic. # # ******** NOTE ******** # We have attempted to detect the languages in your repository. Please check # the `language` matrix defined below to confirm you have the correct set of # supported CodeQL languages. # name: "CodeQL" on: push: branches: [ main, release-0.4, release-2.0, release-2.1, release-2.2, release-2.3, release-3.0, release-3.1 ] pull_request: # The branches below must be a subset of the branches above branches: [ main ] schedule: - cron: '20 14 * * 5' jobs: analyze: name: Analyze runs-on: ubuntu-latest strategy: fail-fast: false matrix: language: [ 'go' ] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] # Learn more: # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed steps: - name: Checkout repository uses: actions/checkout@v2 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v1 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. # By default, queries listed here will override any specified in a config file. # Prefix the list here with "+" to use these queries and those in the config file. # queries: ./path/to/local/query, your-org/your-repo/queries@main # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild uses: github/codeql-action/autobuild@v1 # â„šī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl # âœī¸ If the Autobuild fails above, remove it and uncomment the following three lines # and modify them (or add more) to build your code if your project # uses a compiled language #- run: | # make bootstrap # make release - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v1 etcd-3.5.16/.github/workflows/e2e.yaml000066400000000000000000000017441467010677500175040ustar00rootroot00000000000000name: E2E on: [push, pull_request] jobs: test: runs-on: ubuntu-latest strategy: fail-fast: true matrix: target: - linux-amd64-e2e - linux-386-e2e steps: - uses: actions/checkout@v2 - id: goversion run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT" - uses: actions/setup-go@v2 with: go-version: ${{ steps.goversion.outputs.goversion }} - run: date - env: TARGET: ${{ matrix.target }} run: | set -euo pipefail echo "${TARGET}" case "${TARGET}" in linux-amd64-e2e) make install-gofail CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' FAILPOINTS='true' make test-e2e-release ;; linux-386-e2e) GOARCH=386 CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' make test-e2e ;; *) echo "Failed to find target" exit 1 ;; esac etcd-3.5.16/.github/workflows/functional.yaml000066400000000000000000000014731467010677500211720ustar00rootroot00000000000000name: functional-tests on: [push, pull_request] jobs: test: runs-on: ubuntu-latest strategy: fail-fast: true matrix: target: - linux-amd64-functional steps: - uses: actions/checkout@v2 - id: goversion run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT" - uses: actions/setup-go@v2 with: go-version: ${{ steps.goversion.outputs.goversion }} - run: date - env: TARGET: ${{ matrix.target }} run: | set -euo pipefail echo "${TARGET}" case "${TARGET}" in linux-amd64-functional) GO_BUILD_FLAGS='-v -mod=readonly' ./build && GOARCH=amd64 PASSES='functional' ./test ;; *) echo "Failed to find target" exit 1 ;; esac etcd-3.5.16/.github/workflows/gh-workflow-approve.yaml000066400000000000000000000023141467010677500227430ustar00rootroot00000000000000--- name: Approve GitHub Workflows permissions: read-all on: pull_request_target: types: - labeled - synchronize jobs: approve: name: Approve ok-to-test if: contains(github.event.pull_request.labels.*.name, 'ok-to-test') runs-on: ubuntu-latest permissions: actions: write steps: - name: Update PR uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 continue-on-error: true with: github-token: ${{ secrets.GITHUB_TOKEN }} debug: ${{ secrets.ACTIONS_RUNNER_DEBUG == 'true' }} script: | const result = await github.rest.actions.listWorkflowRunsForRepo({ owner: context.repo.owner, repo: context.repo.repo, event: "pull_request", status: "action_required", head_sha: context.payload.pull_request.head.sha, per_page: 100 }); for (var run of result.data.workflow_runs) { await github.rest.actions.approveWorkflowRun({ owner: context.repo.owner, repo: context.repo.repo, run_id: run.id }); } etcd-3.5.16/.github/workflows/govuln.yaml000066400000000000000000000013271467010677500203400ustar00rootroot00000000000000--- name: Go Vulnerability Checker on: [push, pull_request] permissions: read-all jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - id: goversion run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT" - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: go-version: ${{ steps.goversion.outputs.goversion }} - run: date - run: | set -euo pipefail go install golang.org/x/vuln/cmd/govulncheck@latest find . -name go.mod | xargs -I'{}' /bin/bash -c 'echo scanning $(dirname {}); govulncheck -C $(dirname {}) -show verbose ./...' etcd-3.5.16/.github/workflows/grpcproxy.yaml000066400000000000000000000014511467010677500210610ustar00rootroot00000000000000name: grpcProxy-tests on: [push, pull_request] jobs: test: runs-on: ubuntu-latest strategy: fail-fast: true matrix: target: - linux-amd64-grpcproxy steps: - uses: actions/checkout@v2 - id: goversion run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT" - uses: actions/setup-go@v2 with: go-version: ${{ steps.goversion.outputs.goversion }} - run: date - env: TARGET: ${{ matrix.target }} run: | set -euo pipefail echo "${TARGET}" case "${TARGET}" in linux-amd64-grpcproxy) PASSES='build grpcproxy' CPU='4' COVER='false' RACE='true' ./test.sh ;; *) echo "Failed to find target" exit 1 ;; esac etcd-3.5.16/.github/workflows/release.yaml000066400000000000000000000044351467010677500204510ustar00rootroot00000000000000name: Release on: [push, pull_request] jobs: main: runs-on: ubuntu-latest steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - id: goversion run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT" - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: go-version: ${{ steps.goversion.outputs.goversion }} - name: release run: | set -euo pipefail git config --global user.email "github-action@etcd.io" git config --global user.name "Github Action" gpg --batch --gen-key <> "$GITHUB_OUTPUT" - uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 with: go-version: ${{ steps.goversion.outputs.goversion }} - run: | set -euo pipefail make verify - run: | set -euo pipefail make fix DIFF=$(git status --porcelain) if [ -n "$DIFF" ]; then echo "These files were modified:" echo echo "$DIFF" echo exit 1 fi etcd-3.5.16/.github/workflows/tests-template.yaml000066400000000000000000000052151467010677500220010ustar00rootroot00000000000000--- name: Reusable Tests Workflow on: workflow_call: inputs: arch: required: true type: string runs-on: required: true type: string targets: required: false type: string jobs: test: runs-on: ${{ inputs.runs-on }} # this is to prevent arm64 jobs from running at forked projects if: inputs.arch == 'amd64' || github.repository == 'etcd-io/etcd' strategy: fail-fast: false matrix: target: ${{ fromJSON(inputs.targets) }} steps: - uses: actions/checkout@v2 - id: goversion run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT" - uses: actions/setup-go@v2 with: go-version: ${{ steps.goversion.outputs.goversion }} - run: date - env: TARGET: ${{ matrix.target }} run: | set -euo pipefail echo "${TARGET}" case "${TARGET}" in linux-test-smoke) GOARCH=${{ inputs.arch }} CPU=4 RACE='false' make test-smoke ;; linux-integration-1-cpu) make install-gofail GOARCH=${{ inputs.arch }} CPU=1 RACE='false' FAILPOINTS='true' make test-integration ;; linux-integration-2-cpu) make install-gofail GOARCH=${{ inputs.arch }} CPU=2 RACE='false' FAILPOINTS='true' make test-integration ;; linux-integration-4-cpu) make install-gofail GOARCH=${{ inputs.arch }} CPU=4 RACE='false' FAILPOINTS='true' make test-integration ;; linux-unit-4-cpu-race) GOARCH=${{ inputs.arch }} RACE='true' CPU='4' GO_TEST_FLAGS='-p=2' make test-unit ;; linux-386-unit-1-cpu) GOOS=linux GOARCH=386 CPU=1 GO_TEST_FLAGS='-p=4' make test-unit ;; all-build) GOARCH=amd64 PASSES='build' ./test.sh GOARCH=386 PASSES='build' ./test.sh GO_BUILD_FLAGS='-v -mod=readonly' GOOS=darwin GOARCH=amd64 ./build.sh GO_BUILD_FLAGS='-v -mod=readonly' GOOS=darwin GOARCH=arm64 ./build.sh GO_BUILD_FLAGS='-v -mod=readonly' GOOS=windows GOARCH=amd64 ./build.sh GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=arm ./build.sh GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=arm64 ./build.sh GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=ppc64le ./build.sh GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=s390x ./build.sh ;; *) echo "Failed to find target" exit 1 ;; esac etcd-3.5.16/.github/workflows/tests.yaml000066400000000000000000000012631467010677500201670ustar00rootroot00000000000000name: Tests on: [push, pull_request] jobs: amd64: uses: ./.github/workflows/tests-template.yaml with: arch: amd64 runs-on: ubuntu-latest targets: "['linux-test-smoke', 'linux-integration-1-cpu', 'linux-integration-2-cpu', 'linux-integration-4-cpu', 'linux-unit-4-cpu-race', 'linux-386-unit-1-cpu', 'all-build']" arm64: uses: ./.github/workflows/tests-template.yaml with: arch: arm64 runs-on: actuated-arm64-8cpu-32gb targets: "['linux-test-smoke', 'linux-integration-1-cpu', 'linux-integration-2-cpu', 'linux-integration-4-cpu', 'linux-unit-4-cpu-race']" etcd-3.5.16/.gitignore000066400000000000000000000004421467010677500145320ustar00rootroot00000000000000/agent-* /coverage /covdir /gopath /gopath.proto /release /bin *.etcd *.log *.swp /etcd /hack/insta-discovery/.env *.coverprofile *.test hack/tls-setup/certs .idea /contrib/raftexample/raftexample /contrib/raftexample/raftexample-* /vendor /tests/e2e/default.proxy *.tmp *.bak .gobincache/ etcd-3.5.16/.go-version000066400000000000000000000000071467010677500146300ustar00rootroot000000000000001.22.7 etcd-3.5.16/.header000066400000000000000000000011211467010677500137660ustar00rootroot00000000000000// Copyright 2016 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. etcd-3.5.16/.words000066400000000000000000000024071467010677500137040ustar00rootroot00000000000000accessors addrConns args atomics backoff BackoffFunc BackoffLinearWithJitter Balancer BidiStreams blackhole blackholed CallOptions cancelable cancelation ccBalancerWrapper clientURLs clusterName cluster_proxy consistentIndex ConsistentIndexGetter DefaultMaxRequestBytes defragment defragmenting deleter dev /dev/null dev/null DNS errClientDisconnected ErrCodeEnhanceYourCalm ErrConnClosing ErrRequestTooLarge ErrTimeout etcd FIXME github GoAway goroutine goroutines gRPC grpcAddr hasleader healthcheck hostname iff inflight InfoLevel jitter jitter jitter keepalive Keepalive KeepAlive keepalives keyspace lexically lexicographically linearizable linearization linearized liveness localhost __lostleader MaxRequestBytes MiB middleware mutators mutex nils nondeterministically nop OutputWALDir parsedTarget passthrough PermitWithoutStream prefetching prometheus protobuf racey rafthttp rebalanced reconnection repin ResourceExhausted retriable retriable rpc RPC RPCs saveWALAndSnap serializable ServerStreams SHA SRV statusError subConn subconns SubConns teardown TestBalancerDoNotBlockOnClose todo too_many_pings transactional transferee transientFailure unbuffered uncontended unfreed unlisting unprefixed WatchProgressNotifyInterval WAL WithBackoff WithDialer WithMax WithRequireLeader etcd-3.5.16/CONTRIBUTING.md000066400000000000000000000064141467010677500150000ustar00rootroot00000000000000# How to contribute etcd is Apache 2.0 licensed and accepts contributions via GitHub pull requests. This document outlines some of the conventions on commit message formatting, contact points for developers, and other resources to help get contributions into etcd. # Email and chat - Email: [etcd-dev](https://groups.google.com/forum/?hl=en#!forum/etcd-dev) - IRC: #[etcd](irc://irc.freenode.org:6667/#etcd) IRC channel on freenode.org - Slack: [#etcd](https://kubernetes.slack.com/messages/C3HD8ARJ5/details/) ## Getting started - Fork the repository on GitHub - Read the README.md for build instructions ## Reporting bugs and creating issues Reporting bugs is one of the best ways to contribute. However, a good bug report has some very specific qualities, so please read over our short document on [reporting bugs](https://etcd.io/docs/latest/reporting_bugs) before submitting a bug report. This document might contain links to known issues, another good reason to take a look there before reporting a bug. ## Contribution flow This is a rough outline of what a contributor's workflow looks like: - Create a topic branch from where to base the contribution. This is usually main. - Make commits of logical units. - Make sure commit messages are in the proper format (see below). - Push changes in a topic branch to a personal fork of the repository. - Submit a pull request to etcd-io/etcd. - The PR must receive a LGTM from two maintainers found in the OWNERS file. Thanks for contributing! ### Code style The coding style suggested by the Golang community is used in etcd. See the [style doc](https://github.com/golang/go/wiki/CodeReviewComments) for details. Please follow this style to make etcd easy to review, maintain and develop. ### Format of the commit message We follow a rough convention for commit messages that is designed to answer two questions: what changed and why. The subject line should feature the what and the body of the commit should describe the why. ``` etcdserver: add grpc interceptor to log info on incoming requests To improve debuggability of etcd v3. Added a grpc interceptor to log info on incoming requests to etcd server. The log output includes remote client info, request content (with value field redacted), request handling latency, response size, etc. Uses zap logger if available, otherwise uses capnslog. Fixes #38 ``` The format can be described more formally as follows: ``` :