-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Add redis cluster #6446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add redis cluster #6446
Changes from 57 commits
Commits
Show all changes
65 commits
Select commit
Hold shift + click to select a range
6dcb8de
Add cluster factory interface and implementation for the existing clu…
HenryYYang 1ac5471
Add configurable factory
HenryYYang b4253c2
Fix format issues
HenryYYang 3e056bb
make cluster type oneof
HenryYYang f5420ee
Fix format error.
HenryYYang d3a9004
Add integration tests
HenryYYang 759e505
Updated comments and docs.
HenryYYang 789316a
Merge branch 'master' into add-cluster-extension
HenryYYang e7b1625
Merge remote-tracking branch 'origin' into add-cluster-extension
HenryYYang ef1f54a
remove TestBase from new tests
HenryYYang cb3e0eb
Merge branch 'add-cluster-extension' of github.com:HenryYYang/envoy i…
HenryYYang 35b2c86
fix formatting
HenryYYang b3c41e2
fix formatting
HenryYYang a5e19da
fix formatting
HenryYYang 5311662
fix clang tidy
HenryYYang 6634824
fix typo
HenryYYang 587b1d0
fix clang-tidy
HenryYYang ff123bf
Merge branch 'master' of github.com:envoyproxy/envoy into add-cluster…
HenryYYang d16d0b9
delete deprecated api
HenryYYang b82e014
Fix PR feedbacks
HenryYYang 0cf38a8
Fix PR feedbacks
HenryYYang 506f51b
Merge branch 'master' into add-cluster-extension
HenryYYang f75d362
Remove TestBase
HenryYYang d51e41a
Fix PR feedbacks
HenryYYang 6ccc257
Fix missing import
HenryYYang 0cb3806
Fix duplicate registration
HenryYYang 1716d48
Split implementation and registration of custom static cluster out of…
HenryYYang 735524d
fix format
HenryYYang b06aca8
remove CUSTOM_CLUSTER_CONFIG
HenryYYang 0a53ccb
Kick CI
HenryYYang 661875e
Merge branch 'master' into add-redis-cluster
HenryYYang 72acffa
Add redis cluster
HenryYYang fe83017
Add redis cluster test
HenryYYang b25de9f
Support ipv6
HenryYYang e95f67e
add version history
HenryYYang f51b36a
Merge branch 'master' into add-redis-cluster
HenryYYang c186184
Kick CI
HenryYYang a30136b
Merge branch 'master' into add-redis-cluster
FAYiEKcbD0XFqF2QK2E4viAHg8rMm2VbjYKdjTg 8027e1e
docs
FAYiEKcbD0XFqF2QK2E4viAHg8rMm2VbjYKdjTg e42cac4
Merge branch 'master' into add-redis-cluster
FAYiEKcbD0XFqF2QK2E4viAHg8rMm2VbjYKdjTg dabacd1
make docs work zomg
FAYiEKcbD0XFqF2QK2E4viAHg8rMm2VbjYKdjTg 9a8c5ff
fix compile error
FAYiEKcbD0XFqF2QK2E4viAHg8rMm2VbjYKdjTg d2c4606
mitch comments
FAYiEKcbD0XFqF2QK2E4viAHg8rMm2VbjYKdjTg 96bbf69
fix issue
FAYiEKcbD0XFqF2QK2E4viAHg8rMm2VbjYKdjTg 6738ca9
extra protection on cancels
FAYiEKcbD0XFqF2QK2E4viAHg8rMm2VbjYKdjTg 385a6a5
Revert "extra protection on cancels"
FAYiEKcbD0XFqF2QK2E4viAHg8rMm2VbjYKdjTg ae24a89
respond to mitch and matt comments
FAYiEKcbD0XFqF2QK2E4viAHg8rMm2VbjYKdjTg e20db9a
fix spelling
FAYiEKcbD0XFqF2QK2E4viAHg8rMm2VbjYKdjTg 354d635
Merge branch 'master' into add-redis-cluster
FAYiEKcbD0XFqF2QK2E4viAHg8rMm2VbjYKdjTg 6535c6e
Merge branch 'master' into add-redis-cluster
FAYiEKcbD0XFqF2QK2E4viAHg8rMm2VbjYKdjTg 1bb84fb
Update docs per matt comments, put a function in an anonymous namespace
FAYiEKcbD0XFqF2QK2E4viAHg8rMm2VbjYKdjTg d0d73bb
add test for cluster factory exception pass and fail cases
FAYiEKcbD0XFqF2QK2E4viAHg8rMm2VbjYKdjTg 098ccd2
Add integration test
HenryYYang 7a2eb43
Merge branch 'add-redis-cluster' of github.com:HenryYYang/envoy into …
HenryYYang c35d0b5
Merge branch 'master' into add-redis-cluster
HenryYYang 97f16fe
Fix merge issues
HenryYYang 169fe5d
Fix clang_tidy errors
HenryYYang 71209e2
Add more robust error checking.
HenryYYang dab3be9
Add more test for cluster slots response
HenryYYang 3f1bc38
delete twemproxy from dictionary
HenryYYang 569b693
Small refactor of the RedisCluster class
HenryYYang 152e1ab
Merge branch 'master' into add-redis-cluster
HenryYYang f746acf
Fix code review feedbacks
HenryYYang db280e3
Fix code review feedback.
HenryYYang 710c915
Fix redis cluster test
HenryYYang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| load("@envoy_api//bazel:api_build_system.bzl", "api_proto_library_internal") | ||
|
|
||
| licenses(["notice"]) # Apache 2 | ||
|
|
||
| api_proto_library_internal( | ||
| name = "redis_cluster", | ||
| srcs = ["redis_cluster.proto"], | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package envoy.config.cluster.redis; | ||
|
|
||
| option java_outer_classname = "RedisClusterProto"; | ||
| option java_multiple_files = true; | ||
| option java_package = "io.envoyproxy.envoy.config.cluster.redis"; | ||
| option go_package = "v2"; | ||
|
|
||
| import "google/protobuf/duration.proto"; | ||
|
|
||
| import "validate/validate.proto"; | ||
| import "gogoproto/gogo.proto"; | ||
|
|
||
| // [#protodoc-title: Redis Cluster Configuration] | ||
| // This cluster adds support for `Redis Cluster <https://redis.io/topics/cluster-spec>`_, as part | ||
| // of :ref:`Envoy's support for Redis Cluster <arch_overview_redis>`. | ||
| // | ||
| // Redis Cluster is an extension of Redis which supports sharding and high availability (where a | ||
| // shard that loses its master fails over to a replica, and designates it as the new master). | ||
| // However, as there is no unified frontend or proxy service in front of Redis Cluster, the client | ||
| // (in this case Envoy) must locally maintain the state of the Redis Cluster, specifically the | ||
| // topology. A random node in the cluster is queried for the topology using the `CLUSTER SLOTS | ||
| // command <https://redis.io/commands/cluster-slots>`_. This result is then stored locally, and | ||
| // updated at user-configured intervals. | ||
| // | ||
| // Example: | ||
| // | ||
| // .. code-block:: yaml | ||
| // | ||
| // name: name | ||
| // connect_timeout: 0.25s | ||
| // dns_lookup_family: V4_ONLY | ||
| // hosts: | ||
| // - socket_address: | ||
| // address: foo.bar.com | ||
| // port_value: 22120 | ||
| // cluster_type: | ||
| // name: envoy.clusters.redis | ||
| // typed_config: | ||
| // "@type": type.googleapis.com/google.protobuf.Struct | ||
| // value: | ||
| // cluster_refresh_rate: 30s | ||
| // cluster_refresh_timeout: 0.5s | ||
|
|
||
| message RedisClusterConfig { | ||
| // Interval between successive topology refresh requests. If not set, this defaults to 5s. | ||
| google.protobuf.Duration cluster_refresh_rate = 1 | ||
| [(validate.rules).duration.gt = {}, (gogoproto.stdduration) = true]; | ||
|
|
||
| // Timeout for topology refresh request. If not set, this defaults to 3s. | ||
| google.protobuf.Duration cluster_refresh_timeout = 2 | ||
| [(validate.rules).duration.gt = {}, (gogoproto.stdduration) = true]; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| Cluster | ||
| ======= | ||
|
|
||
| .. toctree:: | ||
| :glob: | ||
| :maxdepth: 1 | ||
|
|
||
| redis/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,3 +12,4 @@ Extensions | |
| transport_socket/transport_socket | ||
| resource_monitor/resource_monitor | ||
| common/common | ||
| cluster/cluster | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| licenses(["notice"]) # Apache 2 | ||
|
|
||
| load( | ||
| "//bazel:envoy_build_system.bzl", | ||
| "envoy_cc_library", | ||
| "envoy_package", | ||
| ) | ||
|
|
||
| envoy_package() | ||
|
|
||
| envoy_cc_library( | ||
| name = "redis_cluster", | ||
| srcs = [ | ||
| "redis_cluster.cc", | ||
| "redis_cluster.h", | ||
| ], | ||
| deps = [ | ||
| "//include/envoy/api:api_interface", | ||
| "//include/envoy/http:codec_interface", | ||
| "//include/envoy/upstream:cluster_factory_interface", | ||
| "//include/envoy/upstream:cluster_manager_interface", | ||
| "//include/envoy/upstream:upstream_interface", | ||
| "//source/common/config:metadata_lib", | ||
| "//source/common/event:dispatcher_lib", | ||
| "//source/common/json:config_schemas_lib", | ||
| "//source/common/json:json_loader_lib", | ||
| "//source/common/network:utility_lib", | ||
| "//source/common/singleton:manager_impl_lib", | ||
| "//source/common/upstream:cluster_factory_lib", | ||
| "//source/common/upstream:upstream_includes", | ||
| "//source/common/upstream:upstream_lib", | ||
| "//source/extensions/clusters:well_known_names", | ||
| "//source/extensions/filters/network/common/redis:client_interface", | ||
| "//source/extensions/filters/network/common/redis:client_lib", | ||
| "//source/extensions/filters/network/common/redis:codec_interface", | ||
| "//source/extensions/transport_sockets/raw_buffer:config", | ||
| "//source/server:transport_socket_config_lib", | ||
| "@envoy_api//envoy/config/cluster/redis:redis_cluster_cc", | ||
| ], | ||
| ) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.