{"owner":"etcd-io","repo":"etcd","hasSkills":true,"totalSkillsCount":8,"totalTokensCount":7247,"categories":["plugin-manifest","anthropic-skill"],"hasMcp":false,"mcpConfig":null,"found":["tools/container-images/README.md","tools/local-tester/README.md","tools/etcd-dump-metrics/README.md","tools/benchmark/README.md","tools/etcd-dump-db/README.md","tools/.golangci.yaml","tools/etcd-dump-logs/README.md","tools/rw-heatmaps/README.md"],"skills":{"tools/container-images/README.md":"# Container Images\n\nThe container images defined in this directory are used to maintain\ndepenendencies up to date. **These images are not used to build the project.**\n\nThese images cause [Dependabot] to do a version bump. After that, a [GitHub\naction] will update other artifacts in the repository.\n\n[Dependabot]: ../../.github/dependabot.yml\n[GitHub action]: ../../.github/workflows/bump-devcontainer-version.yml\n","tools/local-tester/README.md":"# etcd local-tester\n\n> [!WARNING]\n> etcd-local-tester is now deprecated in favor of our much more comprehensive [robustness testing suite](https://github.com/etcd-io/etcd/tree/main/tests/robustness). In a future etcd release this historic tool will be removed as it is no longer maintained.\n\nThe etcd local-tester runs a fault injected cluster using local processes. It sets up an etcd cluster with unreliable network bridges on its peer and client interfaces. The cluster runs with a constant stream of `Put` requests to simulate client usage. A fault injection script periodically kills cluster members and disrupts bridge connectivity.\n\n# Requirements\n\nlocal-tester depends on `goreman` to manage its processes and `bash` to run fault injection.\n\n# Building\n\nlocal-tester needs `etcd`, `benchmark`, and `bridge` binaries. To build these binaries, run the following from the etcd repository root:\n\n```sh\n./scripts/build.sh\npushd tools/benchmark/ && go build && popd\npushd tools/local-tester/bridge && go build && popd\n```\n\n# Running\n\nThe fault injected cluster is invoked with `goreman`:\n\n```sh\ngoreman -f tools/local-tester/Procfile start\n```\n","tools/etcd-dump-metrics/README.md":"# etcd-dump-metrics\n\n `etcd-dump-metrics` provides metrics for the latest main branch, a given endpoint, or version.\n\n## Installation\n\nInstall the tool by running the following command from the etcd source directory.\n\n```\n  $ go install -v ./tools/etcd-dump-metrics\n```\n\nThe installation will place executables in the $GOPATH/bin. If $GOPATH environment variable is not set, the tool will be\ninstalled into the $HOME/go/bin. You can also find out the installed location by running the following command from the\netcd source directory. Make sure that $PATH is set accordingly in your environment.\n\n```\n  $ go list -f \"{{.Target}}\" ./tools/etcd-dump-metrics\n```\n\nAlternatively, instead of installing the tool, you can use it by simply running the following command from the etcd source\ndirectory.\n\n```\n  $ go run ./tools/etcd-dump-metrics\n```\n\n## Usage\n\nThe following command should output the usage per the latest development.\n\n```\n  $ etcd-dump-metrics --help\n```\n\nAn example of usage detail is provided below.\n\n### For the latest main branch\n```\n  $ etcd-dump-metrics\n```\n\n### For the provided endpoint\n```\n  $ goreman start\n  $ etcd-dump-metrics --addr http://localhost:2379/metrics\n```\n\n### Download specific version to temporary directory to fetch metrics\n```\n  $ etcd-dump-metrics --debug --download-ver v3.5.3\n  $ etcd-dump-metrics --download-ver v3.5.3\n```\n","tools/benchmark/README.md":"# etcd/tools/benchmark\n\n`etcd/tools/benchmark` is the official benchmarking tool for etcd clusters.\n\n## Installation\n\nInstall the tool by running the following command from the etcd source directory.\n\n```\n  $ go install -v ./tools/benchmark\n```\n\nThe installation will place executables in the $GOPATH/bin. If $GOPATH environment variable is not set, the tool will be installed into the $HOME/go/bin. You can also find out the installed location by running the following command from the etcd source directory. Make sure that $PATH is set accordingly in your environment.\n\n```\n  $ go list -f \"{{.Target}}\" ./tools/benchmark\n```\n\nAlternatively, instead of installing the tool, you can use it by simply running the following command from the etcd source directory.\n\n```\n  $ go run ./tools/benchmark\n```\n\n## Usage\n\nThe following command should output the usage per the latest development.\n\n```\n  $ benchmark --help\n```\n","tools/etcd-dump-db/README.md":"# etcd-dump-db\n\n`etcd-dump-db` inspects etcd db files.\n\n## Installation\n\nInstall the tool by running the following command from the etcd source directory.\n\n```\n  $ go install -v ./tools/etcd-dump-db\n```\n\nThe installation will place executables in the $GOPATH/bin. If $GOPATH environment variable is not set, the tool will be installed into the $HOME/go/bin. You can also find out the installed location by running the following command from the etcd source directory. Make sure that $PATH is set accordingly in your environment.\n\n```\n  $ go list -f \"{{.Target}}\" ./tools/etcd-dump-db\n```\n\nAlternatively, instead of installing the tool, you can use it by simply running the following command from the etcd source directory.\n\n```\n  $ go run ./tools/etcd-dump-db\n```\n\n## Usage\n\nThe following command should output the usage per the latest development.\n\n```\n  $ etcd-dump-db --help\n```\n\nAn example of usage detail is provided below.\n\n```\nUsage:\n  etcd-dump-db [command]\n\nAvailable Commands:\n  list-bucket    bucket lists all buckets.\n  iterate-bucket iterate-bucket lists key-value pairs in reverse order.\n  hash           hash computes the hash of db file.\n\nFlags:\n  -h, --help[=false]: help for etcd-dump-db\n\nUse \"etcd-dump-db [command] --help\" for more information about a command.\n```\n\n\n#### list-bucket [data dir or db file path]\n\nLists all buckets.\n\n```\n$ etcd-dump-db list-bucket agent01/agent.etcd\n\nalarm\nauth\nauthRoles\nauthUsers\ncluster\nkey\nlease\nmembers\nmembers_removed\nmeta\n```\n\n\n#### hash [data dir or db file path]\n\nComputes the hash of db file.\n\n```\n$ etcd-dump-db hash agent01/agent.etcd\ndb path: agent01/agent.etcd/member/snap/db\nHash: 3700260467\n\n\n$ etcd-dump-db hash agent02/agent.etcd\n\ndb path: agent02/agent.etcd/member/snap/db\nHash: 3700260467\n\n\n$ etcd-dump-db hash agent03/agent.etcd\n\ndb path: agent03/agent.etcd/member/snap/db\nHash: 3700260467\n```\n\n\n#### iterate-bucket [data dir or db file path]\n\nLists key-value pairs in reverse order.\n\n```\n$ etcd-dump-db iterate-bucket agent03/agent.etcd key --limit 3\n\nkey=\"\\x00\\x00\\x00\\x00\\x005@x_\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\tt\", value=\"\\n\\x153640412599896088633_9\"\nkey=\"\\x00\\x00\\x00\\x00\\x005@x_\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\bt\", value=\"\\n\\x153640412599896088633_8\"\nkey=\"\\x00\\x00\\x00\\x00\\x005@x_\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\at\", value=\"\\n\\x153640412599896088633_7\"\n```\n\n#### scan-keys [data dir or db file path]\n\nScans all the key-value pairs starting from a specific revision in the key space. It works even the db is corrupted.\n\n```\n$ ./etcd-dump-db scan-keys ~/tmp/etcd/778/db.db 16589739 2>/dev/null | grep \"/registry/configmaps/istio-system/istio-namespace-controller-election\"\npageID=1306, index=5/5, rev={Revision:{Main:16589739 Sub:0} tombstone:false}, value=[key \"/registry/configmaps/istio-system/istio-namespace-controller-election\" | val \"k8s\\x00\\n\\x0f\\n\\x02v1\\x12\\tConfigMap\\x12\\xeb\\x03\\n\\xe8\\x03\\n#istio-namespace-controller-election\\x12\\x00\\x1a\\fistio-system\\\"\\x00*$bb696087-260d-4167-bf06-17d3361f9b5f2\\x008\\x00B\\b\\b\\x9e\\xbe\\xed\\xb5\\x06\\x10\\x00b\\xe6\\x01\\n(control-plane.alpha.kubernetes.io/leader\\x12\\xb9\\x01{\\\"holderIdentity\\\":\\\"istiod-d56968787-txq2d\\\",\\\"holderKey\\\":\\\"default\\\",\\\"leaseDurationSeconds\\\":30,\\\"acquireTime\\\":\\\"2024-08-13T13:26:54Z\\\",\\\"renewTime\\\":\\\"2024-08-27T06:16:13Z\\\",\\\"leaderTransitions\\\":0}\\x8a\\x01\\x90\\x01\\n\\x0fpilot-discovery\\x12\\x06Update\\x1a\\x02v1\\\"\\b\\b\\xad\\u07b5\\xb6\\x06\\x10\\x002\\bFieldsV1:[\\nY{\\\"f:metadata\\\":{\\\"f:annotations\\\":{\\\".\\\":{},\\\"f:control-plane.alpha.kubernetes.io/leader\\\":{}}}}B\\x00\\x1a\\x00\\\"\\x00\" | created 9612546 | mod 16589739 | ver 157604]\npageID=4737, index=4/4, rev={Revision:{Main:16589786 Sub:0} tombstone:false}, value=[key \"/registry/configmaps/istio-system/istio-namespace-controller-election\" | val \"k8s\\x00\\n\\x0f\\n\\x02v1\\x12\\tConfigMap\\x12\\xeb\\x03\\n\\xe8\\x03\\n#istio-namespace-controller-election\\x12\\x00\\x1a\\fistio-system\\\"\\x00*$bb696087-260d-4167-bf06-17d3361f9b5f2\\x008\\x00B\\b\\b\\x9e\\xbe\\xed\\xb5\\x06\\x10\\x00b\\xe6\\x01\\n(control-plane.alpha.kubernetes.io/leader\\x12\\xb9\\x01{\\\"holderIdentity\\\":\\\"istiod-d56968787-txq2d\\\",\\\"holderKey\\\":\\\"default\\\",\\\"leaseDurationSeconds\\\":30,\\\"acquireTime\\\":\\\"2024-08-13T13:26:54Z\\\",\\\"renewTime\\\":\\\"2024-08-27T06:16:21Z\\\",\\\"leaderTransitions\\\":0}\\x8a\\x01\\x90\\x01\\n\\x0fpilot-discovery\\x12\\x06Update\\x1a\\x02v1\\\"\\b\\b\\xb5\\u07b5\\xb6\\x06\\x10\\x002\\bFieldsV1:[\\nY{\\\"f:metadata\\\":{\\\"f:annotations\\\":{\\\".\\\":{},\\\"f:control-plane.alpha.kubernetes.io/leader\\\":{}}}}B\\x00\\x1a\\x00\\\"\\x00\" | created 9612546 | mod 16589786 | ver 157605]\n```","tools/.golangci.yaml":"---\nversion: \"2\"\nlinters:\n  default: none\n  enable: # please keep this alphabetized\n    - errorlint\n    - goheader\n    - govet\n    - ineffassign\n    - misspell\n    - nakedret\n    - revive\n    - staticcheck\n    - testifylint\n    - thelper\n    - unconvert # Remove unnecessary type conversions\n    - unparam\n    - unused\n    - usestdlibvars\n    - usetesting\n    - whitespace\n  settings:\n    goheader:\n      values:\n        regexp:\n          ORIGINAL_YEAR: 20[1-2][0-9]\n      template: |-\n        Copyright {{ORIGINAL_YEAR}} The etcd Authors\n\n        Licensed under the Apache License, Version 2.0 (the \"License\");\n        you may not use this file except in compliance with the License.\n        You may obtain a copy of the License at\n\n            http://www.apache.org/licenses/LICENSE-2.0\n\n        Unless required by applicable law or agreed to in writing, software\n        distributed under the License is distributed on an \"AS IS\" BASIS,\n        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n        See the License for the specific language governing permissions and\n        limitations under the License.\n    govet:\n      enable:\n        - shadow\n    nakedret:\n      # Align with https://github.com/alexkohler/nakedret/blob/v1.0.2/cmd/nakedret/main.go#L10\n      max-func-lines: 5\n    revive:\n      confidence: 0.8\n      rules:\n        - name: blank-imports\n        - name: context-as-argument\n        - name: context-keys-type\n        - name: dot-imports\n        - name: early-return\n          arguments:\n            - preserveScope\n        - name: error-return\n        - name: error-naming\n        - name: error-strings\n        - name: errorf\n        - name: if-return\n        - name: increment-decrement\n        - name: indent-error-flow\n        - name: package-comments\n        - name: range\n        - name: receiver-naming\n        - name: superfluous-else\n          arguments:\n            - preserveScope\n        - name: time-naming\n        - name: unnecessary-stmt\n        - name: use-any\n        - name: var-declaration\n        - name: var-naming\n          arguments:\n            # The following is the configuration for var-naming rule, the first element is the allow list and the second element is the deny list.\n            - [] # AllowList: leave it empty to use the default (empty, too). This means that we're not relaxing the rule in any way, i.e. elementId will raise a violation, it should be elementID, refer to the next line to see the list of denied initialisms.\n            # DenyList: Add GRPC and WAL to strict the rule not allowing instances like Wal or Grpc. The default values are located at commonInitialisms, refer to: https://github.com/mgechev/revive/blob/v1.3.7/lint/utils.go#L93-L133.\n            - - GRPC\n              - WAL\n            # Disable checks on package names that collide with Go standard library packages. See example error:\n            #    var-naming: avoid package names that conflict with Go standard library package names (revive)\n            - - skip-package-name-collision-with-go-std: true\n        - name: exported\n          disabled: true\n        - name: unexported-return\n          disabled: true\n    staticcheck:\n      checks:\n        - all\n        - -SA2002 # TODO(fix) Called testing.T.FailNow or SkipNow in a goroutine, which isn’t allowed\n        - -QF1001 # TODO(fix) Apply De Morgan’s law\n        - -QF1002 # TODO(fix) Convert untagged switch to tagged switch\n        - -QF1003 # TODO(fix) Convert if/else-if chain to tagged switch\n        - -QF1004 # TODO(fix) Use strings.ReplaceAll instead of strings.Replace with n == -1\n        - -QF1006 # TODO(fix) Lift if+break into loop condition\n        - -QF1008 # TODO(fix) Omit embedded fields from selector expression\n        - -QF1009 # TODO(fix) Use time.Time.Equal instead of == operator\n        - -QF1012 # TODO(fix) Use fmt.Fprintf(x, ...) instead of x.Write(fmt.Sprintf(...))\n        - -ST1003 # TODO(fix) Poorly chosen identifier\n        - -ST1005 # TODO(fix) Drop unnecessary use of the blank identifier\n        - ST1019 # Importing the same package multiple times.\n    testifylint:\n      enable-all: true\n      formatter:\n        # Require f-assertions (e.g. assert.Equalf) if a message is passed to the assertion, even if\n        # there is no variable-length variables, i.e. require require.NoErrorf for both cases below:\n        # require.NoErrorf(t, err, \"whatever message\")\n        # require.NoErrorf(t, err, \"whatever message: %v\", v)\n        #\n        # Note from golang programming perspective, we still prefer non-f-functions (i.e. fmt.Print)\n        # to f-functions (i.e. fmt.Printf) when there is no variable-length parameters. It's accepted\n        # to always require f-functions for stretchr/testify, but not for golang standard lib.\n        # Also refer to https://github.com/etcd-io/etcd/pull/18741#issuecomment-2422395914\n        require-f-funcs: true\n    thelper:\n      test:\n        first: false\n        begin: false\n      fuzz:\n        first: false\n        begin: false\n      benchmark:\n        first: false\n        begin: false\n      tb:\n        first: false\n        begin: false\n    usetesting:\n      os-mkdir-temp: false\n  exclusions:\n    generated: lax\n    presets:\n      - comments\n      - common-false-positives\n      - legacy\n      - std-error-handling\n    rules:\n      - linters:\n          - ineffassign\n        path: conversion\\.go\n      - linters:\n          - staticcheck\n        text: S1000\n      - linters:\n          - revive\n        text: 'var-naming: avoid meaningless package names'\n    paths:\n      - ^zz_generated.*\n      - third_party$\n      - builtin$\n      - examples$\nissues:\n  max-same-issues: 0\nformatters:\n  enable:\n    - gci\n    - gofmt\n    - goimports\n  settings: # please keep this alphabetized\n    gci:\n      sections:\n        - standard\n        - default\n        - prefix(go.etcd.io)\n    goimports:\n      local-prefixes:\n        - go.etcd.io # Put imports beginning with prefix after 3rd-party packages.\n  exclusions:\n    generated: lax\n    paths:\n      - ^zz_generated.*\n      - third_party$\n      - builtin$\n      - examples$\n","tools/etcd-dump-logs/README.md":"# etcd-dump-logs\n\n`etcd-dump-logs` dumps the log from data directory.\n\n## Installation\n\nInstall the tool by running the following command from the etcd source directory.\n\n```bash\n  $ go install -v ./tools/etcd-dump-logs\n```\n\nThe installation will place executables in the $GOPATH/bin. If $GOPATH environment variable is not set, the tool will be installed into the $HOME/go/bin. You can also find out the installed location by running the following command from the etcd source directory. Make sure that $PATH is set accordingly in your environment.\n\n```bash\n  $ go list -f \"{{.Target}}\" ./tools/etcd-dump-logs\n```\n\nAlternatively, instead of installing the tool, you can use it by simply running the following command from the etcd source directory.\n\n```bash\n  $ go run ./tools/etcd-dump-logs\n```\n\n## Usage\n\nThe following command should output the usage per the latest development.\n\n```bash\n  $ etcd-dump-logs --help\n```\n\nAn example of usage detail is provided below.\n\n```bash\nUsage:\n\n  etcd-dump-logs [data dir]\n    * Data dir is where the snapshots and WAL logs are located. The structure of the data dir should look like this:\n        - data_dir/member\n            - data_dir/member/snap\n            - data_dir/member/wal\n                - data_dir/member/wal/0000000000000000-0000000000000000.wal\n\nFlags:\n  -end-index uint\n      The index to stop dumping (exclusive) (default 18446744073709551615)\n  -entry-type string\n      If set, filters output by entry type. Must be one or more than one of:\n      ConfigChange, Normal, Request, InternalRaftRequest,\n      IRRRange, IRRPut, IRRDeleteRange, IRRTxn,\n      IRRCompaction, IRRLeaseGrant, IRRLeaseRevoke, IRRLeaseCheckpoint (default \"Normal,ConfigChange\")\n  -raw\n      Read the logs in the low-level form\n  -start-index uint\n      The index to start dumping (inclusive). If unspecified, dumps from the index of the last snapshot.\n  -stream-decoder string\n      The name of an executable decoding tool, the executable must process\n      hex encoded lines of binary input (from etcd-dump-logs)\n      and output a hex encoded line of binary for each input line\n  -wal-dir string\n      If set, dumps WAL from the informed path, rather than following the standard 'data_dir/member/wal/' location\n```\n\n#### etcd-dump-logs -entry-type <ENTRY_TYPE_NAME(S)> [data dir]\n\nFilter entries by type from WAL log.\n\n```bash\n$ etcd-dump-logs -entry-type IRRTxn /tmp/datadir\nSnapshot:\nempty\nStart dupmping log entries from snapshot.\nWAL metadata:\nnodeID=0 clusterID=0 term=0 commitIndex=0 vote=0\nWAL entries:\nlastIndex=34\nterm         index  type    data\n   7            13  norm    ID:8 txn:<success:<request_delete_range:<key:\"a\" range_end:\"k8s\\000\\n\\025\\n\\002v1\\022\\017RangeAllocation\\022#\\n\\022\\n\\000\\022\\000\\032\\000\\\"\\000*\\0002\\0008\\000B\\000z\\000\\022\\01310.0.0.0/16\\032\\000\\032\\000\\\"\\000\" > > failure:<request_delete_range:<key:\"a\" range_end:\"k8s\\000\\n\\025\\n\\002v1\\022\\017RangeAllocation\\022#\\n\\022\\n\\000\\022\\000\\032\\000\\\"\\000*\\0002\\0008\\000B\\000z\\000\\022\\01310.0.0.0/16\\032\\000\\032\\000\\\"\\000\" > > >\n\nEntry types (IRRTxn) count is : 1\n\n$ etcd-dump-logs -entry-type ConfigChange,IRRCompaction /tmp/datadir\nSnapshot:\nempty\nStart dupmping log entries from snapshot.\nWAL metadata:\nnodeID=0 clusterID=0 term=0 commitIndex=0 vote=0\nWAL entries:\nlastIndex=34\nterm         index  type    data\n   1             1  conf    method=ConfChangeAddNode id=2\n   2             2  conf    method=ConfChangeRemoveNode id=2\n   2             3  conf    method=ConfChangeUpdateNode id=2\n   2             4  conf    method=ConfChangeAddLearnerNode id=3\n   8            14  norm    ID:9 compaction:<physical:true >\n\nEntry types (ConfigChange,IRRCompaction) count is : 5\n```\n\n#### etcd-dump-logs -stream-decoder <EXECUTABLE_DECODER> [data dir]\n\nDecode each entry based on logic in the passed decoder. Decoder status and decoded data are listed in separated tab/columns in the output. For parsing purpose, the output from decoder are expected to be in format of \"<DECODER_STATUS>|<DECODED_DATA>\". Please refer to [decoder_correctoutputformat.sh] as an example.\n\nHowever, if the decoder output format is not as expected, \"decoder_status\" will be \"decoder output format is not right, print output anyway\", and all output from decoder will be considered as \"decoded_data\"\n\n```bash\n$ etcd-dump-logs -stream-decoder decoder_correctoutputformat.sh  /tmp/datadir\nSnapshot:\nempty\nStart dupmping log entries from snapshot.\nWAL metadata:\nnodeID=0 clusterID=0 term=0 commitIndex=0 vote=0\nWAL entries:\nlastIndex=34\nterm         index  type    data    decoder_status    decoded_data\n   1             1  conf    method=ConfChangeAddNode id=2    ERROR    jhjaajjjahjbbbjj\n   3             2  norm    noop    OK    jhjjabjjaajfbfgjfagdfhcjbbahgbbbfhfegibbcabbfhffbbbcbbfhfibbcaebbbgiffbbedgdbhjacbjjchjjdjjjdhjiejjjehjafjjjfhjjgjjjghjahjjajjhhjajj\n   3             3  norm    method=QGET path=\"/path1\"    OK    jhjaabjdeadgdeedaajfbfgjfagdfhcabbacgbbbcjbbcabbcabbbcbbcbbbcaebbbccbbedgdbhjjcbjjchjjdjjjdhjiejjjehjafjjjfhjjgjjjghjahjjajjhhjajj\n   7             4  norm    ID:8 txn:<success:<request_delete_range:<key:\"a\" range_end:\"b\" > > failure:<request_delete_range:<key:\"a\" range_end:\"b\" > > >     OK    jhjhcbadabjhaajfjajafaabjafbaajhaajfjajafaabjafb\n   8             5  norm    ID:9 compaction:<physical:true >     ERROR    jhjicajbajja\n   9             6  norm    ID:10 lease_grant:<TTL:1 ID:1 >     ERROR    jhjadbjdjhjaajja\n  12             7  norm    ID:13 auth_enable:<>   ERROR    jhjdcbcejj\n  27             8  norm    ??? ERROR  cf\nEntry types () count is : 8\n```\n\n```bash\n$ etcd-dump-logs -stream-decoder decoder_wrongoutputformat.sh  /tmp/datadir\nSnapshot:\nempty\nStart dupmping log entries from snapshot.\nWAL metadata:\nnodeID=0 clusterID=0 term=0 commitIndex=0 vote=0\nWAL entries:\nlastIndex=34\nterm         index  type    data    decoder_status  decoded_data\n   1             1  conf    method=ConfChangeAddNode id=2   decoder output format is not right, print output anyway jhjaajjjahjbbbjj\n   3             2  norm    noop    decoder output format is not right, print output anyway jhjjabjjaajfbfgjfagdfhcjbbahgbbbfhfegibbcabbfhffbbbcbbfhfibbcaebbbgiffbbedgdbhjacbjjchjjdjjjdhjiejjjehjafjjjfhjjgjjjghjahjjajjhhjajj\n   3             3  norm    method=QGET path=\"/path1\"    decoder output format is not right, print output anyway    jhjaabjdeadgdeedaajfbfgjfagdfhcabbacgbbbcjbbcabbcabbbcbbcbbbcaebbbccbbedgdbhjjcbjjchjjdjjjdhjiejjjehjafjjjfhjjgjjjghjahjjajjhhjajj\n   7             4  norm    ID:8 txn:<success:<request_delete_range:<key:\"a\" range_end:\"b\" > > failure:<request_delete_range:<key:\"a\" range_end:\"b\" > > >   decoder output format is not right, print output anyway jhjhcbadabjhaajfjajafaabjafbaajhaajfjajafaabjafb\n   8             5  norm    ID:9 compaction:<physical:true >     decoder output format is not right, print output anyway    jhjicajbajja\n   9             6  norm    ID:10 lease_grant:<TTL:1 ID:1 >     decoder output format is not right, print output anyway jhjadbjdjhjaajja\n  12             7  norm    ID:13 auth_enable:<>   decoder output format is not right, print output anyway  jhjdcbcejj\n  27             8  norm    ??? decoder output format is not right, print output anyway cf\nEntry types () count is : 8\n\n```\n\n#### `etcd-dump-logs -start-index <INDEX NUMBER> [data dir]`\n\nOnly shows WAL log entries after the specified start-index number, inclusively.\n\n```bash\n$ etcd-dump-logs -start-index 31  /tmp/datadir\nStart dumping log entries from index 31.\nWAL metadata:\nnodeID=0 clusterID=0 term=0 commitIndex=0 vote=0\nWAL entries:\nlastIndex=34\nterm         index  type    data\n  25            31  norm    ID:26 auth_role_get:<role:\"role3\" >\n  26            32  norm    ID:27 auth_role_grant_permission:<name:\"role3\" perm:<permType:WRITE key:\"Keys\" range_end:\"RangeEnd\" > >\n  27            33  norm    ID:28 auth_role_revoke_permission:<role:\"role3\" key:\"key\" range_end:\"rangeend\" >\n  27            34  norm    ???\nEntry types () count is : 4\n```\n\n#### `etcd-dump-logs -start-index <INDEX NUMBER> -end-index <INDEX NUMBER> [data dir]`\n\nOnly shows WAL log entries from the specified start-index number (inclusively) to the specified end-index number (exclusively).\n\n```bash\n$ etcd-dump-logs -start-index 930 -end-index 932  /tmp/datadir\nStart dumping log entries from index 930.\nWAL metadata:\nnodeID=0 clusterID=0 term=5 commitIndex=2448 vote=0\nWAL entries: 2\nlastIndex=931\nterm       index    type    data\n   3         930    norm    header:<ID:11010058442592651283 > put:<key:\"key7\" value:\"923\" >\n   3         931    norm    header:<ID:6577953459306661672 > put:<key:\"key8\" value:\"924\" >\n\nEntry types (Normal,ConfigChange) count is : 2\n```\n\n[decoder_correctoutputformat.sh]: ./testdecoder/decoder_correctoutputformat.sh\n","tools/rw-heatmaps/README.md":"# etcd/tools/rw-heatmaps\n\n`etcd/tools/rw-heatmaps` is the mixed read/write performance evaluation tool for etcd clusters.\n\n## Installation\n\nInstall the tool by running the following command from the etcd source directory.\n\n```sh\n  $ go install -v ./tools/rw-heatmaps\n```\n\nThe installation will place executables in the $GOPATH/bin. If $GOPATH environment variable is not set, the tool will be installed into the $HOME/go/bin. You can also find out the installed location by running the following command from the etcd source directory. Make sure that $PATH is set accordingly in your environment.\n\n```sh\n  $ go list -f \"{{.Target}}\" ./tools/rw-heatmaps\n```\n\nAlternatively, instead of installing the tool, you can use it by simply running the following command from the etcd source directory.\n\n```sh\n  $ go run ./tools/rw-heatmaps\n```\n\n## Execute\n\n### Benchmark\n\nTo get a mixed read/write performance evaluation result:\n```sh\n  # run with default configurations and specify the working directory\n  $ ./rw-benchmark.sh -w ${WORKING_DIR}\n```\n`rw-benchmark.sh` will automatically use the etcd binary compiled under `etcd/bin/` directory.\n\nNote: the result CSV file will be saved to current working directory. The working directory is where etcd database is saved. The working directory is designed for scenarios where a different mounted disk is preferred.\n\n### Plot Graphs\n\nTo generate two images (read and write) based on the benchmark result CSV file:\n\n```sh\n  # to generate a pair of read & write images from one data csv file\n  $ rw-heatmaps ${CSV_FILE} -t ${IMAGE_TITLE} -o ${OUTPUT_IMAGE_NAME}\n```\n\nTo generate two images (read and write) showing the performance difference from two result CSV files:\n\n```sh\n  # to generate a pair of read & write images from one data csv file\n  $ rw-heatmaps ${CSV_FILE1} ${CSV_FILE2} -t ${IMAGE_TITLE} -o ${OUTPUT_IMAGE_NAME}\n```\n\nTo see the available options use the `--help` option.\n\n```sh\n  $ rw-heatmaps --help\n\nrw-heatmaps is a tool to generate read/write heatmaps images for etcd3.\n\nUsage:\n  rw-heatmaps [input file(s) in csv format] [flags]\n\nFlags:\n  -h, --help                       help for rw-heatmaps\n  -f, --output-format string       output image file format (default \"jpg\")\n  -o, --output-image-file string   output image filename (required)\n  -t, --title string               plot graph title (required)\n      --zero-centered              plot the improvement graph with white color represents 0.0 (default true)\n```\n"},"files":{"tools/container-images/README.md":"# Container Images\n\nThe container images defined in this directory are used to maintain\ndepenendencies up to date. **These images are not used to build the project.**\n\nThese images cause [Dependabot] to do a version bump. After that, a [GitHub\naction] will update other artifacts in the repository.\n\n[Dependabot]: ../../.github/dependabot.yml\n[GitHub action]: ../../.github/workflows/bump-devcontainer-version.yml\n","tools/local-tester/README.md":"# etcd local-tester\n\n> [!WARNING]\n> etcd-local-tester is now deprecated in favor of our much more comprehensive [robustness testing suite](https://github.com/etcd-io/etcd/tree/main/tests/robustness). In a future etcd release this historic tool will be removed as it is no longer maintained.\n\nThe etcd local-tester runs a fault injected cluster using local processes. It sets up an etcd cluster with unreliable network bridges on its peer and client interfaces. The cluster runs with a constant stream of `Put` requests to simulate client usage. A fault injection script periodically kills cluster members and disrupts bridge connectivity.\n\n# Requirements\n\nlocal-tester depends on `goreman` to manage its processes and `bash` to run fault injection.\n\n# Building\n\nlocal-tester needs `etcd`, `benchmark`, and `bridge` binaries. To build these binaries, run the following from the etcd repository root:\n\n```sh\n./scripts/build.sh\npushd tools/benchmark/ && go build && popd\npushd tools/local-tester/bridge && go build && popd\n```\n\n# Running\n\nThe fault injected cluster is invoked with `goreman`:\n\n```sh\ngoreman -f tools/local-tester/Procfile start\n```\n","tools/etcd-dump-metrics/README.md":"# etcd-dump-metrics\n\n `etcd-dump-metrics` provides metrics for the latest main branch, a given endpoint, or version.\n\n## Installation\n\nInstall the tool by running the following command from the etcd source directory.\n\n```\n  $ go install -v ./tools/etcd-dump-metrics\n```\n\nThe installation will place executables in the $GOPATH/bin. If $GOPATH environment variable is not set, the tool will be\ninstalled into the $HOME/go/bin. You can also find out the installed location by running the following command from the\netcd source directory. Make sure that $PATH is set accordingly in your environment.\n\n```\n  $ go list -f \"{{.Target}}\" ./tools/etcd-dump-metrics\n```\n\nAlternatively, instead of installing the tool, you can use it by simply running the following command from the etcd source\ndirectory.\n\n```\n  $ go run ./tools/etcd-dump-metrics\n```\n\n## Usage\n\nThe following command should output the usage per the latest development.\n\n```\n  $ etcd-dump-metrics --help\n```\n\nAn example of usage detail is provided below.\n\n### For the latest main branch\n```\n  $ etcd-dump-metrics\n```\n\n### For the provided endpoint\n```\n  $ goreman start\n  $ etcd-dump-metrics --addr http://localhost:2379/metrics\n```\n\n### Download specific version to temporary directory to fetch metrics\n```\n  $ etcd-dump-metrics --debug --download-ver v3.5.3\n  $ etcd-dump-metrics --download-ver v3.5.3\n```\n","tools/benchmark/README.md":"# etcd/tools/benchmark\n\n`etcd/tools/benchmark` is the official benchmarking tool for etcd clusters.\n\n## Installation\n\nInstall the tool by running the following command from the etcd source directory.\n\n```\n  $ go install -v ./tools/benchmark\n```\n\nThe installation will place executables in the $GOPATH/bin. If $GOPATH environment variable is not set, the tool will be installed into the $HOME/go/bin. You can also find out the installed location by running the following command from the etcd source directory. Make sure that $PATH is set accordingly in your environment.\n\n```\n  $ go list -f \"{{.Target}}\" ./tools/benchmark\n```\n\nAlternatively, instead of installing the tool, you can use it by simply running the following command from the etcd source directory.\n\n```\n  $ go run ./tools/benchmark\n```\n\n## Usage\n\nThe following command should output the usage per the latest development.\n\n```\n  $ benchmark --help\n```\n","tools/etcd-dump-db/README.md":"# etcd-dump-db\n\n`etcd-dump-db` inspects etcd db files.\n\n## Installation\n\nInstall the tool by running the following command from the etcd source directory.\n\n```\n  $ go install -v ./tools/etcd-dump-db\n```\n\nThe installation will place executables in the $GOPATH/bin. If $GOPATH environment variable is not set, the tool will be installed into the $HOME/go/bin. You can also find out the installed location by running the following command from the etcd source directory. Make sure that $PATH is set accordingly in your environment.\n\n```\n  $ go list -f \"{{.Target}}\" ./tools/etcd-dump-db\n```\n\nAlternatively, instead of installing the tool, you can use it by simply running the following command from the etcd source directory.\n\n```\n  $ go run ./tools/etcd-dump-db\n```\n\n## Usage\n\nThe following command should output the usage per the latest development.\n\n```\n  $ etcd-dump-db --help\n```\n\nAn example of usage detail is provided below.\n\n```\nUsage:\n  etcd-dump-db [command]\n\nAvailable Commands:\n  list-bucket    bucket lists all buckets.\n  iterate-bucket iterate-bucket lists key-value pairs in reverse order.\n  hash           hash computes the hash of db file.\n\nFlags:\n  -h, --help[=false]: help for etcd-dump-db\n\nUse \"etcd-dump-db [command] --help\" for more information about a command.\n```\n\n\n#### list-bucket [data dir or db file path]\n\nLists all buckets.\n\n```\n$ etcd-dump-db list-bucket agent01/agent.etcd\n\nalarm\nauth\nauthRoles\nauthUsers\ncluster\nkey\nlease\nmembers\nmembers_removed\nmeta\n```\n\n\n#### hash [data dir or db file path]\n\nComputes the hash of db file.\n\n```\n$ etcd-dump-db hash agent01/agent.etcd\ndb path: agent01/agent.etcd/member/snap/db\nHash: 3700260467\n\n\n$ etcd-dump-db hash agent02/agent.etcd\n\ndb path: agent02/agent.etcd/member/snap/db\nHash: 3700260467\n\n\n$ etcd-dump-db hash agent03/agent.etcd\n\ndb path: agent03/agent.etcd/member/snap/db\nHash: 3700260467\n```\n\n\n#### iterate-bucket [data dir or db file path]\n\nLists key-value pairs in reverse order.\n\n```\n$ etcd-dump-db iterate-bucket agent03/agent.etcd key --limit 3\n\nkey=\"\\x00\\x00\\x00\\x00\\x005@x_\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\tt\", value=\"\\n\\x153640412599896088633_9\"\nkey=\"\\x00\\x00\\x00\\x00\\x005@x_\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\bt\", value=\"\\n\\x153640412599896088633_8\"\nkey=\"\\x00\\x00\\x00\\x00\\x005@x_\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\at\", value=\"\\n\\x153640412599896088633_7\"\n```\n\n#### scan-keys [data dir or db file path]\n\nScans all the key-value pairs starting from a specific revision in the key space. It works even the db is corrupted.\n\n```\n$ ./etcd-dump-db scan-keys ~/tmp/etcd/778/db.db 16589739 2>/dev/null | grep \"/registry/configmaps/istio-system/istio-namespace-controller-election\"\npageID=1306, index=5/5, rev={Revision:{Main:16589739 Sub:0} tombstone:false}, value=[key \"/registry/configmaps/istio-system/istio-namespace-controller-election\" | val \"k8s\\x00\\n\\x0f\\n\\x02v1\\x12\\tConfigMap\\x12\\xeb\\x03\\n\\xe8\\x03\\n#istio-namespace-controller-election\\x12\\x00\\x1a\\fistio-system\\\"\\x00*$bb696087-260d-4167-bf06-17d3361f9b5f2\\x008\\x00B\\b\\b\\x9e\\xbe\\xed\\xb5\\x06\\x10\\x00b\\xe6\\x01\\n(control-plane.alpha.kubernetes.io/leader\\x12\\xb9\\x01{\\\"holderIdentity\\\":\\\"istiod-d56968787-txq2d\\\",\\\"holderKey\\\":\\\"default\\\",\\\"leaseDurationSeconds\\\":30,\\\"acquireTime\\\":\\\"2024-08-13T13:26:54Z\\\",\\\"renewTime\\\":\\\"2024-08-27T06:16:13Z\\\",\\\"leaderTransitions\\\":0}\\x8a\\x01\\x90\\x01\\n\\x0fpilot-discovery\\x12\\x06Update\\x1a\\x02v1\\\"\\b\\b\\xad\\u07b5\\xb6\\x06\\x10\\x002\\bFieldsV1:[\\nY{\\\"f:metadata\\\":{\\\"f:annotations\\\":{\\\".\\\":{},\\\"f:control-plane.alpha.kubernetes.io/leader\\\":{}}}}B\\x00\\x1a\\x00\\\"\\x00\" | created 9612546 | mod 16589739 | ver 157604]\npageID=4737, index=4/4, rev={Revision:{Main:16589786 Sub:0} tombstone:false}, value=[key \"/registry/configmaps/istio-system/istio-namespace-controller-election\" | val \"k8s\\x00\\n\\x0f\\n\\x02v1\\x12\\tConfigMap\\x12\\xeb\\x03\\n\\xe8\\x03\\n#istio-namespace-controller-election\\x12\\x00\\x1a\\fistio-system\\\"\\x00*$bb696087-260d-4167-bf06-17d3361f9b5f2\\x008\\x00B\\b\\b\\x9e\\xbe\\xed\\xb5\\x06\\x10\\x00b\\xe6\\x01\\n(control-plane.alpha.kubernetes.io/leader\\x12\\xb9\\x01{\\\"holderIdentity\\\":\\\"istiod-d56968787-txq2d\\\",\\\"holderKey\\\":\\\"default\\\",\\\"leaseDurationSeconds\\\":30,\\\"acquireTime\\\":\\\"2024-08-13T13:26:54Z\\\",\\\"renewTime\\\":\\\"2024-08-27T06:16:21Z\\\",\\\"leaderTransitions\\\":0}\\x8a\\x01\\x90\\x01\\n\\x0fpilot-discovery\\x12\\x06Update\\x1a\\x02v1\\\"\\b\\b\\xb5\\u07b5\\xb6\\x06\\x10\\x002\\bFieldsV1:[\\nY{\\\"f:metadata\\\":{\\\"f:annotations\\\":{\\\".\\\":{},\\\"f:control-plane.alpha.kubernetes.io/leader\\\":{}}}}B\\x00\\x1a\\x00\\\"\\x00\" | created 9612546 | mod 16589786 | ver 157605]\n```","tools/.golangci.yaml":"---\nversion: \"2\"\nlinters:\n  default: none\n  enable: # please keep this alphabetized\n    - errorlint\n    - goheader\n    - govet\n    - ineffassign\n    - misspell\n    - nakedret\n    - revive\n    - staticcheck\n    - testifylint\n    - thelper\n    - unconvert # Remove unnecessary type conversions\n    - unparam\n    - unused\n    - usestdlibvars\n    - usetesting\n    - whitespace\n  settings:\n    goheader:\n      values:\n        regexp:\n          ORIGINAL_YEAR: 20[1-2][0-9]\n      template: |-\n        Copyright {{ORIGINAL_YEAR}} The etcd Authors\n\n        Licensed under the Apache License, Version 2.0 (the \"License\");\n        you may not use this file except in compliance with the License.\n        You may obtain a copy of the License at\n\n            http://www.apache.org/licenses/LICENSE-2.0\n\n        Unless required by applicable law or agreed to in writing, software\n        distributed under the License is distributed on an \"AS IS\" BASIS,\n        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n        See the License for the specific language governing permissions and\n        limitations under the License.\n    govet:\n      enable:\n        - shadow\n    nakedret:\n      # Align with https://github.com/alexkohler/nakedret/blob/v1.0.2/cmd/nakedret/main.go#L10\n      max-func-lines: 5\n    revive:\n      confidence: 0.8\n      rules:\n        - name: blank-imports\n        - name: context-as-argument\n        - name: context-keys-type\n        - name: dot-imports\n        - name: early-return\n          arguments:\n            - preserveScope\n        - name: error-return\n        - name: error-naming\n        - name: error-strings\n        - name: errorf\n        - name: if-return\n        - name: increment-decrement\n        - name: indent-error-flow\n        - name: package-comments\n        - name: range\n        - name: receiver-naming\n        - name: superfluous-else\n          arguments:\n            - preserveScope\n        - name: time-naming\n        - name: unnecessary-stmt\n        - name: use-any\n        - name: var-declaration\n        - name: var-naming\n          arguments:\n            # The following is the configuration for var-naming rule, the first element is the allow list and the second element is the deny list.\n            - [] # AllowList: leave it empty to use the default (empty, too). This means that we're not relaxing the rule in any way, i.e. elementId will raise a violation, it should be elementID, refer to the next line to see the list of denied initialisms.\n            # DenyList: Add GRPC and WAL to strict the rule not allowing instances like Wal or Grpc. The default values are located at commonInitialisms, refer to: https://github.com/mgechev/revive/blob/v1.3.7/lint/utils.go#L93-L133.\n            - - GRPC\n              - WAL\n            # Disable checks on package names that collide with Go standard library packages. See example error:\n            #    var-naming: avoid package names that conflict with Go standard library package names (revive)\n            - - skip-package-name-collision-with-go-std: true\n        - name: exported\n          disabled: true\n        - name: unexported-return\n          disabled: true\n    staticcheck:\n      checks:\n        - all\n        - -SA2002 # TODO(fix) Called testing.T.FailNow or SkipNow in a goroutine, which isn’t allowed\n        - -QF1001 # TODO(fix) Apply De Morgan’s law\n        - -QF1002 # TODO(fix) Convert untagged switch to tagged switch\n        - -QF1003 # TODO(fix) Convert if/else-if chain to tagged switch\n        - -QF1004 # TODO(fix) Use strings.ReplaceAll instead of strings.Replace with n == -1\n        - -QF1006 # TODO(fix) Lift if+break into loop condition\n        - -QF1008 # TODO(fix) Omit embedded fields from selector expression\n        - -QF1009 # TODO(fix) Use time.Time.Equal instead of == operator\n        - -QF1012 # TODO(fix) Use fmt.Fprintf(x, ...) instead of x.Write(fmt.Sprintf(...))\n        - -ST1003 # TODO(fix) Poorly chosen identifier\n        - -ST1005 # TODO(fix) Drop unnecessary use of the blank identifier\n        - ST1019 # Importing the same package multiple times.\n    testifylint:\n      enable-all: true\n      formatter:\n        # Require f-assertions (e.g. assert.Equalf) if a message is passed to the assertion, even if\n        # there is no variable-length variables, i.e. require require.NoErrorf for both cases below:\n        # require.NoErrorf(t, err, \"whatever message\")\n        # require.NoErrorf(t, err, \"whatever message: %v\", v)\n        #\n        # Note from golang programming perspective, we still prefer non-f-functions (i.e. fmt.Print)\n        # to f-functions (i.e. fmt.Printf) when there is no variable-length parameters. It's accepted\n        # to always require f-functions for stretchr/testify, but not for golang standard lib.\n        # Also refer to https://github.com/etcd-io/etcd/pull/18741#issuecomment-2422395914\n        require-f-funcs: true\n    thelper:\n      test:\n        first: false\n        begin: false\n      fuzz:\n        first: false\n        begin: false\n      benchmark:\n        first: false\n        begin: false\n      tb:\n        first: false\n        begin: false\n    usetesting:\n      os-mkdir-temp: false\n  exclusions:\n    generated: lax\n    presets:\n      - comments\n      - common-false-positives\n      - legacy\n      - std-error-handling\n    rules:\n      - linters:\n          - ineffassign\n        path: conversion\\.go\n      - linters:\n          - staticcheck\n        text: S1000\n      - linters:\n          - revive\n        text: 'var-naming: avoid meaningless package names'\n    paths:\n      - ^zz_generated.*\n      - third_party$\n      - builtin$\n      - examples$\nissues:\n  max-same-issues: 0\nformatters:\n  enable:\n    - gci\n    - gofmt\n    - goimports\n  settings: # please keep this alphabetized\n    gci:\n      sections:\n        - standard\n        - default\n        - prefix(go.etcd.io)\n    goimports:\n      local-prefixes:\n        - go.etcd.io # Put imports beginning with prefix after 3rd-party packages.\n  exclusions:\n    generated: lax\n    paths:\n      - ^zz_generated.*\n      - third_party$\n      - builtin$\n      - examples$\n","tools/etcd-dump-logs/README.md":"# etcd-dump-logs\n\n`etcd-dump-logs` dumps the log from data directory.\n\n## Installation\n\nInstall the tool by running the following command from the etcd source directory.\n\n```bash\n  $ go install -v ./tools/etcd-dump-logs\n```\n\nThe installation will place executables in the $GOPATH/bin. If $GOPATH environment variable is not set, the tool will be installed into the $HOME/go/bin. You can also find out the installed location by running the following command from the etcd source directory. Make sure that $PATH is set accordingly in your environment.\n\n```bash\n  $ go list -f \"{{.Target}}\" ./tools/etcd-dump-logs\n```\n\nAlternatively, instead of installing the tool, you can use it by simply running the following command from the etcd source directory.\n\n```bash\n  $ go run ./tools/etcd-dump-logs\n```\n\n## Usage\n\nThe following command should output the usage per the latest development.\n\n```bash\n  $ etcd-dump-logs --help\n```\n\nAn example of usage detail is provided below.\n\n```bash\nUsage:\n\n  etcd-dump-logs [data dir]\n    * Data dir is where the snapshots and WAL logs are located. The structure of the data dir should look like this:\n        - data_dir/member\n            - data_dir/member/snap\n            - data_dir/member/wal\n                - data_dir/member/wal/0000000000000000-0000000000000000.wal\n\nFlags:\n  -end-index uint\n      The index to stop dumping (exclusive) (default 18446744073709551615)\n  -entry-type string\n      If set, filters output by entry type. Must be one or more than one of:\n      ConfigChange, Normal, Request, InternalRaftRequest,\n      IRRRange, IRRPut, IRRDeleteRange, IRRTxn,\n      IRRCompaction, IRRLeaseGrant, IRRLeaseRevoke, IRRLeaseCheckpoint (default \"Normal,ConfigChange\")\n  -raw\n      Read the logs in the low-level form\n  -start-index uint\n      The index to start dumping (inclusive). If unspecified, dumps from the index of the last snapshot.\n  -stream-decoder string\n      The name of an executable decoding tool, the executable must process\n      hex encoded lines of binary input (from etcd-dump-logs)\n      and output a hex encoded line of binary for each input line\n  -wal-dir string\n      If set, dumps WAL from the informed path, rather than following the standard 'data_dir/member/wal/' location\n```\n\n#### etcd-dump-logs -entry-type <ENTRY_TYPE_NAME(S)> [data dir]\n\nFilter entries by type from WAL log.\n\n```bash\n$ etcd-dump-logs -entry-type IRRTxn /tmp/datadir\nSnapshot:\nempty\nStart dupmping log entries from snapshot.\nWAL metadata:\nnodeID=0 clusterID=0 term=0 commitIndex=0 vote=0\nWAL entries:\nlastIndex=34\nterm         index  type    data\n   7            13  norm    ID:8 txn:<success:<request_delete_range:<key:\"a\" range_end:\"k8s\\000\\n\\025\\n\\002v1\\022\\017RangeAllocation\\022#\\n\\022\\n\\000\\022\\000\\032\\000\\\"\\000*\\0002\\0008\\000B\\000z\\000\\022\\01310.0.0.0/16\\032\\000\\032\\000\\\"\\000\" > > failure:<request_delete_range:<key:\"a\" range_end:\"k8s\\000\\n\\025\\n\\002v1\\022\\017RangeAllocation\\022#\\n\\022\\n\\000\\022\\000\\032\\000\\\"\\000*\\0002\\0008\\000B\\000z\\000\\022\\01310.0.0.0/16\\032\\000\\032\\000\\\"\\000\" > > >\n\nEntry types (IRRTxn) count is : 1\n\n$ etcd-dump-logs -entry-type ConfigChange,IRRCompaction /tmp/datadir\nSnapshot:\nempty\nStart dupmping log entries from snapshot.\nWAL metadata:\nnodeID=0 clusterID=0 term=0 commitIndex=0 vote=0\nWAL entries:\nlastIndex=34\nterm         index  type    data\n   1             1  conf    method=ConfChangeAddNode id=2\n   2             2  conf    method=ConfChangeRemoveNode id=2\n   2             3  conf    method=ConfChangeUpdateNode id=2\n   2             4  conf    method=ConfChangeAddLearnerNode id=3\n   8            14  norm    ID:9 compaction:<physical:true >\n\nEntry types (ConfigChange,IRRCompaction) count is : 5\n```\n\n#### etcd-dump-logs -stream-decoder <EXECUTABLE_DECODER> [data dir]\n\nDecode each entry based on logic in the passed decoder. Decoder status and decoded data are listed in separated tab/columns in the output. For parsing purpose, the output from decoder are expected to be in format of \"<DECODER_STATUS>|<DECODED_DATA>\". Please refer to [decoder_correctoutputformat.sh] as an example.\n\nHowever, if the decoder output format is not as expected, \"decoder_status\" will be \"decoder output format is not right, print output anyway\", and all output from decoder will be considered as \"decoded_data\"\n\n```bash\n$ etcd-dump-logs -stream-decoder decoder_correctoutputformat.sh  /tmp/datadir\nSnapshot:\nempty\nStart dupmping log entries from snapshot.\nWAL metadata:\nnodeID=0 clusterID=0 term=0 commitIndex=0 vote=0\nWAL entries:\nlastIndex=34\nterm         index  type    data    decoder_status    decoded_data\n   1             1  conf    method=ConfChangeAddNode id=2    ERROR    jhjaajjjahjbbbjj\n   3             2  norm    noop    OK    jhjjabjjaajfbfgjfagdfhcjbbahgbbbfhfegibbcabbfhffbbbcbbfhfibbcaebbbgiffbbedgdbhjacbjjchjjdjjjdhjiejjjehjafjjjfhjjgjjjghjahjjajjhhjajj\n   3             3  norm    method=QGET path=\"/path1\"    OK    jhjaabjdeadgdeedaajfbfgjfagdfhcabbacgbbbcjbbcabbcabbbcbbcbbbcaebbbccbbedgdbhjjcbjjchjjdjjjdhjiejjjehjafjjjfhjjgjjjghjahjjajjhhjajj\n   7             4  norm    ID:8 txn:<success:<request_delete_range:<key:\"a\" range_end:\"b\" > > failure:<request_delete_range:<key:\"a\" range_end:\"b\" > > >     OK    jhjhcbadabjhaajfjajafaabjafbaajhaajfjajafaabjafb\n   8             5  norm    ID:9 compaction:<physical:true >     ERROR    jhjicajbajja\n   9             6  norm    ID:10 lease_grant:<TTL:1 ID:1 >     ERROR    jhjadbjdjhjaajja\n  12             7  norm    ID:13 auth_enable:<>   ERROR    jhjdcbcejj\n  27             8  norm    ??? ERROR  cf\nEntry types () count is : 8\n```\n\n```bash\n$ etcd-dump-logs -stream-decoder decoder_wrongoutputformat.sh  /tmp/datadir\nSnapshot:\nempty\nStart dupmping log entries from snapshot.\nWAL metadata:\nnodeID=0 clusterID=0 term=0 commitIndex=0 vote=0\nWAL entries:\nlastIndex=34\nterm         index  type    data    decoder_status  decoded_data\n   1             1  conf    method=ConfChangeAddNode id=2   decoder output format is not right, print output anyway jhjaajjjahjbbbjj\n   3             2  norm    noop    decoder output format is not right, print output anyway jhjjabjjaajfbfgjfagdfhcjbbahgbbbfhfegibbcabbfhffbbbcbbfhfibbcaebbbgiffbbedgdbhjacbjjchjjdjjjdhjiejjjehjafjjjfhjjgjjjghjahjjajjhhjajj\n   3             3  norm    method=QGET path=\"/path1\"    decoder output format is not right, print output anyway    jhjaabjdeadgdeedaajfbfgjfagdfhcabbacgbbbcjbbcabbcabbbcbbcbbbcaebbbccbbedgdbhjjcbjjchjjdjjjdhjiejjjehjafjjjfhjjgjjjghjahjjajjhhjajj\n   7             4  norm    ID:8 txn:<success:<request_delete_range:<key:\"a\" range_end:\"b\" > > failure:<request_delete_range:<key:\"a\" range_end:\"b\" > > >   decoder output format is not right, print output anyway jhjhcbadabjhaajfjajafaabjafbaajhaajfjajafaabjafb\n   8             5  norm    ID:9 compaction:<physical:true >     decoder output format is not right, print output anyway    jhjicajbajja\n   9             6  norm    ID:10 lease_grant:<TTL:1 ID:1 >     decoder output format is not right, print output anyway jhjadbjdjhjaajja\n  12             7  norm    ID:13 auth_enable:<>   decoder output format is not right, print output anyway  jhjdcbcejj\n  27             8  norm    ??? decoder output format is not right, print output anyway cf\nEntry types () count is : 8\n\n```\n\n#### `etcd-dump-logs -start-index <INDEX NUMBER> [data dir]`\n\nOnly shows WAL log entries after the specified start-index number, inclusively.\n\n```bash\n$ etcd-dump-logs -start-index 31  /tmp/datadir\nStart dumping log entries from index 31.\nWAL metadata:\nnodeID=0 clusterID=0 term=0 commitIndex=0 vote=0\nWAL entries:\nlastIndex=34\nterm         index  type    data\n  25            31  norm    ID:26 auth_role_get:<role:\"role3\" >\n  26            32  norm    ID:27 auth_role_grant_permission:<name:\"role3\" perm:<permType:WRITE key:\"Keys\" range_end:\"RangeEnd\" > >\n  27            33  norm    ID:28 auth_role_revoke_permission:<role:\"role3\" key:\"key\" range_end:\"rangeend\" >\n  27            34  norm    ???\nEntry types () count is : 4\n```\n\n#### `etcd-dump-logs -start-index <INDEX NUMBER> -end-index <INDEX NUMBER> [data dir]`\n\nOnly shows WAL log entries from the specified start-index number (inclusively) to the specified end-index number (exclusively).\n\n```bash\n$ etcd-dump-logs -start-index 930 -end-index 932  /tmp/datadir\nStart dumping log entries from index 930.\nWAL metadata:\nnodeID=0 clusterID=0 term=5 commitIndex=2448 vote=0\nWAL entries: 2\nlastIndex=931\nterm       index    type    data\n   3         930    norm    header:<ID:11010058442592651283 > put:<key:\"key7\" value:\"923\" >\n   3         931    norm    header:<ID:6577953459306661672 > put:<key:\"key8\" value:\"924\" >\n\nEntry types (Normal,ConfigChange) count is : 2\n```\n\n[decoder_correctoutputformat.sh]: ./testdecoder/decoder_correctoutputformat.sh\n","tools/rw-heatmaps/README.md":"# etcd/tools/rw-heatmaps\n\n`etcd/tools/rw-heatmaps` is the mixed read/write performance evaluation tool for etcd clusters.\n\n## Installation\n\nInstall the tool by running the following command from the etcd source directory.\n\n```sh\n  $ go install -v ./tools/rw-heatmaps\n```\n\nThe installation will place executables in the $GOPATH/bin. If $GOPATH environment variable is not set, the tool will be installed into the $HOME/go/bin. You can also find out the installed location by running the following command from the etcd source directory. Make sure that $PATH is set accordingly in your environment.\n\n```sh\n  $ go list -f \"{{.Target}}\" ./tools/rw-heatmaps\n```\n\nAlternatively, instead of installing the tool, you can use it by simply running the following command from the etcd source directory.\n\n```sh\n  $ go run ./tools/rw-heatmaps\n```\n\n## Execute\n\n### Benchmark\n\nTo get a mixed read/write performance evaluation result:\n```sh\n  # run with default configurations and specify the working directory\n  $ ./rw-benchmark.sh -w ${WORKING_DIR}\n```\n`rw-benchmark.sh` will automatically use the etcd binary compiled under `etcd/bin/` directory.\n\nNote: the result CSV file will be saved to current working directory. The working directory is where etcd database is saved. The working directory is designed for scenarios where a different mounted disk is preferred.\n\n### Plot Graphs\n\nTo generate two images (read and write) based on the benchmark result CSV file:\n\n```sh\n  # to generate a pair of read & write images from one data csv file\n  $ rw-heatmaps ${CSV_FILE} -t ${IMAGE_TITLE} -o ${OUTPUT_IMAGE_NAME}\n```\n\nTo generate two images (read and write) showing the performance difference from two result CSV files:\n\n```sh\n  # to generate a pair of read & write images from one data csv file\n  $ rw-heatmaps ${CSV_FILE1} ${CSV_FILE2} -t ${IMAGE_TITLE} -o ${OUTPUT_IMAGE_NAME}\n```\n\nTo see the available options use the `--help` option.\n\n```sh\n  $ rw-heatmaps --help\n\nrw-heatmaps is a tool to generate read/write heatmaps images for etcd3.\n\nUsage:\n  rw-heatmaps [input file(s) in csv format] [flags]\n\nFlags:\n  -h, --help                       help for rw-heatmaps\n  -f, --output-format string       output image file format (default \"jpg\")\n  -o, --output-image-file string   output image filename (required)\n  -t, --title string               plot graph title (required)\n      --zero-centered              plot the improvement graph with white color represents 0.0 (default true)\n```\n"},"items":[{"name":".golangci.yaml","path":"tools/.golangci.yaml","rawUrl":"https://raw.githubusercontent.com/etcd-io/etcd/HEAD/tools/.golangci.yaml","title":"Tools Skill","category":"anthropic-skill","format":"yaml","content":"---\nversion: \"2\"\nlinters:\n  default: none\n  enable: # please keep this alphabetized\n    - errorlint\n    - goheader\n    - govet\n    - ineffassign\n    - misspell\n    - nakedret\n    - revive\n    - staticcheck\n    - testifylint\n    - thelper\n    - unconvert # Remove unnecessary type conversions\n    - unparam\n    - unused\n    - usestdlibvars\n    - usetesting\n    - whitespace\n  settings:\n    goheader:\n      values:\n        regexp:\n          ORIGINAL_YEAR: 20[1-2][0-9]\n      template: |-\n        Copyright {{ORIGINAL_YEAR}} The etcd Authors\n\n        Licensed under the Apache License, Version 2.0 (the \"License\");\n        you may not use this file except in compliance with the License.\n        You may obtain a copy of the License at\n\n            http://www.apache.org/licenses/LICENSE-2.0\n\n        Unless required by applicable law or agreed to in writing, software\n        distributed under the License is distributed on an \"AS IS\" BASIS,\n        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n        See the License for the specific language governing permissions and\n        limitations under the License.\n    govet:\n      enable:\n        - shadow\n    nakedret:\n      # Align with https://github.com/alexkohler/nakedret/blob/v1.0.2/cmd/nakedret/main.go#L10\n      max-func-lines: 5\n    revive:\n      confidence: 0.8\n      rules:\n        - name: blank-imports\n        - name: context-as-argument\n        - name: context-keys-type\n        - name: dot-imports\n        - name: early-return\n          arguments:\n            - preserveScope\n        - name: error-return\n        - name: error-naming\n        - name: error-strings\n        - name: errorf\n        - name: if-return\n        - name: increment-decrement\n        - name: indent-error-flow\n        - name: package-comments\n        - name: range\n        - name: receiver-naming\n        - name: superfluous-else\n          arguments:\n            - preserveScope\n        - name: time-naming\n        - name: unnecessary-stmt\n        - name: use-any\n        - name: var-declaration\n        - name: var-naming\n          arguments:\n            # The following is the configuration for var-naming rule, the first element is the allow list and the second element is the deny list.\n            - [] # AllowList: leave it empty to use the default (empty, too). This means that we're not relaxing the rule in any way, i.e. elementId will raise a violation, it should be elementID, refer to the next line to see the list of denied initialisms.\n            # DenyList: Add GRPC and WAL to strict the rule not allowing instances like Wal or Grpc. The default values are located at commonInitialisms, refer to: https://github.com/mgechev/revive/blob/v1.3.7/lint/utils.go#L93-L133.\n            - - GRPC\n              - WAL\n            # Disable checks on package names that collide with Go standard library packages. See example error:\n            #    var-naming: avoid package names that conflict with Go standard library package names (revive)\n            - - skip-package-name-collision-with-go-std: true\n        - name: exported\n          disabled: true\n        - name: unexported-return\n          disabled: true\n    staticcheck:\n      checks:\n        - all\n        - -SA2002 # TODO(fix) Called testing.T.FailNow or SkipNow in a goroutine, which isn’t allowed\n        - -QF1001 # TODO(fix) Apply De Morgan’s law\n        - -QF1002 # TODO(fix) Convert untagged switch to tagged switch\n        - -QF1003 # TODO(fix) Convert if/else-if chain to tagged switch\n        - -QF1004 # TODO(fix) Use strings.ReplaceAll instead of strings.Replace with n == -1\n        - -QF1006 # TODO(fix) Lift if+break into loop condition\n        - -QF1008 # TODO(fix) Omit embedded fields from selector expression\n        - -QF1009 # TODO(fix) Use time.Time.Equal instead of == operator\n        - -QF1012 # TODO(fix) Use fmt.Fprintf(x, ...) instead of x.Write(fmt.Sprintf(...))\n        - -ST1003 # TODO(fix) Poorly chosen identifier\n        - -ST1005 # TODO(fix) Drop unnecessary use of the blank identifier\n        - ST1019 # Importing the same package multiple times.\n    testifylint:\n      enable-all: true\n      formatter:\n        # Require f-assertions (e.g. assert.Equalf) if a message is passed to the assertion, even if\n        # there is no variable-length variables, i.e. require require.NoErrorf for both cases below:\n        # require.NoErrorf(t, err, \"whatever message\")\n        # require.NoErrorf(t, err, \"whatever message: %v\", v)\n        #\n        # Note from golang programming perspective, we still prefer non-f-functions (i.e. fmt.Print)\n        # to f-functions (i.e. fmt.Printf) when there is no variable-length parameters. It's accepted\n        # to always require f-functions for stretchr/testify, but not for golang standard lib.\n        # Also refer to https://github.com/etcd-io/etcd/pull/18741#issuecomment-2422395914\n        require-f-funcs: true\n    thelper:\n      test:\n        first: false\n        begin: false\n      fuzz:\n        first: false\n        begin: false\n      benchmark:\n        first: false\n        begin: false\n      tb:\n        first: false\n        begin: false\n    usetesting:\n      os-mkdir-temp: false\n  exclusions:\n    generated: lax\n    presets:\n      - comments\n      - common-false-positives\n      - legacy\n      - std-error-handling\n    rules:\n      - linters:\n          - ineffassign\n        path: conversion\\.go\n      - linters:\n          - staticcheck\n        text: S1000\n      - linters:\n          - revive\n        text: 'var-naming: avoid meaningless package names'\n    paths:\n      - ^zz_generated.*\n      - third_party$\n      - builtin$\n      - examples$\nissues:\n  max-same-issues: 0\nformatters:\n  enable:\n    - gci\n    - gofmt\n    - goimports\n  settings: # please keep this alphabetized\n    gci:\n      sections:\n        - standard\n        - default\n        - prefix(go.etcd.io)\n    goimports:\n      local-prefixes:\n        - go.etcd.io # Put imports beginning with prefix after 3rd-party packages.\n  exclusions:\n    generated: lax\n    paths:\n      - ^zz_generated.*\n      - third_party$\n      - builtin$\n      - examples$\n","isInternal":false,"tokens":1543,"sizeBytes":6129},{"name":"README.md","path":"tools/benchmark/README.md","rawUrl":"https://raw.githubusercontent.com/etcd-io/etcd/HEAD/tools/benchmark/README.md","title":"benchmark Documentation","category":"plugin-manifest","format":"markdown","content":"# etcd/tools/benchmark\n\n`etcd/tools/benchmark` is the official benchmarking tool for etcd clusters.\n\n## Installation\n\nInstall the tool by running the following command from the etcd source directory.\n\n```\n  $ go install -v ./tools/benchmark\n```\n\nThe installation will place executables in the $GOPATH/bin. If $GOPATH environment variable is not set, the tool will be installed into the $HOME/go/bin. You can also find out the installed location by running the following command from the etcd source directory. Make sure that $PATH is set accordingly in your environment.\n\n```\n  $ go list -f \"{{.Target}}\" ./tools/benchmark\n```\n\nAlternatively, instead of installing the tool, you can use it by simply running the following command from the etcd source directory.\n\n```\n  $ go run ./tools/benchmark\n```\n\n## Usage\n\nThe following command should output the usage per the latest development.\n\n```\n  $ benchmark --help\n```\n","isInternal":false,"tokens":207,"sizeBytes":915},{"name":"README.md","path":"tools/container-images/README.md","rawUrl":"https://raw.githubusercontent.com/etcd-io/etcd/HEAD/tools/container-images/README.md","title":"container-images Documentation","category":"plugin-manifest","format":"markdown","content":"# Container Images\n\nThe container images defined in this directory are used to maintain\ndepenendencies up to date. **These images are not used to build the project.**\n\nThese images cause [Dependabot] to do a version bump. After that, a [GitHub\naction] will update other artifacts in the repository.\n\n[Dependabot]: ../../.github/dependabot.yml\n[GitHub action]: ../../.github/workflows/bump-devcontainer-version.yml\n","isInternal":false,"tokens":98,"sizeBytes":414},{"name":"README.md","path":"tools/etcd-dump-db/README.md","rawUrl":"https://raw.githubusercontent.com/etcd-io/etcd/HEAD/tools/etcd-dump-db/README.md","title":"etcd-dump-db Documentation","category":"plugin-manifest","format":"markdown","content":"# etcd-dump-db\n\n`etcd-dump-db` inspects etcd db files.\n\n## Installation\n\nInstall the tool by running the following command from the etcd source directory.\n\n```\n  $ go install -v ./tools/etcd-dump-db\n```\n\nThe installation will place executables in the $GOPATH/bin. If $GOPATH environment variable is not set, the tool will be installed into the $HOME/go/bin. You can also find out the installed location by running the following command from the etcd source directory. Make sure that $PATH is set accordingly in your environment.\n\n```\n  $ go list -f \"{{.Target}}\" ./tools/etcd-dump-db\n```\n\nAlternatively, instead of installing the tool, you can use it by simply running the following command from the etcd source directory.\n\n```\n  $ go run ./tools/etcd-dump-db\n```\n\n## Usage\n\nThe following command should output the usage per the latest development.\n\n```\n  $ etcd-dump-db --help\n```\n\nAn example of usage detail is provided below.\n\n```\nUsage:\n  etcd-dump-db [command]\n\nAvailable Commands:\n  list-bucket    bucket lists all buckets.\n  iterate-bucket iterate-bucket lists key-value pairs in reverse order.\n  hash           hash computes the hash of db file.\n\nFlags:\n  -h, --help[=false]: help for etcd-dump-db\n\nUse \"etcd-dump-db [command] --help\" for more information about a command.\n```\n\n\n#### list-bucket [data dir or db file path]\n\nLists all buckets.\n\n```\n$ etcd-dump-db list-bucket agent01/agent.etcd\n\nalarm\nauth\nauthRoles\nauthUsers\ncluster\nkey\nlease\nmembers\nmembers_removed\nmeta\n```\n\n\n#### hash [data dir or db file path]\n\nComputes the hash of db file.\n\n```\n$ etcd-dump-db hash agent01/agent.etcd\ndb path: agent01/agent.etcd/member/snap/db\nHash: 3700260467\n\n\n$ etcd-dump-db hash agent02/agent.etcd\n\ndb path: agent02/agent.etcd/member/snap/db\nHash: 3700260467\n\n\n$ etcd-dump-db hash agent03/agent.etcd\n\ndb path: agent03/agent.etcd/member/snap/db\nHash: 3700260467\n```\n\n\n#### iterate-bucket [data dir or db file path]\n\nLists key-value pairs in reverse order.\n\n```\n$ etcd-dump-db iterate-bucket agent03/agent.etcd key --limit 3\n\nkey=\"\\x00\\x00\\x00\\x00\\x005@x_\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\tt\", value=\"\\n\\x153640412599896088633_9\"\nkey=\"\\x00\\x00\\x00\\x00\\x005@x_\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\bt\", value=\"\\n\\x153640412599896088633_8\"\nkey=\"\\x00\\x00\\x00\\x00\\x005@x_\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\at\", value=\"\\n\\x153640412599896088633_7\"\n```\n\n#### scan-keys [data dir or db file path]\n\nScans all the key-value pairs starting from a specific revision in the key space. It works even the db is corrupted.\n\n```\n$ ./etcd-dump-db scan-keys ~/tmp/etcd/778/db.db 16589739 2>/dev/null | grep \"/registry/configmaps/istio-system/istio-namespace-controller-election\"\npageID=1306, index=5/5, rev={Revision:{Main:16589739 Sub:0} tombstone:false}, value=[key \"/registry/configmaps/istio-system/istio-namespace-controller-election\" | val \"k8s\\x00\\n\\x0f\\n\\x02v1\\x12\\tConfigMap\\x12\\xeb\\x03\\n\\xe8\\x03\\n#istio-namespace-controller-election\\x12\\x00\\x1a\\fistio-system\\\"\\x00*$bb696087-260d-4167-bf06-17d3361f9b5f2\\x008\\x00B\\b\\b\\x9e\\xbe\\xed\\xb5\\x06\\x10\\x00b\\xe6\\x01\\n(control-plane.alpha.kubernetes.io/leader\\x12\\xb9\\x01{\\\"holderIdentity\\\":\\\"istiod-d56968787-txq2d\\\",\\\"holderKey\\\":\\\"default\\\",\\\"leaseDurationSeconds\\\":30,\\\"acquireTime\\\":\\\"2024-08-13T13:26:54Z\\\",\\\"renewTime\\\":\\\"2024-08-27T06:16:13Z\\\",\\\"leaderTransitions\\\":0}\\x8a\\x01\\x90\\x01\\n\\x0fpilot-discovery\\x12\\x06Update\\x1a\\x02v1\\\"\\b\\b\\xad\\u07b5\\xb6\\x06\\x10\\x002\\bFieldsV1:[\\nY{\\\"f:metadata\\\":{\\\"f:annotations\\\":{\\\".\\\":{},\\\"f:control-plane.alpha.kubernetes.io/leader\\\":{}}}}B\\x00\\x1a\\x00\\\"\\x00\" | created 9612546 | mod 16589739 | ver 157604]\npageID=4737, index=4/4, rev={Revision:{Main:16589786 Sub:0} tombstone:false}, value=[key \"/registry/configmaps/istio-system/istio-namespace-controller-election\" | val \"k8s\\x00\\n\\x0f\\n\\x02v1\\x12\\tConfigMap\\x12\\xeb\\x03\\n\\xe8\\x03\\n#istio-namespace-controller-election\\x12\\x00\\x1a\\fistio-system\\\"\\x00*$bb696087-260d-4167-bf06-17d3361f9b5f2\\x008\\x00B\\b\\b\\x9e\\xbe\\xed\\xb5\\x06\\x10\\x00b\\xe6\\x01\\n(control-plane.alpha.kubernetes.io/leader\\x12\\xb9\\x01{\\\"holderIdentity\\\":\\\"istiod-d56968787-txq2d\\\",\\\"holderKey\\\":\\\"default\\\",\\\"leaseDurationSeconds\\\":30,\\\"acquireTime\\\":\\\"2024-08-13T13:26:54Z\\\",\\\"renewTime\\\":\\\"2024-08-27T06:16:21Z\\\",\\\"leaderTransitions\\\":0}\\x8a\\x01\\x90\\x01\\n\\x0fpilot-discovery\\x12\\x06Update\\x1a\\x02v1\\\"\\b\\b\\xb5\\u07b5\\xb6\\x06\\x10\\x002\\bFieldsV1:[\\nY{\\\"f:metadata\\\":{\\\"f:annotations\\\":{\\\".\\\":{},\\\"f:control-plane.alpha.kubernetes.io/leader\\\":{}}}}B\\x00\\x1a\\x00\\\"\\x00\" | created 9612546 | mod 16589786 | ver 157605]\n```","isInternal":false,"tokens":1474,"sizeBytes":4484},{"name":"README.md","path":"tools/etcd-dump-logs/README.md","rawUrl":"https://raw.githubusercontent.com/etcd-io/etcd/HEAD/tools/etcd-dump-logs/README.md","title":"etcd-dump-logs Documentation","category":"plugin-manifest","format":"markdown","content":"# etcd-dump-logs\n\n`etcd-dump-logs` dumps the log from data directory.\n\n## Installation\n\nInstall the tool by running the following command from the etcd source directory.\n\n```bash\n  $ go install -v ./tools/etcd-dump-logs\n```\n\nThe installation will place executables in the $GOPATH/bin. If $GOPATH environment variable is not set, the tool will be installed into the $HOME/go/bin. You can also find out the installed location by running the following command from the etcd source directory. Make sure that $PATH is set accordingly in your environment.\n\n```bash\n  $ go list -f \"{{.Target}}\" ./tools/etcd-dump-logs\n```\n\nAlternatively, instead of installing the tool, you can use it by simply running the following command from the etcd source directory.\n\n```bash\n  $ go run ./tools/etcd-dump-logs\n```\n\n## Usage\n\nThe following command should output the usage per the latest development.\n\n```bash\n  $ etcd-dump-logs --help\n```\n\nAn example of usage detail is provided below.\n\n```bash\nUsage:\n\n  etcd-dump-logs [data dir]\n    * Data dir is where the snapshots and WAL logs are located. The structure of the data dir should look like this:\n        - data_dir/member\n            - data_dir/member/snap\n            - data_dir/member/wal\n                - data_dir/member/wal/0000000000000000-0000000000000000.wal\n\nFlags:\n  -end-index uint\n      The index to stop dumping (exclusive) (default 18446744073709551615)\n  -entry-type string\n      If set, filters output by entry type. Must be one or more than one of:\n      ConfigChange, Normal, Request, InternalRaftRequest,\n      IRRRange, IRRPut, IRRDeleteRange, IRRTxn,\n      IRRCompaction, IRRLeaseGrant, IRRLeaseRevoke, IRRLeaseCheckpoint (default \"Normal,ConfigChange\")\n  -raw\n      Read the logs in the low-level form\n  -start-index uint\n      The index to start dumping (inclusive). If unspecified, dumps from the index of the last snapshot.\n  -stream-decoder string\n      The name of an executable decoding tool, the executable must process\n      hex encoded lines of binary input (from etcd-dump-logs)\n      and output a hex encoded line of binary for each input line\n  -wal-dir string\n      If set, dumps WAL from the informed path, rather than following the standard 'data_dir/member/wal/' location\n```\n\n#### etcd-dump-logs -entry-type <ENTRY_TYPE_NAME(S)> [data dir]\n\nFilter entries by type from WAL log.\n\n```bash\n$ etcd-dump-logs -entry-type IRRTxn /tmp/datadir\nSnapshot:\nempty\nStart dupmping log entries from snapshot.\nWAL metadata:\nnodeID=0 clusterID=0 term=0 commitIndex=0 vote=0\nWAL entries:\nlastIndex=34\nterm         index  type    data\n   7            13  norm    ID:8 txn:<success:<request_delete_range:<key:\"a\" range_end:\"k8s\\000\\n\\025\\n\\002v1\\022\\017RangeAllocation\\022#\\n\\022\\n\\000\\022\\000\\032\\000\\\"\\000*\\0002\\0008\\000B\\000z\\000\\022\\01310.0.0.0/16\\032\\000\\032\\000\\\"\\000\" > > failure:<request_delete_range:<key:\"a\" range_end:\"k8s\\000\\n\\025\\n\\002v1\\022\\017RangeAllocation\\022#\\n\\022\\n\\000\\022\\000\\032\\000\\\"\\000*\\0002\\0008\\000B\\000z\\000\\022\\01310.0.0.0/16\\032\\000\\032\\000\\\"\\000\" > > >\n\nEntry types (IRRTxn) count is : 1\n\n$ etcd-dump-logs -entry-type ConfigChange,IRRCompaction /tmp/datadir\nSnapshot:\nempty\nStart dupmping log entries from snapshot.\nWAL metadata:\nnodeID=0 clusterID=0 term=0 commitIndex=0 vote=0\nWAL entries:\nlastIndex=34\nterm         index  type    data\n   1             1  conf    method=ConfChangeAddNode id=2\n   2             2  conf    method=ConfChangeRemoveNode id=2\n   2             3  conf    method=ConfChangeUpdateNode id=2\n   2             4  conf    method=ConfChangeAddLearnerNode id=3\n   8            14  norm    ID:9 compaction:<physical:true >\n\nEntry types (ConfigChange,IRRCompaction) count is : 5\n```\n\n#### etcd-dump-logs -stream-decoder <EXECUTABLE_DECODER> [data dir]\n\nDecode each entry based on logic in the passed decoder. Decoder status and decoded data are listed in separated tab/columns in the output. For parsing purpose, the output from decoder are expected to be in format of \"<DECODER_STATUS>|<DECODED_DATA>\". Please refer to [decoder_correctoutputformat.sh] as an example.\n\nHowever, if the decoder output format is not as expected, \"decoder_status\" will be \"decoder output format is not right, print output anyway\", and all output from decoder will be considered as \"decoded_data\"\n\n```bash\n$ etcd-dump-logs -stream-decoder decoder_correctoutputformat.sh  /tmp/datadir\nSnapshot:\nempty\nStart dupmping log entries from snapshot.\nWAL metadata:\nnodeID=0 clusterID=0 term=0 commitIndex=0 vote=0\nWAL entries:\nlastIndex=34\nterm         index  type    data    decoder_status    decoded_data\n   1             1  conf    method=ConfChangeAddNode id=2    ERROR    jhjaajjjahjbbbjj\n   3             2  norm    noop    OK    jhjjabjjaajfbfgjfagdfhcjbbahgbbbfhfegibbcabbfhffbbbcbbfhfibbcaebbbgiffbbedgdbhjacbjjchjjdjjjdhjiejjjehjafjjjfhjjgjjjghjahjjajjhhjajj\n   3             3  norm    method=QGET path=\"/path1\"    OK    jhjaabjdeadgdeedaajfbfgjfagdfhcabbacgbbbcjbbcabbcabbbcbbcbbbcaebbbccbbedgdbhjjcbjjchjjdjjjdhjiejjjehjafjjjfhjjgjjjghjahjjajjhhjajj\n   7             4  norm    ID:8 txn:<success:<request_delete_range:<key:\"a\" range_end:\"b\" > > failure:<request_delete_range:<key:\"a\" range_end:\"b\" > > >     OK    jhjhcbadabjhaajfjajafaabjafbaajhaajfjajafaabjafb\n   8             5  norm    ID:9 compaction:<physical:true >     ERROR    jhjicajbajja\n   9             6  norm    ID:10 lease_grant:<TTL:1 ID:1 >     ERROR    jhjadbjdjhjaajja\n  12             7  norm    ID:13 auth_enable:<>   ERROR    jhjdcbcejj\n  27             8  norm    ??? ERROR  cf\nEntry types () count is : 8\n```\n\n```bash\n$ etcd-dump-logs -stream-decoder decoder_wrongoutputformat.sh  /tmp/datadir\nSnapshot:\nempty\nStart dupmping log entries from snapshot.\nWAL metadata:\nnodeID=0 clusterID=0 term=0 commitIndex=0 vote=0\nWAL entries:\nlastIndex=34\nterm         index  type    data    decoder_status  decoded_data\n   1             1  conf    method=ConfChangeAddNode id=2   decoder output format is not right, print output anyway jhjaajjjahjbbbjj\n   3             2  norm    noop    decoder output format is not right, print output anyway jhjjabjjaajfbfgjfagdfhcjbbahgbbbfhfegibbcabbfhffbbbcbbfhfibbcaebbbgiffbbedgdbhjacbjjchjjdjjjdhjiejjjehjafjjjfhjjgjjjghjahjjajjhhjajj\n   3             3  norm    method=QGET path=\"/path1\"    decoder output format is not right, print output anyway    jhjaabjdeadgdeedaajfbfgjfagdfhcabbacgbbbcjbbcabbcabbbcbbcbbbcaebbbccbbedgdbhjjcbjjchjjdjjjdhjiejjjehjafjjjfhjjgjjjghjahjjajjhhjajj\n   7             4  norm    ID:8 txn:<success:<request_delete_range:<key:\"a\" range_end:\"b\" > > failure:<request_delete_range:<key:\"a\" range_end:\"b\" > > >   decoder output format is not right, print output anyway jhjhcbadabjhaajfjajafaabjafbaajhaajfjajafaabjafb\n   8             5  norm    ID:9 compaction:<physical:true >     decoder output format is not right, print output anyway    jhjicajbajja\n   9             6  norm    ID:10 lease_grant:<TTL:1 ID:1 >     decoder output format is not right, print output anyway jhjadbjdjhjaajja\n  12             7  norm    ID:13 auth_enable:<>   decoder output format is not right, print output anyway  jhjdcbcejj\n  27             8  norm    ??? decoder output format is not right, print output anyway cf\nEntry types () count is : 8\n\n```\n\n#### `etcd-dump-logs -start-index <INDEX NUMBER> [data dir]`\n\nOnly shows WAL log entries after the specified start-index number, inclusively.\n\n```bash\n$ etcd-dump-logs -start-index 31  /tmp/datadir\nStart dumping log entries from index 31.\nWAL metadata:\nnodeID=0 clusterID=0 term=0 commitIndex=0 vote=0\nWAL entries:\nlastIndex=34\nterm         index  type    data\n  25            31  norm    ID:26 auth_role_get:<role:\"role3\" >\n  26            32  norm    ID:27 auth_role_grant_permission:<name:\"role3\" perm:<permType:WRITE key:\"Keys\" range_end:\"RangeEnd\" > >\n  27            33  norm    ID:28 auth_role_revoke_permission:<role:\"role3\" key:\"key\" range_end:\"rangeend\" >\n  27            34  norm    ???\nEntry types () count is : 4\n```\n\n#### `etcd-dump-logs -start-index <INDEX NUMBER> -end-index <INDEX NUMBER> [data dir]`\n\nOnly shows WAL log entries from the specified start-index number (inclusively) to the specified end-index number (exclusively).\n\n```bash\n$ etcd-dump-logs -start-index 930 -end-index 932  /tmp/datadir\nStart dumping log entries from index 930.\nWAL metadata:\nnodeID=0 clusterID=0 term=5 commitIndex=2448 vote=0\nWAL entries: 2\nlastIndex=931\nterm       index    type    data\n   3         930    norm    header:<ID:11010058442592651283 > put:<key:\"key7\" value:\"923\" >\n   3         931    norm    header:<ID:6577953459306661672 > put:<key:\"key8\" value:\"924\" >\n\nEntry types (Normal,ConfigChange) count is : 2\n```\n\n[decoder_correctoutputformat.sh]: ./testdecoder/decoder_correctoutputformat.sh\n","isInternal":false,"tokens":2702,"sizeBytes":8759},{"name":"README.md","path":"tools/etcd-dump-metrics/README.md","rawUrl":"https://raw.githubusercontent.com/etcd-io/etcd/HEAD/tools/etcd-dump-metrics/README.md","title":"etcd-dump-metrics Documentation","category":"plugin-manifest","format":"markdown","content":"# etcd-dump-metrics\n\n `etcd-dump-metrics` provides metrics for the latest main branch, a given endpoint, or version.\n\n## Installation\n\nInstall the tool by running the following command from the etcd source directory.\n\n```\n  $ go install -v ./tools/etcd-dump-metrics\n```\n\nThe installation will place executables in the $GOPATH/bin. If $GOPATH environment variable is not set, the tool will be\ninstalled into the $HOME/go/bin. You can also find out the installed location by running the following command from the\netcd source directory. Make sure that $PATH is set accordingly in your environment.\n\n```\n  $ go list -f \"{{.Target}}\" ./tools/etcd-dump-metrics\n```\n\nAlternatively, instead of installing the tool, you can use it by simply running the following command from the etcd source\ndirectory.\n\n```\n  $ go run ./tools/etcd-dump-metrics\n```\n\n## Usage\n\nThe following command should output the usage per the latest development.\n\n```\n  $ etcd-dump-metrics --help\n```\n\nAn example of usage detail is provided below.\n\n### For the latest main branch\n```\n  $ etcd-dump-metrics\n```\n\n### For the provided endpoint\n```\n  $ goreman start\n  $ etcd-dump-metrics --addr http://localhost:2379/metrics\n```\n\n### Download specific version to temporary directory to fetch metrics\n```\n  $ etcd-dump-metrics --debug --download-ver v3.5.3\n  $ etcd-dump-metrics --download-ver v3.5.3\n```\n","isInternal":false,"tokens":353,"sizeBytes":1364},{"name":"README.md","path":"tools/local-tester/README.md","rawUrl":"https://raw.githubusercontent.com/etcd-io/etcd/HEAD/tools/local-tester/README.md","title":"local-tester Documentation","category":"plugin-manifest","format":"markdown","content":"# etcd local-tester\n\n> [!WARNING]\n> etcd-local-tester is now deprecated in favor of our much more comprehensive [robustness testing suite](https://github.com/etcd-io/etcd/tree/main/tests/robustness). In a future etcd release this historic tool will be removed as it is no longer maintained.\n\nThe etcd local-tester runs a fault injected cluster using local processes. It sets up an etcd cluster with unreliable network bridges on its peer and client interfaces. The cluster runs with a constant stream of `Put` requests to simulate client usage. A fault injection script periodically kills cluster members and disrupts bridge connectivity.\n\n# Requirements\n\nlocal-tester depends on `goreman` to manage its processes and `bash` to run fault injection.\n\n# Building\n\nlocal-tester needs `etcd`, `benchmark`, and `bridge` binaries. To build these binaries, run the following from the etcd repository root:\n\n```sh\n./scripts/build.sh\npushd tools/benchmark/ && go build && popd\npushd tools/local-tester/bridge && go build && popd\n```\n\n# Running\n\nThe fault injected cluster is invoked with `goreman`:\n\n```sh\ngoreman -f tools/local-tester/Procfile start\n```\n","isInternal":false,"tokens":271,"sizeBytes":1146},{"name":"README.md","path":"tools/rw-heatmaps/README.md","rawUrl":"https://raw.githubusercontent.com/etcd-io/etcd/HEAD/tools/rw-heatmaps/README.md","title":"rw-heatmaps Documentation","category":"plugin-manifest","format":"markdown","content":"# etcd/tools/rw-heatmaps\n\n`etcd/tools/rw-heatmaps` is the mixed read/write performance evaluation tool for etcd clusters.\n\n## Installation\n\nInstall the tool by running the following command from the etcd source directory.\n\n```sh\n  $ go install -v ./tools/rw-heatmaps\n```\n\nThe installation will place executables in the $GOPATH/bin. If $GOPATH environment variable is not set, the tool will be installed into the $HOME/go/bin. You can also find out the installed location by running the following command from the etcd source directory. Make sure that $PATH is set accordingly in your environment.\n\n```sh\n  $ go list -f \"{{.Target}}\" ./tools/rw-heatmaps\n```\n\nAlternatively, instead of installing the tool, you can use it by simply running the following command from the etcd source directory.\n\n```sh\n  $ go run ./tools/rw-heatmaps\n```\n\n## Execute\n\n### Benchmark\n\nTo get a mixed read/write performance evaluation result:\n```sh\n  # run with default configurations and specify the working directory\n  $ ./rw-benchmark.sh -w ${WORKING_DIR}\n```\n`rw-benchmark.sh` will automatically use the etcd binary compiled under `etcd/bin/` directory.\n\nNote: the result CSV file will be saved to current working directory. The working directory is where etcd database is saved. The working directory is designed for scenarios where a different mounted disk is preferred.\n\n### Plot Graphs\n\nTo generate two images (read and write) based on the benchmark result CSV file:\n\n```sh\n  # to generate a pair of read & write images from one data csv file\n  $ rw-heatmaps ${CSV_FILE} -t ${IMAGE_TITLE} -o ${OUTPUT_IMAGE_NAME}\n```\n\nTo generate two images (read and write) showing the performance difference from two result CSV files:\n\n```sh\n  # to generate a pair of read & write images from one data csv file\n  $ rw-heatmaps ${CSV_FILE1} ${CSV_FILE2} -t ${IMAGE_TITLE} -o ${OUTPUT_IMAGE_NAME}\n```\n\nTo see the available options use the `--help` option.\n\n```sh\n  $ rw-heatmaps --help\n\nrw-heatmaps is a tool to generate read/write heatmaps images for etcd3.\n\nUsage:\n  rw-heatmaps [input file(s) in csv format] [flags]\n\nFlags:\n  -h, --help                       help for rw-heatmaps\n  -f, --output-format string       output image file format (default \"jpg\")\n  -o, --output-image-file string   output image filename (required)\n  -t, --title string               plot graph title (required)\n      --zero-centered              plot the improvement graph with white color represents 0.0 (default true)\n```\n","isInternal":false,"tokens":599,"sizeBytes":2470}],"systemPromptSnippet":"<yakaai_skills repo=\"etcd-io/etcd\">\n<!-- File: tools/.golangci.yaml (Tokens: ~1543 | Category: anthropic-skill) -->\n---\nversion: \"2\"\nlinters:\n  default: none\n  enable: # please keep this alphabetized\n    - errorlint\n    - goheader\n    - govet\n    - ineffassign\n    - misspell\n    - nakedret\n    - revive\n    - staticcheck\n    - testifylint\n    - thelper\n    - unconvert # Remove unnecessary type conversions\n    - unparam\n    - unused\n    - usestdlibvars\n    - usetesting\n    - whitespace\n  settings:\n    goheader:\n      values:\n        regexp:\n          ORIGINAL_YEAR: 20[1-2][0-9]\n      template: |-\n        Copyright {{ORIGINAL_YEAR}} The etcd Authors\n\n        Licensed under the Apache License, Version 2.0 (the \"License\");\n        you may not use this file except in compliance with the License.\n        You may obtain a copy of the License at\n\n            http://www.apache.org/licenses/LICENSE-2.0\n\n        Unless required by applicable law or agreed to in writing, software\n        distributed under the License is distributed on an \"AS IS\" BASIS,\n        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n        See the License for the specific language governing permissions and\n        limitations under the License.\n    govet:\n      enable:\n        - shadow\n    nakedret:\n      # Align with https://github.com/alexkohler/nakedret/blob/v1.0.2/cmd/nakedret/main.go#L10\n      max-func-lines: 5\n    revive:\n      confidence: 0.8\n      rules:\n        - name: blank-imports\n        - name: context-as-argument\n        - name: context-keys-type\n        - name: dot-imports\n        - name: early-return\n          arguments:\n            - preserveScope\n        - name: error-return\n        - name: error-naming\n        - name: error-strings\n        - name: errorf\n        - name: if-return\n        - name: increment-decrement\n        - name: indent-error-flow\n        - name: package-comments\n        - name: range\n        - name: receiver-naming\n        - name: superfluous-else\n          arguments:\n            - preserveScope\n        - name: time-naming\n        - name: unnecessary-stmt\n        - name: use-any\n        - name: var-declaration\n        - name: var-naming\n          arguments:\n            # The following is the configuration for var-naming rule, the first element is the allow list and the second element is the deny list.\n            - [] # AllowList: leave it empty to use the default (empty, too). This means that we're not relaxing the rule in any way, i.e. elementId will raise a violation, it should be elementID, refer to the next line to see the list of denied initialisms.\n            # DenyList: Add GRPC and WAL to strict the rule not allowing instances like Wal or Grpc. The default values are located at commonInitialisms, refer to: https://github.com/mgechev/revive/blob/v1.3.7/lint/utils.go#L93-L133.\n            - - GRPC\n              - WAL\n            # Disable checks on package names that collide with Go standard library packages. See example error:\n            #    var-naming: avoid package names that conflict with Go standard library package names (revive)\n            - - skip-package-name-collision-with-go-std: true\n        - name: exported\n          disabled: true\n        - name: unexported-return\n          disabled: true\n    staticcheck:\n      checks:\n        - all\n        - -SA2002 # TODO(fix) Called testing.T.FailNow or SkipNow in a goroutine, which isn’t allowed\n        - -QF1001 # TODO(fix) Apply De Morgan’s law\n        - -QF1002 # TODO(fix) Convert untagged switch to tagged switch\n        - -QF1003 # TODO(fix) Convert if/else-if chain to tagged switch\n        - -QF1004 # TODO(fix) Use strings.ReplaceAll instead of strings.Replace with n == -1\n        - -QF1006 # TODO(fix) Lift if+break into loop condition\n        - -QF1008 # TODO(fix) Omit embedded fields from selector expression\n        - -QF1009 # TODO(fix) Use time.Time.Equal instead of == operator\n        - -QF1012 # TODO(fix) Use fmt.Fprintf(x, ...) instead of x.Write(fmt.Sprintf(...))\n        - -ST1003 # TODO(fix) Poorly chosen identifier\n        - -ST1005 # TODO(fix) Drop unnecessary use of the blank identifier\n        - ST1019 # Importing the same package multiple times.\n    testifylint:\n      enable-all: true\n      formatter:\n        # Require f-assertions (e.g. assert.Equalf) if a message is passed to the assertion, even if\n        # there is no variable-length variables, i.e. require require.NoErrorf for both cases below:\n        # require.NoErrorf(t, err, \"whatever message\")\n        # require.NoErrorf(t, err, \"whatever message: %v\", v)\n        #\n        # Note from golang programming perspective, we still prefer non-f-functions (i.e. fmt.Print)\n        # to f-functions (i.e. fmt.Printf) when there is no variable-length parameters. It's accepted\n        # to always require f-functions for stretchr/testify, but not for golang standard lib.\n        # Also refer to https://github.com/etcd-io/etcd/pull/18741#issuecomment-2422395914\n        require-f-funcs: true\n    thelper:\n      test:\n        first: false\n        begin: false\n      fuzz:\n        first: false\n        begin: false\n      benchmark:\n        first: false\n        begin: false\n      tb:\n        first: false\n        begin: false\n    usetesting:\n      os-mkdir-temp: false\n  exclusions:\n    generated: lax\n    presets:\n      - comments\n      - common-false-positives\n      - legacy\n      - std-error-handling\n    rules:\n      - linters:\n          - ineffassign\n        path: conversion\\.go\n      - linters:\n          - staticcheck\n        text: S1000\n      - linters:\n          - revive\n        text: 'var-naming: avoid meaningless package names'\n    paths:\n      - ^zz_generated.*\n      - third_party$\n      - builtin$\n      - examples$\nissues:\n  max-same-issues: 0\nformatters:\n  enable:\n    - gci\n    - gofmt\n    - goimports\n  settings: # please keep this alphabetized\n    gci:\n      sections:\n        - standard\n        - default\n        - prefix(go.etcd.io)\n    goimports:\n      local-prefixes:\n        - go.etcd.io # Put imports beginning with prefix after 3rd-party packages.\n  exclusions:\n    generated: lax\n    paths:\n      - ^zz_generated.*\n      - third_party$\n      - builtin$\n      - examples$\n\n<!-- File: tools/benchmark/README.md (Tokens: ~207 | Category: plugin-manifest) -->\n# etcd/tools/benchmark\n\n`etcd/tools/benchmark` is the official benchmarking tool for etcd clusters.\n\n## Installation\n\nInstall the tool by running the following command from the etcd source directory.\n\n```\n  $ go install -v ./tools/benchmark\n```\n\nThe installation will place executables in the $GOPATH/bin. If $GOPATH environment variable is not set, the tool will be installed into the $HOME/go/bin. You can also find out the installed location by running the following command from the etcd source directory. Make sure that $PATH is set accordingly in your environment.\n\n```\n  $ go list -f \"{{.Target}}\" ./tools/benchmark\n```\n\nAlternatively, instead of installing the tool, you can use it by simply running the following command from the etcd source directory.\n\n```\n  $ go run ./tools/benchmark\n```\n\n## Usage\n\nThe following command should output the usage per the latest development.\n\n```\n  $ benchmark --help\n```\n\n<!-- File: tools/container-images/README.md (Tokens: ~98 | Category: plugin-manifest) -->\n# Container Images\n\nThe container images defined in this directory are used to maintain\ndepenendencies up to date. **These images are not used to build the project.**\n\nThese images cause [Dependabot] to do a version bump. After that, a [GitHub\naction] will update other artifacts in the repository.\n\n[Dependabot]: ../../.github/dependabot.yml\n[GitHub action]: ../../.github/workflows/bump-devcontainer-version.yml\n\n<!-- File: tools/etcd-dump-db/README.md (Tokens: ~1474 | Category: plugin-manifest) -->\n# etcd-dump-db\n\n`etcd-dump-db` inspects etcd db files.\n\n## Installation\n\nInstall the tool by running the following command from the etcd source directory.\n\n```\n  $ go install -v ./tools/etcd-dump-db\n```\n\nThe installation will place executables in the $GOPATH/bin. If $GOPATH environment variable is not set, the tool will be installed into the $HOME/go/bin. You can also find out the installed location by running the following command from the etcd source directory. Make sure that $PATH is set accordingly in your environment.\n\n```\n  $ go list -f \"{{.Target}}\" ./tools/etcd-dump-db\n```\n\nAlternatively, instead of installing the tool, you can use it by simply running the following command from the etcd source directory.\n\n```\n  $ go run ./tools/etcd-dump-db\n```\n\n## Usage\n\nThe following command should output the usage per the latest development.\n\n```\n  $ etcd-dump-db --help\n```\n\nAn example of usage detail is provided below.\n\n```\nUsage:\n  etcd-dump-db [command]\n\nAvailable Commands:\n  list-bucket    bucket lists all buckets.\n  iterate-bucket iterate-bucket lists key-value pairs in reverse order.\n  hash           hash computes the hash of db file.\n\nFlags:\n  -h, --help[=false]: help for etcd-dump-db\n\nUse \"etcd-dump-db [command] --help\" for more information about a command.\n```\n\n\n#### list-bucket [data dir or db file path]\n\nLists all buckets.\n\n```\n$ etcd-dump-db list-bucket agent01/agent.etcd\n\nalarm\nauth\nauthRoles\nauthUsers\ncluster\nkey\nlease\nmembers\nmembers_removed\nmeta\n```\n\n\n#### hash [data dir or db file path]\n\nComputes the hash of db file.\n\n```\n$ etcd-dump-db hash agent01/agent.etcd\ndb path: agent01/agent.etcd/member/snap/db\nHash: 3700260467\n\n\n$ etcd-dump-db hash agent02/agent.etcd\n\ndb path: agent02/agent.etcd/member/snap/db\nHash: 3700260467\n\n\n$ etcd-dump-db hash agent03/agent.etcd\n\ndb path: agent03/agent.etcd/member/snap/db\nHash: 3700260467\n```\n\n\n#### iterate-bucket [data dir or db file path]\n\nLists key-value pairs in reverse order.\n\n```\n$ etcd-dump-db iterate-bucket agent03/agent.etcd key --limit 3\n\nkey=\"\\x00\\x00\\x00\\x00\\x005@x_\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\tt\", value=\"\\n\\x153640412599896088633_9\"\nkey=\"\\x00\\x00\\x00\\x00\\x005@x_\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\bt\", value=\"\\n\\x153640412599896088633_8\"\nkey=\"\\x00\\x00\\x00\\x00\\x005@x_\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\at\", value=\"\\n\\x153640412599896088633_7\"\n```\n\n#### scan-keys [data dir or db file path]\n\nScans all the key-value pairs starting from a specific revision in the key space. It works even the db is corrupted.\n\n```\n$ ./etcd-dump-db scan-keys ~/tmp/etcd/778/db.db 16589739 2>/dev/null | grep \"/registry/configmaps/istio-system/istio-namespace-controller-election\"\npageID=1306, index=5/5, rev={Revision:{Main:16589739 Sub:0} tombstone:false}, value=[key \"/registry/configmaps/istio-system/istio-namespace-controller-election\" | val \"k8s\\x00\\n\\x0f\\n\\x02v1\\x12\\tConfigMap\\x12\\xeb\\x03\\n\\xe8\\x03\\n#istio-namespace-controller-election\\x12\\x00\\x1a\\fistio-system\\\"\\x00*$bb696087-260d-4167-bf06-17d3361f9b5f2\\x008\\x00B\\b\\b\\x9e\\xbe\\xed\\xb5\\x06\\x10\\x00b\\xe6\\x01\\n(control-plane.alpha.kubernetes.io/leader\\x12\\xb9\\x01{\\\"holderIdentity\\\":\\\"istiod-d56968787-txq2d\\\",\\\"holderKey\\\":\\\"default\\\",\\\"leaseDurationSeconds\\\":30,\\\"acquireTime\\\":\\\"2024-08-13T13:26:54Z\\\",\\\"renewTime\\\":\\\"2024-08-27T06:16:13Z\\\",\\\"leaderTransitions\\\":0}\\x8a\\x01\\x90\\x01\\n\\x0fpilot-discovery\\x12\\x06Update\\x1a\\x02v1\\\"\\b\\b\\xad\\u07b5\\xb6\\x06\\x10\\x002\\bFieldsV1:[\\nY{\\\"f:metadata\\\":{\\\"f:annotations\\\":{\\\".\\\":{},\\\"f:control-plane.alpha.kubernetes.io/leader\\\":{}}}}B\\x00\\x1a\\x00\\\"\\x00\" | created 9612546 | mod 16589739 | ver 157604]\npageID=4737, index=4/4, rev={Revision:{Main:16589786 Sub:0} tombstone:false}, value=[key \"/registry/configmaps/istio-system/istio-namespace-controller-election\" | val \"k8s\\x00\\n\\x0f\\n\\x02v1\\x12\\tConfigMap\\x12\\xeb\\x03\\n\\xe8\\x03\\n#istio-namespace-controller-election\\x12\\x00\\x1a\\fistio-system\\\"\\x00*$bb696087-260d-4167-bf06-17d3361f9b5f2\\x008\\x00B\\b\\b\\x9e\\xbe\\xed\\xb5\\x06\\x10\\x00b\\xe6\\x01\\n(control-plane.alpha.kubernetes.io/leader\\x12\\xb9\\x01{\\\"holderIdentity\\\":\\\"istiod-d56968787-txq2d\\\",\\\"holderKey\\\":\\\"default\\\",\\\"leaseDurationSeconds\\\":30,\\\"acquireTime\\\":\\\"2024-08-13T13:26:54Z\\\",\\\"renewTime\\\":\\\"2024-08-27T06:16:21Z\\\",\\\"leaderTransitions\\\":0}\\x8a\\x01\\x90\\x01\\n\\x0fpilot-discovery\\x12\\x06Update\\x1a\\x02v1\\\"\\b\\b\\xb5\\u07b5\\xb6\\x06\\x10\\x002\\bFieldsV1:[\\nY{\\\"f:metadata\\\":{\\\"f:annotations\\\":{\\\".\\\":{},\\\"f:control-plane.alpha.kubernetes.io/leader\\\":{}}}}B\\x00\\x1a\\x00\\\"\\x00\" | created 9612546 | mod 16589786 | ver 157605]\n```\n\n<!-- File: tools/etcd-dump-logs/README.md (Tokens: ~2702 | Category: plugin-manifest) -->\n# etcd-dump-logs\n\n`etcd-dump-logs` dumps the log from data directory.\n\n## Installation\n\nInstall the tool by running the following command from the etcd source directory.\n\n```bash\n  $ go install -v ./tools/etcd-dump-logs\n```\n\nThe installation will place executables in the $GOPATH/bin. If $GOPATH environment variable is not set, the tool will be installed into the $HOME/go/bin. You can also find out the installed location by running the following command from the etcd source directory. Make sure that $PATH is set accordingly in your environment.\n\n```bash\n  $ go list -f \"{{.Target}}\" ./tools/etcd-dump-logs\n```\n\nAlternatively, instead of installing the tool, you can use it by simply running the following command from the etcd source directory.\n\n```bash\n  $ go run ./tools/etcd-dump-logs\n```\n\n## Usage\n\nThe following command should output the usage per the latest development.\n\n```bash\n  $ etcd-dump-logs --help\n```\n\nAn example of usage detail is provided below.\n\n```bash\nUsage:\n\n  etcd-dump-logs [data dir]\n    * Data dir is where the snapshots and WAL logs are located. The structure of the data dir should look like this:\n        - data_dir/member\n            - data_dir/member/snap\n            - data_dir/member/wal\n                - data_dir/member/wal/0000000000000000-0000000000000000.wal\n\nFlags:\n  -end-index uint\n      The index to stop dumping (exclusive) (default 18446744073709551615)\n  -entry-type string\n      If set, filters output by entry type. Must be one or more than one of:\n      ConfigChange, Normal, Request, InternalRaftRequest,\n      IRRRange, IRRPut, IRRDeleteRange, IRRTxn,\n      IRRCompaction, IRRLeaseGrant, IRRLeaseRevoke, IRRLeaseCheckpoint (default \"Normal,ConfigChange\")\n  -raw\n      Read the logs in the low-level form\n  -start-index uint\n      The index to start dumping (inclusive). If unspecified, dumps from the index of the last snapshot.\n  -stream-decoder string\n      The name of an executable decoding tool, the executable must process\n      hex encoded lines of binary input (from etcd-dump-logs)\n      and output a hex encoded line of binary for each input line\n  -wal-dir string\n      If set, dumps WAL from the informed path, rather than following the standard 'data_dir/member/wal/' location\n```\n\n#### etcd-dump-logs -entry-type <ENTRY_TYPE_NAME(S)> [data dir]\n\nFilter entries by type from WAL log.\n\n```bash\n$ etcd-dump-logs -entry-type IRRTxn /tmp/datadir\nSnapshot:\nempty\nStart dupmping log entries from snapshot.\nWAL metadata:\nnodeID=0 clusterID=0 term=0 commitIndex=0 vote=0\nWAL entries:\nlastIndex=34\nterm         index  type    data\n   7            13  norm    ID:8 txn:<success:<request_delete_range:<key:\"a\" range_end:\"k8s\\000\\n\\025\\n\\002v1\\022\\017RangeAllocation\\022#\\n\\022\\n\\000\\022\\000\\032\\000\\\"\\000*\\0002\\0008\\000B\\000z\\000\\022\\01310.0.0.0/16\\032\\000\\032\\000\\\"\\000\" > > failure:<request_delete_range:<key:\"a\" range_end:\"k8s\\000\\n\\025\\n\\002v1\\022\\017RangeAllocation\\022#\\n\\022\\n\\000\\022\\000\\032\\000\\\"\\000*\\0002\\0008\\000B\\000z\\000\\022\\01310.0.0.0/16\\032\\000\\032\\000\\\"\\000\" > > >\n\nEntry types (IRRTxn) count is : 1\n\n$ etcd-dump-logs -entry-type ConfigChange,IRRCompaction /tmp/datadir\nSnapshot:\nempty\nStart dupmping log entries from snapshot.\nWAL metadata:\nnodeID=0 clusterID=0 term=0 commitIndex=0 vote=0\nWAL entries:\nlastIndex=34\nterm         index  type    data\n   1             1  conf    method=ConfChangeAddNode id=2\n   2             2  conf    method=ConfChangeRemoveNode id=2\n   2             3  conf    method=ConfChangeUpdateNode id=2\n   2             4  conf    method=ConfChangeAddLearnerNode id=3\n   8            14  norm    ID:9 compaction:<physical:true >\n\nEntry types (ConfigChange,IRRCompaction) count is : 5\n```\n\n#### etcd-dump-logs -stream-decoder <EXECUTABLE_DECODER> [data dir]\n\nDecode each entry based on logic in the passed decoder. Decoder status and decoded data are listed in separated tab/columns in the output. For parsing purpose, the output from decoder are expected to be in format of \"<DECODER_STATUS>|<DECODED_DATA>\". Please refer to [decoder_correctoutputformat.sh] as an example.\n\nHowever, if the decoder output format is not as expected, \"decoder_status\" will be \"decoder output format is not right, print output anyway\", and all output from decoder will be considered as \"decoded_data\"\n\n```bash\n$ etcd-dump-logs -stream-decoder decoder_correctoutputformat.sh  /tmp/datadir\nSnapshot:\nempty\nStart dupmping log entries from snapshot.\nWAL metadata:\nnodeID=0 clusterID=0 term=0 commitIndex=0 vote=0\nWAL entries:\nlastIndex=34\nterm         index  type    data    decoder_status    decoded_data\n   1             1  conf    method=ConfChangeAddNode id=2    ERROR    jhjaajjjahjbbbjj\n   3             2  norm    noop    OK    jhjjabjjaajfbfgjfagdfhcjbbahgbbbfhfegibbcabbfhffbbbcbbfhfibbcaebbbgiffbbedgdbhjacbjjchjjdjjjdhjiejjjehjafjjjfhjjgjjjghjahjjajjhhjajj\n   3             3  norm    method=QGET path=\"/path1\"    OK    jhjaabjdeadgdeedaajfbfgjfagdfhcabbacgbbbcjbbcabbcabbbcbbcbbbcaebbbccbbedgdbhjjcbjjchjjdjjjdhjiejjjehjafjjjfhjjgjjjghjahjjajjhhjajj\n   7             4  norm    ID:8 txn:<success:<request_delete_range:<key:\"a\" range_end:\"b\" > > failure:<request_delete_range:<key:\"a\" range_end:\"b\" > > >     OK    jhjhcbadabjhaajfjajafaabjafbaajhaajfjajafaabjafb\n   8             5  norm    ID:9 compaction:<physical:true >     ERROR    jhjicajbajja\n   9             6  norm    ID:10 lease_grant:<TTL:1 ID:1 >     ERROR    jhjadbjdjhjaajja\n  12             7  norm    ID:13 auth_enable:<>   ERROR    jhjdcbcejj\n  27             8  norm    ??? ERROR  cf\nEntry types () count is : 8\n```\n\n```bash\n$ etcd-dump-logs -stream-decoder decoder_wrongoutputformat.sh  /tmp/datadir\nSnapshot:\nempty\nStart dupmping log entries from snapshot.\nWAL metadata:\nnodeID=0 clusterID=0 term=0 commitIndex=0 vote=0\nWAL entries:\nlastIndex=34\nterm         index  type    data    decoder_status  decoded_data\n   1             1  conf    method=ConfChangeAddNode id=2   decoder output format is not right, print output anyway jhjaajjjahjbbbjj\n   3             2  norm    noop    decoder output format is not right, print output anyway jhjjabjjaajfbfgjfagdfhcjbbahgbbbfhfegibbcabbfhffbbbcbbfhfibbcaebbbgiffbbedgdbhjacbjjchjjdjjjdhjiejjjehjafjjjfhjjgjjjghjahjjajjhhjajj\n   3             3  norm    method=QGET path=\"/path1\"    decoder output format is not right, print output anyway    jhjaabjdeadgdeedaajfbfgjfagdfhcabbacgbbbcjbbcabbcabbbcbbcbbbcaebbbccbbedgdbhjjcbjjchjjdjjjdhjiejjjehjafjjjfhjjgjjjghjahjjajjhhjajj\n   7             4  norm    ID:8 txn:<success:<request_delete_range:<key:\"a\" range_end:\"b\" > > failure:<request_delete_range:<key:\"a\" range_end:\"b\" > > >   decoder output format is not right, print output anyway jhjhcbadabjhaajfjajafaabjafbaajhaajfjajafaabjafb\n   8             5  norm    ID:9 compaction:<physical:true >     decoder output format is not right, print output anyway    jhjicajbajja\n   9             6  norm    ID:10 lease_grant:<TTL:1 ID:1 >     decoder output format is not right, print output anyway jhjadbjdjhjaajja\n  12             7  norm    ID:13 auth_enable:<>   decoder output format is not right, print output anyway  jhjdcbcejj\n  27             8  norm    ??? decoder output format is not right, print output anyway cf\nEntry types () count is : 8\n\n```\n\n#### `etcd-dump-logs -start-index <INDEX NUMBER> [data dir]`\n\nOnly shows WAL log entries after the specified start-index number, inclusively.\n\n```bash\n$ etcd-dump-logs -start-index 31  /tmp/datadir\nStart dumping log entries from index 31.\nWAL metadata:\nnodeID=0 clusterID=0 term=0 commitIndex=0 vote=0\nWAL entries:\nlastIndex=34\nterm         index  type    data\n  25            31  norm    ID:26 auth_role_get:<role:\"role3\" >\n  26            32  norm    ID:27 auth_role_grant_permission:<name:\"role3\" perm:<permType:WRITE key:\"Keys\" range_end:\"RangeEnd\" > >\n  27            33  norm    ID:28 auth_role_revoke_permission:<role:\"role3\" key:\"key\" range_end:\"rangeend\" >\n  27            34  norm    ???\nEntry types () count is : 4\n```\n\n#### `etcd-dump-logs -start-index <INDEX NUMBER> -end-index <INDEX NUMBER> [data dir]`\n\nOnly shows WAL log entries from the specified start-index number (inclusively) to the specified end-index number (exclusively).\n\n```bash\n$ etcd-dump-logs -start-index 930 -end-index 932  /tmp/datadir\nStart dumping log entries from index 930.\nWAL metadata:\nnodeID=0 clusterID=0 term=5 commitIndex=2448 vote=0\nWAL entries: 2\nlastIndex=931\nterm       index    type    data\n   3         930    norm    header:<ID:11010058442592651283 > put:<key:\"key7\" value:\"923\" >\n   3         931    norm    header:<ID:6577953459306661672 > put:<key:\"key8\" value:\"924\" >\n\nEntry types (Normal,ConfigChange) count is : 2\n```\n\n[decoder_correctoutputformat.sh]: ./testdecoder/decoder_correctoutputformat.sh\n\n<!-- File: tools/etcd-dump-metrics/README.md (Tokens: ~353 | Category: plugin-manifest) -->\n# etcd-dump-metrics\n\n `etcd-dump-metrics` provides metrics for the latest main branch, a given endpoint, or version.\n\n## Installation\n\nInstall the tool by running the following command from the etcd source directory.\n\n```\n  $ go install -v ./tools/etcd-dump-metrics\n```\n\nThe installation will place executables in the $GOPATH/bin. If $GOPATH environment variable is not set, the tool will be\ninstalled into the $HOME/go/bin. You can also find out the installed location by running the following command from the\netcd source directory. Make sure that $PATH is set accordingly in your environment.\n\n```\n  $ go list -f \"{{.Target}}\" ./tools/etcd-dump-metrics\n```\n\nAlternatively, instead of installing the tool, you can use it by simply running the following command from the etcd source\ndirectory.\n\n```\n  $ go run ./tools/etcd-dump-metrics\n```\n\n## Usage\n\nThe following command should output the usage per the latest development.\n\n```\n  $ etcd-dump-metrics --help\n```\n\nAn example of usage detail is provided below.\n\n### For the latest main branch\n```\n  $ etcd-dump-metrics\n```\n\n### For the provided endpoint\n```\n  $ goreman start\n  $ etcd-dump-metrics --addr http://localhost:2379/metrics\n```\n\n### Download specific version to temporary directory to fetch metrics\n```\n  $ etcd-dump-metrics --debug --download-ver v3.5.3\n  $ etcd-dump-metrics --download-ver v3.5.3\n```\n\n<!-- File: tools/local-tester/README.md (Tokens: ~271 | Category: plugin-manifest) -->\n# etcd local-tester\n\n> [!WARNING]\n> etcd-local-tester is now deprecated in favor of our much more comprehensive [robustness testing suite](https://github.com/etcd-io/etcd/tree/main/tests/robustness). In a future etcd release this historic tool will be removed as it is no longer maintained.\n\nThe etcd local-tester runs a fault injected cluster using local processes. It sets up an etcd cluster with unreliable network bridges on its peer and client interfaces. The cluster runs with a constant stream of `Put` requests to simulate client usage. A fault injection script periodically kills cluster members and disrupts bridge connectivity.\n\n# Requirements\n\nlocal-tester depends on `goreman` to manage its processes and `bash` to run fault injection.\n\n# Building\n\nlocal-tester needs `etcd`, `benchmark`, and `bridge` binaries. To build these binaries, run the following from the etcd repository root:\n\n```sh\n./scripts/build.sh\npushd tools/benchmark/ && go build && popd\npushd tools/local-tester/bridge && go build && popd\n```\n\n# Running\n\nThe fault injected cluster is invoked with `goreman`:\n\n```sh\ngoreman -f tools/local-tester/Procfile start\n```\n\n<!-- File: tools/rw-heatmaps/README.md (Tokens: ~599 | Category: plugin-manifest) -->\n# etcd/tools/rw-heatmaps\n\n`etcd/tools/rw-heatmaps` is the mixed read/write performance evaluation tool for etcd clusters.\n\n## Installation\n\nInstall the tool by running the following command from the etcd source directory.\n\n```sh\n  $ go install -v ./tools/rw-heatmaps\n```\n\nThe installation will place executables in the $GOPATH/bin. If $GOPATH environment variable is not set, the tool will be installed into the $HOME/go/bin. You can also find out the installed location by running the following command from the etcd source directory. Make sure that $PATH is set accordingly in your environment.\n\n```sh\n  $ go list -f \"{{.Target}}\" ./tools/rw-heatmaps\n```\n\nAlternatively, instead of installing the tool, you can use it by simply running the following command from the etcd source directory.\n\n```sh\n  $ go run ./tools/rw-heatmaps\n```\n\n## Execute\n\n### Benchmark\n\nTo get a mixed read/write performance evaluation result:\n```sh\n  # run with default configurations and specify the working directory\n  $ ./rw-benchmark.sh -w ${WORKING_DIR}\n```\n`rw-benchmark.sh` will automatically use the etcd binary compiled under `etcd/bin/` directory.\n\nNote: the result CSV file will be saved to current working directory. The working directory is where etcd database is saved. The working directory is designed for scenarios where a different mounted disk is preferred.\n\n### Plot Graphs\n\nTo generate two images (read and write) based on the benchmark result CSV file:\n\n```sh\n  # to generate a pair of read & write images from one data csv file\n  $ rw-heatmaps ${CSV_FILE} -t ${IMAGE_TITLE} -o ${OUTPUT_IMAGE_NAME}\n```\n\nTo generate two images (read and write) showing the performance difference from two result CSV files:\n\n```sh\n  # to generate a pair of read & write images from one data csv file\n  $ rw-heatmaps ${CSV_FILE1} ${CSV_FILE2} -t ${IMAGE_TITLE} -o ${OUTPUT_IMAGE_NAME}\n```\n\nTo see the available options use the `--help` option.\n\n```sh\n  $ rw-heatmaps --help\n\nrw-heatmaps is a tool to generate read/write heatmaps images for etcd3.\n\nUsage:\n  rw-heatmaps [input file(s) in csv format] [flags]\n\nFlags:\n  -h, --help                       help for rw-heatmaps\n  -f, --output-format string       output image file format (default \"jpg\")\n  -o, --output-image-file string   output image filename (required)\n  -t, --title string               plot graph title (required)\n      --zero-centered              plot the improvement graph with white color represents 0.0 (default true)\n```\n</yakaai_skills>"}