diff --git a/.changelog/10515.txt b/.changelog/10515.txt new file mode 100644 index 0000000000..b83e5e154e --- /dev/null +++ b/.changelog/10515.txt @@ -0,0 +1,3 @@ +```release-note:bug +agent: fix a panic on 32-bit platforms caused by misaligned struct fields used with sync/atomic. +``` diff --git a/.circleci/config.yml b/.circleci/config.yml index 12cd0d4d14..5a273c4804 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -60,7 +60,7 @@ steps: name: notify-slack-failure when: on_fail command: | - if [[ $CIRCLE_BRANCH == "master" ]]; then + if [[ $CIRCLE_BRANCH == "main" ]]; then CIRCLE_ENDPOINT="https://app.circleci.com/pipelines/github/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}?branch=${CIRCLE_BRANCH}" GITHUB_ENDPOINT="https://github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/commit/${CIRCLE_SHA1}" COMMIT_MESSAGE=$(git log -1 --pretty=%B | head -n1) @@ -79,7 +79,7 @@ steps: ] \ }" "${FEED_CONSUL_GH_URL}" else - echo "Not posting slack failure notifications for non-master branch" + echo "Not posting slack failure notifications for non-main branch" fi commands: @@ -116,14 +116,20 @@ jobs: - run: go get -u github.com/hashicorp/lint-consul-retry && lint-consul-retry - run: *notify-slack-failure - # Runs Go linters lint: + description: "Run golangci-lint" + parameters: + go-arch: + type: string + default: "" docker: - image: *GOLANG_IMAGE environment: GOTAGS: "" # No tags for OSS but there are for enterprise + GOARCH: "<>" steps: - checkout + - run: go env - run: name: Install golangci-lint command: | @@ -275,6 +281,40 @@ jobs: path: /tmp/jsonfile - run: *notify-slack-failure + # go-test-32bit is to catch problems where 64-bit ints must be 64-bit aligned + # to use them with sync/atomic. See https://golang.org/pkg/sync/atomic/#pkg-note-BUG. + # Running tests with GOARCH=386 seems to be the best way to detect this + # problem. Only runs tests that are -short to limit the time we spend checking + # for these bugs. + go-test-32bit: + docker: + - image: *GOLANG_IMAGE + environment: + <<: *ENVIRONMENT + GOTAGS: "" # No tags for OSS but there are for enterprise + steps: + - checkout + - run: *install-gotestsum + - run: go mod download + - run: + name: go test 32-bit + environment: + GOARCH: 386 + command: | + mkdir -p $TEST_RESULTS_DIR /tmp/jsonfile + go env + gotestsum \ + --jsonfile /tmp/jsonfile/go-test-32bit.log \ + --junitfile $TEST_RESULTS_DIR/gotestsum-report.xml -- \ + -tags="$GOTAGS" -p 2 \ + -short ./... + + - store_test_results: + path: *TEST_RESULTS_DIR + - store_artifacts: + path: *TEST_RESULTS_DIR + - run: *notify-slack-failure + go-test-lib: description: "test a library against a specific Go version" parameters: @@ -386,7 +426,7 @@ jobs: <<: *ENVIRONMENT steps: - checkout - - attach_workspace: # this normally runs as the first job and has nothing to attach; only used in master branch after rebuilding UI + - attach_workspace: # this normally runs as the first job and has nothing to attach; only used in main branch after rebuilding UI at: . - run: command: make dev @@ -486,7 +526,7 @@ jobs: path: *TEST_RESULTS_DIR - run: *notify-slack-failure - # run integration tests on nomad/master + # run integration tests on nomad/main nomad-integration-main: docker: - image: *GOLANG_IMAGE @@ -648,7 +688,7 @@ jobs: short_sha=$(git rev-parse --short HEAD) git add agent/uiserver/bindata_assetfs.go git commit -m "auto-updated agent/uiserver/bindata_assetfs.go from commit ${short_sha}" - git push origin master + git push origin main else echo "no UI changes so no static assets to publish" fi @@ -833,7 +873,7 @@ jobs: path: *TEST_RESULTS_DIR - run: *notify-slack-failure - # only runs on master: checks latest commit to see if the PR associated has a backport/* or docs* label to cherry-pick + # only runs on main: checks latest commit to see if the PR associated has a backport/* or docs* label to cherry-pick cherry-picker: docker: - image: docker.mirror.hashicorp.services/alpine:3.12 @@ -961,6 +1001,10 @@ workflows: - check-generated-protobuf: *filter-ignore-non-go-branches - lint-consul-retry: *filter-ignore-non-go-branches - lint: *filter-ignore-non-go-branches + - lint: + name: "lint-32bit" + go-arch: "386" + <<: *filter-ignore-non-go-branches - test-connect-ca-providers: *filter-ignore-non-go-branches - dev-build: *filter-ignore-non-go-branches - go-test: @@ -986,6 +1030,7 @@ workflows: go-version: "1.15" <<: *filter-ignore-non-go-branches - go-test-race: *filter-ignore-non-go-branches + - go-test-32bit: *filter-ignore-non-go-branches build-distros: unless: << pipeline.parameters.trigger-load-test >> jobs: @@ -995,12 +1040,12 @@ workflows: - check-vendor - build-amd64: *require-check-vendor - build-arm: *require-check-vendor - # every commit on master will have a rebuilt UI + # every commit on main will have a rebuilt UI - frontend-cache: filters: branches: only: - - master + - main - ember-build-prod: requires: - frontend-cache @@ -1011,7 +1056,7 @@ workflows: filters: branches: only: - - master + - main - /release\/\d+\.\d+\.x$/ requires: - build-static-assets @@ -1036,7 +1081,7 @@ workflows: branches: ignore: - /^pull\/.*$/ # only push dev builds from non forks - - master # all master dev uploads will include a UI rebuild in build-distros + - main # all main dev uploads will include a UI rebuild in build-distros - dev-upload-docker: <<: *dev-upload context: consul-ci @@ -1073,7 +1118,7 @@ workflows: filters: branches: only: - - master + - main - algolia-index: context: consul-docs filters: @@ -1087,7 +1132,7 @@ workflows: filters: branches: only: - - master + - main - /^ui\/.*/ - workspace-tests: requires: @@ -1120,14 +1165,14 @@ workflows: filters: branches: only: - - master + - main - /release\/\d+\.\d+\.x$/ - cherry-picker: context: team-consul filters: branches: only: - - master + - main - /release\/\d+\.\d+\.x$/ load-test: when: << pipeline.parameters.trigger-load-test >> @@ -1141,6 +1186,6 @@ workflows: filters: branches: only: - - master + - main jobs: - load-test diff --git a/.circleci/scripts/cherry-picker.sh b/.circleci/scripts/cherry-picker.sh index 8a997ac453..a217e4a2bb 100755 --- a/.circleci/scripts/cherry-picker.sh +++ b/.circleci/scripts/cherry-picker.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# This script is meant to run on every new commit to master in CircleCI. If the commit comes from a PR, it will +# This script is meant to run on every new commit to main in CircleCI. If the commit comes from a PR, it will # check the PR associated with the commit for labels. If the label matches `docs*` it will be cherry-picked # to stable-website. If the label matches `backport/*`, it will be cherry-picked to the appropriate `release/*` # branch. diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 4349c90b36..8cc9ef6644 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -60,7 +60,7 @@ issue. Stale issues will be closed. ## Building Consul If you wish to work on Consul itself, you'll first need [Go](https://golang.org) -installed (version 1.14 is _required_). +installed (The version of Go should match the one of our [CI config's](https://github.com/hashicorp/consul/blob/main/.circleci/config.yml) Go image). Next, clone this repository and then run `make dev`. In a few moments, you'll have a working diff --git a/.github/workflows/changelog-checker.yml b/.github/workflows/changelog-checker.yml index 16703030ab..abeee801b6 100644 --- a/.github/workflows/changelog-checker.yml +++ b/.github/workflows/changelog-checker.yml @@ -4,9 +4,9 @@ on: pull_request: types: [opened, synchronize, labeled] - # Runs on PRs to master and all release branches + # Runs on PRs to main and all release branches branches: - - master + - main - release/* jobs: diff --git a/.github/workflows/load-test.yml b/.github/workflows/load-test.yml index 9c6a113862..b603bf7e6c 100644 --- a/.github/workflows/load-test.yml +++ b/.github/workflows/load-test.yml @@ -1,7 +1,7 @@ on: pull_request: branches: - - master + - main types: [labeled] jobs: @@ -16,9 +16,9 @@ jobs: - name: Trigger CircleCI Load Test Pipeline run: | # build json payload to trigger CircleCI Load Test Pipeline - # This only runs the load test pipeline on the 'master' branch + # This only runs the load test pipeline on the 'main' branch jsonData=$(jq --null-input -r --arg commit ${{ github.event.pull_request.head.sha }} \ - '{branch:"master", parameters: {"commit": $commit, "trigger-load-test": true}}') + '{branch:"main", parameters: {"commit": $commit, "trigger-load-test": true}}') echo "Passing JSON data to CircleCI API: $jsonData" load_test_pipeline_id=$(curl -X POST \ -H "Circle-Token: ${{ secrets.CIRCLE_TOKEN }}" \ diff --git a/.github/workflows/website-checker.yml b/.github/workflows/website-checker.yml index cde5031f0d..505e7626bb 100644 --- a/.github/workflows/website-checker.yml +++ b/.github/workflows/website-checker.yml @@ -13,9 +13,9 @@ on: pull_request_target: types: [opened] - # Runs on PRs to master and all release branches + # Runs on PRs to main and all release branches branches: - - master + - main - release/* jobs: diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c70d3cae4..90e59af7e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1543,7 +1543,7 @@ SECURITY: IMPROVEMENTS: * build: Bumped Go version to 1.10 [[GH-3988](https://github.com/hashicorp/consul/pull/3988)] -* agent: Blocking queries on service-specific health and catalog endpoints now return a per-service `X-Consul-Index` improving watch performance on very busy clusters. [[GH-3890](https://github.com/hashicorp/consul/issues/3890)]. **Note this may break blocking clients that relied on undocumented implementation details** as noted in the [upgrade docs](https://github.com/hashicorp/consul/blob/master/website/source/docs/upgrading.html.md#upgrade-from-version-106-to-higher). +* agent: Blocking queries on service-specific health and catalog endpoints now return a per-service `X-Consul-Index` improving watch performance on very busy clusters. [[GH-3890](https://github.com/hashicorp/consul/issues/3890)]. **Note this may break blocking clients that relied on undocumented implementation details** as noted in the [upgrade docs](https://github.com/hashicorp/consul/blob/main/website/source/docs/upgrading.html.md#upgrade-from-version-106-to-higher). * agent: All endpoints now respond to OPTIONS requests. [[GH-3885](https://github.com/hashicorp/consul/issues/3885)] * agent: List of supported TLS cipher suites updated to include newer options, [[GH-3962](https://github.com/hashicorp/consul/pull/3962)] * agent: WAN federation can now be disabled by setting the serf WAN port to -1. [[GH-3984](https://github.com/hashicorp/consul/issues/3984)] @@ -1725,12 +1725,12 @@ BREAKING CHANGES: | `dogstatsd_tags` | [`telemetry.dogstatsd_tags`](https://www.consul.io/docs/agent/options.html#telemetry-dogstatsd_tags) | | `http_api_response_headers` | [`http_config.response_headers`](https://www.consul.io/docs/agent/options.html#response_headers) | | `ports.rpc` | None, the RPC server for CLI commands is no longer supported. | - | `recursor` | [`recursors`](https://github.com/hashicorp/consul/blob/master/website/source/docs/agent/options.html.md#recursors) | + | `recursor` | [`recursors`](https://github.com/hashicorp/consul/blob/main/website/source/docs/agent/options.html.md#recursors) | | `retry_join_azure` | [`-retry-join`](https://www.consul.io/docs/agent/options.html#microsoft-azure) | | `retry_join_ec2` | [`-retry-join`](https://www.consul.io/docs/agent/options.html#amazon-ec2) | | `retry_join_gce` | [`-retry-join`](https://www.consul.io/docs/agent/options.html#google-compute-engine) | - | `statsd_addr` | [`telemetry.statsd_address`](https://github.com/hashicorp/consul/blob/master/website/source/docs/agent/options.html.md#telemetry-statsd_address) | - | `statsite_addr` | [`telemetry.statsite_address`](https://github.com/hashicorp/consul/blob/master/website/source/docs/agent/options.html.md#telemetry-statsite_address) | + | `statsd_addr` | [`telemetry.statsd_address`](https://github.com/hashicorp/consul/blob/main/website/source/docs/agent/options.html.md#telemetry-statsd_address) | + | `statsite_addr` | [`telemetry.statsite_address`](https://github.com/hashicorp/consul/blob/main/website/source/docs/agent/options.html.md#telemetry-statsite_address) | | `statsite_prefix` | [`telemetry.metrics_prefix`](https://www.consul.io/docs/agent/options.html#telemetry-metrics_prefix) | | `telemetry.statsite_prefix` | [`telemetry.metrics_prefix`](https://www.consul.io/docs/agent/options.html#telemetry-metrics_prefix) | | (service definitions) `serviceid` | [`service_id`](https://www.consul.io/docs/agent/services.html) | diff --git a/GNUmakefile b/GNUmakefile index abfb87e837..585838ddf1 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -176,7 +176,7 @@ ci.dev-docker: @echo $(DOCKER_PASS) | docker login -u="$(DOCKER_USER)" --password-stdin @echo "Pushing dev image to: https://cloud.docker.com/u/hashicorpdev/repository/docker/hashicorpdev/consul" @docker push $(CI_DEV_DOCKER_NAMESPACE)/$(CI_DEV_DOCKER_IMAGE_NAME):$(GIT_COMMIT) -ifeq ($(CIRCLE_BRANCH), master) +ifeq ($(CIRCLE_BRANCH), main) @docker tag $(CI_DEV_DOCKER_NAMESPACE)/$(CI_DEV_DOCKER_IMAGE_NAME):$(GIT_COMMIT) $(CI_DEV_DOCKER_NAMESPACE)/$(CI_DEV_DOCKER_IMAGE_NAME):latest @docker push $(CI_DEV_DOCKER_NAMESPACE)/$(CI_DEV_DOCKER_IMAGE_NAME):latest endif diff --git a/README.md b/README.md index d70061d541..2643901b8c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Consul [![CircleCI](https://circleci.com/gh/hashicorp/consul/tree/master.svg?style=svg)](https://circleci.com/gh/hashicorp/consul/tree/master) [![Discuss](https://img.shields.io/badge/discuss-consul-ca2171.svg?style=flat)](https://discuss.hashicorp.com/c/consul) +# Consul [![CircleCI](https://circleci.com/gh/hashicorp/consul/tree/main.svg?style=svg)](https://circleci.com/gh/hashicorp/consul/tree/main) [![Discuss](https://img.shields.io/badge/discuss-consul-ca2171.svg?style=flat)](https://discuss.hashicorp.com/c/consul) * Website: https://www.consul.io * Tutorials: [HashiCorp Learn](https://learn.hashicorp.com/consul) @@ -54,4 +54,4 @@ https://www.consul.io/docs ## Contributing -Thank you for your interest in contributing! Please refer to [CONTRIBUTING.md](https://github.com/hashicorp/consul/blob/master/.github/CONTRIBUTING.md) for guidance. +Thank you for your interest in contributing! Please refer to [CONTRIBUTING.md](https://github.com/hashicorp/consul/blob/main/.github/CONTRIBUTING.md) for guidance. diff --git a/agent/config/runtime_test.go b/agent/config/runtime_test.go index c963e78ba8..0f02aadea2 100644 --- a/agent/config/runtime_test.go +++ b/agent/config/runtime_test.go @@ -5473,7 +5473,7 @@ func TestLoad_FullConfig(t *testing.T) { HTTPSPort: 15127, HTTPUseCache: false, KeyFile: "IEkkwgIA", - KVMaxValueSize: 1234567800000000, + KVMaxValueSize: 1234567800, LeaveDrainTime: 8265 * time.Second, LeaveOnTerm: true, Logging: logging.Config{ @@ -5868,7 +5868,7 @@ func TestLoad_FullConfig(t *testing.T) { "wan_ipv4": "78.63.37.19", }, TranslateWANAddrs: true, - TxnMaxReqLen: 5678000000000000, + TxnMaxReqLen: 567800000, UIConfig: UIConfig{ Dir: "pVncV4Ey", ContentPath: "/qp1WRhYH/", // slashes are added in parsing diff --git a/agent/config/testdata/full-config.hcl b/agent/config/testdata/full-config.hcl index 0cc708a701..6cf06ff232 100644 --- a/agent/config/testdata/full-config.hcl +++ b/agent/config/testdata/full-config.hcl @@ -285,8 +285,8 @@ limits { rpc_rate = 12029.43 rpc_max_burst = 44848 rpc_max_conns_per_client = 2954 - kv_max_value_size = 1234567800000000 - txn_max_req_len = 5678000000000000 + kv_max_value_size = 1234567800 + txn_max_req_len = 567800000 } log_level = "k1zo9Spt" log_json = true diff --git a/agent/config/testdata/full-config.json b/agent/config/testdata/full-config.json index adb3a7cfa9..2dd76c6f1a 100644 --- a/agent/config/testdata/full-config.json +++ b/agent/config/testdata/full-config.json @@ -285,8 +285,8 @@ "rpc_rate": 12029.43, "rpc_max_burst": 44848, "rpc_max_conns_per_client": 2954, - "kv_max_value_size": 1234567800000000, - "txn_max_req_len": 5678000000000000 + "kv_max_value_size": 1234567800, + "txn_max_req_len": 567800000 }, "log_level": "k1zo9Spt", "log_json": true, diff --git a/agent/grpc/stats.go b/agent/grpc/stats.go index 7ba96f91f4..8af6ec4005 100644 --- a/agent/grpc/stats.go +++ b/agent/grpc/stats.go @@ -52,8 +52,11 @@ var defaultMetrics = metrics.Default // statsHandler is a grpc/stats.StatsHandler which emits connection and // request metrics to go-metrics. type statsHandler struct { + // activeConns is used with sync/atomic and MUST be 64-bit aligned. To ensure + // alignment on 32-bit platforms this field must remain the first field in + // the struct. See https://golang.org/pkg/sync/atomic/#pkg-note-BUG. + activeConns uint64 metrics *metrics.Metrics - activeConns uint64 // must be 8-byte aligned for atomic access } func newStatsHandler(m *metrics.Metrics) *statsHandler { @@ -103,10 +106,11 @@ func (c *statsHandler) HandleConn(_ context.Context, s stats.ConnStats) { } type activeStreamCounter struct { + // count is used with sync/atomic and MUST be 64-bit aligned. To ensure + // alignment on 32-bit platforms this field must remain the first field in + // the struct. See https://golang.org/pkg/sync/atomic/#pkg-note-BUG. + count uint64 metrics *metrics.Metrics - // count of the number of open streaming RPCs on a server. It is accessed - // atomically. - count uint64 } // GRPCCountingStreamInterceptor is a grpc.ServerStreamInterceptor that emits a diff --git a/build-support/functions/10-util.sh b/build-support/functions/10-util.sh index 59e714d536..9198e3bf14 100644 --- a/build-support/functions/10-util.sh +++ b/build-support/functions/10-util.sh @@ -555,7 +555,7 @@ function git_push_ref { local upstream=$(git_upstream "${sdir}") || return 1 # upstream branch for this branch does not track the remote we need to push to - # basically this checks that the upstream (could be something like origin/master) references the correct remote + # basically this checks that the upstream (could be something like origin/main) references the correct remote # if it doesn't then the string modification wont apply and the var will reamin unchanged and equal to itself. if test "${upstream#${remote}/}" == "${upstream}" then diff --git a/command/connect/envoy/bootstrap_config.go b/command/connect/envoy/bootstrap_config.go index 12a623b22b..b78f816677 100644 --- a/command/connect/envoy/bootstrap_config.go +++ b/command/connect/envoy/bootstrap_config.go @@ -86,7 +86,7 @@ type BootstrapConfig struct { // configure the aspects that Connect relies upon to work. It's recommended // that this only be used if necessary, and that it be based on the default // template in - // https://github.com/hashicorp/consul/blob/master/command/connect/envoy/bootstrap_tpl.go + // https://github.com/hashicorp/consul/blob/main/command/connect/envoy/bootstrap_tpl.go // for the correct version of Consul and Envoy being used. OverrideJSONTpl string `mapstructure:"envoy_bootstrap_json_tpl"` diff --git a/command/connect/redirecttraffic/redirect_traffic_test.go b/command/connect/redirecttraffic/redirect_traffic_test.go index 0fde8a37ec..5c31af036c 100644 --- a/command/connect/redirecttraffic/redirect_traffic_test.go +++ b/command/connect/redirecttraffic/redirect_traffic_test.go @@ -59,6 +59,10 @@ func TestRun_FlagValidation(t *testing.T) { } func TestGenerateConfigFromFlags(t *testing.T) { + if testing.Short() { + t.Skip("too slow for testing.Short") + } + cases := []struct { name string command func() cmd diff --git a/contributing/INTERNALS.md b/contributing/INTERNALS.md index 38fd01aaf2..6d62913450 100644 --- a/contributing/INTERNALS.md +++ b/contributing/INTERNALS.md @@ -22,13 +22,13 @@ The components in this section are shared between Consul agents in client and se | Directory | Contents | | --------- | -------- | -| [command/agent](https://github.com/hashicorp/consul/tree/master/command/agent) | This contains the actual CLI command implementation for the `consul agent` command, which mostly just invokes an agent object from the `agent` package. | -| [agent](https://github.com/hashicorp/consul/tree/master/agent) | This is where the agent object is defined, and the top level `agent` package has all of the functionality that's common to both client and server agents. This includes things like service registration, the HTTP and DNS endpoints, watches, and top-level glue for health checks. | -| [agent/config](https://github.com/hashicorp/consul/tree/master/agent/config) | This has all the user-facing [configuration](https://www.consul.io/docs/agent/options.html) processing code, as well as the internal configuration structure that's used by the agent. | -| [agent/checks](https://github.com/hashicorp/consul/tree/master/agent/checks) | This has implementations for the different [health check types](https://www.consul.io/docs/agent/checks.html). | -| [agent/ae](https://github.com/hashicorp/consul/tree/master/agent/ae), [agent/local](https://github.com/hashicorp/consul/tree/master/agent/local) | These are used together to power the agent's [Anti-Entropy Sync Back](https://www.consul.io/docs/internals/anti-entropy.html) process to the Consul servers. | -| [agent/router](https://github.com/hashicorp/consul/tree/master/agent/router), [agent/pool](https://github.com/hashicorp/consul/tree/master/agent/pool) | These are used for routing RPC queries to Consul servers and for connection pooling. | -| [agent/structs](https://github.com/hashicorp/consul/tree/master/agent/structs) | This has definitions of all the internal RPC protocol request and response structures. | +| [command/agent](https://github.com/hashicorp/consul/tree/main/command/agent) | This contains the actual CLI command implementation for the `consul agent` command, which mostly just invokes an agent object from the `agent` package. | +| [agent](https://github.com/hashicorp/consul/tree/main/agent) | This is where the agent object is defined, and the top level `agent` package has all of the functionality that's common to both client and server agents. This includes things like service registration, the HTTP and DNS endpoints, watches, and top-level glue for health checks. | +| [agent/config](https://github.com/hashicorp/consul/tree/main/agent/config) | This has all the user-facing [configuration](https://www.consul.io/docs/agent/options.html) processing code, as well as the internal configuration structure that's used by the agent. | +| [agent/checks](https://github.com/hashicorp/consul/tree/main/agent/checks) | This has implementations for the different [health check types](https://www.consul.io/docs/agent/checks.html). | +| [agent/ae](https://github.com/hashicorp/consul/tree/main/agent/ae), [agent/local](https://github.com/hashicorp/consul/tree/main/agent/local) | These are used together to power the agent's [Anti-Entropy Sync Back](https://www.consul.io/docs/internals/anti-entropy.html) process to the Consul servers. | +| [agent/router](https://github.com/hashicorp/consul/tree/main/agent/router), [agent/pool](https://github.com/hashicorp/consul/tree/main/agent/pool) | These are used for routing RPC queries to Consul servers and for connection pooling. | +| [agent/structs](https://github.com/hashicorp/consul/tree/main/agent/structs) | This has definitions of all the internal RPC protocol request and response structures. | ### Server Components @@ -36,9 +36,9 @@ The components in this section are only used by Consul servers. | Directory | Contents | | --------- | -------- | -| [agent/consul](https://github.com/hashicorp/consul/tree/master/agent/consul) | This is where the Consul server object is defined, and the top-level `consul` package has all of the functionality that's used by server agents. This includes things like the internal RPC endpoints. | -| [agent/consul/fsm](https://github.com/hashicorp/consul/tree/master/agent/consul/fsm), [agent/consul/state](https://github.com/hashicorp/consul/tree/master/agent/consul/state) | These components make up Consul's finite state machine (updated by the Raft consensus algorithm) and backed by the state store (based on immutable radix trees). All updates of Consul's consistent state is handled by the finite state machine, and all read queries to the Consul servers are serviced by the state store's data structures. | -| [agent/consul/autopilot](https://github.com/hashicorp/consul/tree/master/agent/consul/autopilot) | This contains a package of functions that provide Consul's [Autopilot](https://www.consul.io/docs/guides/autopilot.html) features. | +| [agent/consul](https://github.com/hashicorp/consul/tree/main/agent/consul) | This is where the Consul server object is defined, and the top-level `consul` package has all of the functionality that's used by server agents. This includes things like the internal RPC endpoints. | +| [agent/consul/fsm](https://github.com/hashicorp/consul/tree/main/agent/consul/fsm), [agent/consul/state](https://github.com/hashicorp/consul/tree/main/agent/consul/state) | These components make up Consul's finite state machine (updated by the Raft consensus algorithm) and backed by the state store (based on immutable radix trees). All updates of Consul's consistent state is handled by the finite state machine, and all read queries to the Consul servers are serviced by the state store's data structures. | +| [agent/consul/autopilot](https://github.com/hashicorp/consul/tree/main/agent/consul/autopilot) | This contains a package of functions that provide Consul's [Autopilot](https://www.consul.io/docs/guides/autopilot.html) features. | ### Other Components @@ -46,12 +46,12 @@ There are several other top-level packages used internally by Consul as well as | Directory | Contents | | --------- | -------- | -| [acl](https://github.com/hashicorp/consul/tree/master/api) | This supports the underlying policy engine for Consul's [ACL](https://www.consul.io/docs/guides/acl.html) system. | -| [api](https://github.com/hashicorp/consul/tree/master/api) | This `api` package provides an official Go API client for Consul, which is also used by Consul's [CLI](https://www.consul.io/docs/commands/index.html) commands to communicate with the local Consul agent. | -| [command](https://github.com/hashicorp/consul/tree/master/command) | This contains a sub-package for each of Consul's [CLI](https://www.consul.io/docs/commands/index.html) command implementations. | -| [snapshot](https://github.com/hashicorp/consul/tree/master/snapshot) | This has implementation details for Consul's [snapshot archives](https://www.consul.io/api/snapshot.html). | -| [api/watch](https://github.com/hashicorp/consul/tree/master/api/watch) | This has implementation details for Consul's [watches](https://www.consul.io/docs/agent/watches.html), used both internally to Consul and by the [watch CLI command](https://www.consul.io/docs/commands/watch.html). | -| [website](https://github.com/hashicorp/consul/tree/master/website) | This has the full source code for [consul.io](https://www.consul.io/). Pull requests can update the source code and Consul's documentation all together. | +| [acl](https://github.com/hashicorp/consul/tree/main/api) | This supports the underlying policy engine for Consul's [ACL](https://www.consul.io/docs/guides/acl.html) system. | +| [api](https://github.com/hashicorp/consul/tree/main/api) | This `api` package provides an official Go API client for Consul, which is also used by Consul's [CLI](https://www.consul.io/docs/commands/index.html) commands to communicate with the local Consul agent. | +| [command](https://github.com/hashicorp/consul/tree/main/command) | This contains a sub-package for each of Consul's [CLI](https://www.consul.io/docs/commands/index.html) command implementations. | +| [snapshot](https://github.com/hashicorp/consul/tree/main/snapshot) | This has implementation details for Consul's [snapshot archives](https://www.consul.io/api/snapshot.html). | +| [api/watch](https://github.com/hashicorp/consul/tree/main/api/watch) | This has implementation details for Consul's [watches](https://www.consul.io/docs/agent/watches.html), used both internally to Consul and by the [watch CLI command](https://www.consul.io/docs/commands/watch.html). | +| [website](https://github.com/hashicorp/consul/tree/main/website) | This has the full source code for [consul.io](https://www.consul.io/). Pull requests can update the source code and Consul's documentation all together. | ## FAQ diff --git a/contributing/streaming/README.md b/contributing/streaming/README.md index ef56bcc0ae..121b72851c 100644 --- a/contributing/streaming/README.md +++ b/contributing/streaming/README.md @@ -31,12 +31,12 @@ endpoint calls raft.Apply, which if successful will save the new data in the sta When the [state.Store commits] it produces an event which is managed by the [EventPublisher] and sent to any active subscriptions. -[rpcclient/health.Health]: https://github.com/hashicorp/consul/blob/master/agent/rpcclient/health/health.go -[StreamingHealthServices cache-type]: https://github.com/hashicorp/consul/blob/master/agent/cache-types/streaming_health_services.go -[materialized view]: https://github.com/hashicorp/consul/blob/master/agent/submatview/materializer.go -[SubscribeEndpoint]: https://github.com/hashicorp/consul/blob/master/agent/rpc/subscribe/subscribe.go -[EventPublisher]: https://github.com/hashicorp/consul/blob/master/agent/consul/stream/event_publisher.go -[state.Store commits]: https://github.com/hashicorp/consul/blob/master/agent/consul/state/memdb.go +[rpcclient/health.Health]: https://github.com/hashicorp/consul/blob/main/agent/rpcclient/health/health.go +[StreamingHealthServices cache-type]: https://github.com/hashicorp/consul/blob/main/agent/cache-types/streaming_health_services.go +[materialized view]: https://github.com/hashicorp/consul/blob/main/agent/submatview/materializer.go +[SubscribeEndpoint]: https://github.com/hashicorp/consul/blob/main/agent/rpc/subscribe/subscribe.go +[EventPublisher]: https://github.com/hashicorp/consul/blob/main/agent/consul/stream/event_publisher.go +[state.Store commits]: https://github.com/hashicorp/consul/blob/main/agent/consul/state/memdb.go ## Event Publisher diff --git a/website/content/api-docs/libraries-and-sdks.mdx b/website/content/api-docs/libraries-and-sdks.mdx index f8acc002b7..412cc8d3f4 100644 --- a/website/content/api-docs/libraries-and-sdks.mdx +++ b/website/content/api-docs/libraries-and-sdks.mdx @@ -15,7 +15,7 @@ the community.