From 55945ea6e3990923b756b49db72ee16c469d5eea Mon Sep 17 00:00:00 2001 From: chaoqin-li1123 Date: Wed, 26 May 2021 02:59:06 +0000 Subject: [PATCH 1/4] add pgv Signed-off-by: chaoqin-li1123 --- api/envoy/config/cluster/v3/cluster.proto | 2 +- api/envoy/config/cluster/v4alpha/cluster.proto | 2 +- generated_api_shadow/envoy/config/cluster/v3/cluster.proto | 2 +- generated_api_shadow/envoy/config/cluster/v4alpha/cluster.proto | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/envoy/config/cluster/v3/cluster.proto b/api/envoy/config/cluster/v3/cluster.proto index 957c2b3341e3..651a277827e4 100644 --- a/api/envoy/config/cluster/v3/cluster.proto +++ b/api/envoy/config/cluster/v3/cluster.proto @@ -413,7 +413,7 @@ message Cluster { // Minimal disruption means that when the set of upstreams changes, a connection will likely be sent to the same // upstream as it was before. Increasing the table size reduces the amount of disruption. // The table size must be prime number. If it is not specified, the default is 65537. - google.protobuf.UInt64Value table_size = 1; + google.protobuf.UInt64Value table_size = 1 [(validate.rules).uint64 = {lte: 8388608}]; } // Specific configuration for the diff --git a/api/envoy/config/cluster/v4alpha/cluster.proto b/api/envoy/config/cluster/v4alpha/cluster.proto index 8adf5ea460e4..5e092bca1f70 100644 --- a/api/envoy/config/cluster/v4alpha/cluster.proto +++ b/api/envoy/config/cluster/v4alpha/cluster.proto @@ -416,7 +416,7 @@ message Cluster { // Minimal disruption means that when the set of upstreams changes, a connection will likely be sent to the same // upstream as it was before. Increasing the table size reduces the amount of disruption. // The table size must be prime number. If it is not specified, the default is 65537. - google.protobuf.UInt64Value table_size = 1; + google.protobuf.UInt64Value table_size = 1 [(validate.rules).uint64 = {lte: 8388608}]; } // Specific configuration for the diff --git a/generated_api_shadow/envoy/config/cluster/v3/cluster.proto b/generated_api_shadow/envoy/config/cluster/v3/cluster.proto index d9e64b44ce88..8c87d61b8d02 100644 --- a/generated_api_shadow/envoy/config/cluster/v3/cluster.proto +++ b/generated_api_shadow/envoy/config/cluster/v3/cluster.proto @@ -416,7 +416,7 @@ message Cluster { // Minimal disruption means that when the set of upstreams changes, a connection will likely be sent to the same // upstream as it was before. Increasing the table size reduces the amount of disruption. // The table size must be prime number. If it is not specified, the default is 65537. - google.protobuf.UInt64Value table_size = 1; + google.protobuf.UInt64Value table_size = 1 [(validate.rules).uint64 = {lte: 8388608}]; } // Specific configuration for the diff --git a/generated_api_shadow/envoy/config/cluster/v4alpha/cluster.proto b/generated_api_shadow/envoy/config/cluster/v4alpha/cluster.proto index d637591a2251..89b335fb9d7a 100644 --- a/generated_api_shadow/envoy/config/cluster/v4alpha/cluster.proto +++ b/generated_api_shadow/envoy/config/cluster/v4alpha/cluster.proto @@ -418,7 +418,7 @@ message Cluster { // Minimal disruption means that when the set of upstreams changes, a connection will likely be sent to the same // upstream as it was before. Increasing the table size reduces the amount of disruption. // The table size must be prime number. If it is not specified, the default is 65537. - google.protobuf.UInt64Value table_size = 1; + google.protobuf.UInt64Value table_size = 1 [(validate.rules).uint64 = {lte: 8388608}]; } // Specific configuration for the From 1c6e35345300aef6024ac5917e2bfcb119083f20 Mon Sep 17 00:00:00 2001 From: chaoqin-li1123 Date: Wed, 26 May 2021 05:12:10 +0000 Subject: [PATCH 2/4] add limit to maglev table size Signed-off-by: chaoqin-li1123 --- api/envoy/config/cluster/v3/cluster.proto | 4 +- .../config/cluster/v4alpha/cluster.proto | 4 +- .../envoy/config/cluster/v3/cluster.proto | 4 +- .../config/cluster/v4alpha/cluster.proto | 4 +- test/server/server_corpus/big_maglev_table | 106 ++++++++++++++++++ 5 files changed, 114 insertions(+), 8 deletions(-) create mode 100644 test/server/server_corpus/big_maglev_table diff --git a/api/envoy/config/cluster/v3/cluster.proto b/api/envoy/config/cluster/v3/cluster.proto index 651a277827e4..2752f8ec0082 100644 --- a/api/envoy/config/cluster/v3/cluster.proto +++ b/api/envoy/config/cluster/v3/cluster.proto @@ -412,8 +412,8 @@ message Cluster { // The table size for Maglev hashing. The Maglev aims for ‘minimal disruption’ rather than an absolute guarantee. // Minimal disruption means that when the set of upstreams changes, a connection will likely be sent to the same // upstream as it was before. Increasing the table size reduces the amount of disruption. - // The table size must be prime number. If it is not specified, the default is 65537. - google.protobuf.UInt64Value table_size = 1 [(validate.rules).uint64 = {lte: 8388608}]; + // The table size must be prime number limited to 4M. If it is not specified, the default is 65537. + google.protobuf.UInt64Value table_size = 1 [(validate.rules).uint64 = {lte: 5000011}]; } // Specific configuration for the diff --git a/api/envoy/config/cluster/v4alpha/cluster.proto b/api/envoy/config/cluster/v4alpha/cluster.proto index 5e092bca1f70..81970e68fd09 100644 --- a/api/envoy/config/cluster/v4alpha/cluster.proto +++ b/api/envoy/config/cluster/v4alpha/cluster.proto @@ -415,8 +415,8 @@ message Cluster { // The table size for Maglev hashing. The Maglev aims for ‘minimal disruption’ rather than an absolute guarantee. // Minimal disruption means that when the set of upstreams changes, a connection will likely be sent to the same // upstream as it was before. Increasing the table size reduces the amount of disruption. - // The table size must be prime number. If it is not specified, the default is 65537. - google.protobuf.UInt64Value table_size = 1 [(validate.rules).uint64 = {lte: 8388608}]; + // The table size must be prime number limited to 4M. If it is not specified, the default is 65537. + google.protobuf.UInt64Value table_size = 1 [(validate.rules).uint64 = {lte: 5000011}]; } // Specific configuration for the diff --git a/generated_api_shadow/envoy/config/cluster/v3/cluster.proto b/generated_api_shadow/envoy/config/cluster/v3/cluster.proto index 8c87d61b8d02..d64fce42fc50 100644 --- a/generated_api_shadow/envoy/config/cluster/v3/cluster.proto +++ b/generated_api_shadow/envoy/config/cluster/v3/cluster.proto @@ -415,8 +415,8 @@ message Cluster { // The table size for Maglev hashing. The Maglev aims for ‘minimal disruption’ rather than an absolute guarantee. // Minimal disruption means that when the set of upstreams changes, a connection will likely be sent to the same // upstream as it was before. Increasing the table size reduces the amount of disruption. - // The table size must be prime number. If it is not specified, the default is 65537. - google.protobuf.UInt64Value table_size = 1 [(validate.rules).uint64 = {lte: 8388608}]; + // The table size must be prime number limited to 4M. If it is not specified, the default is 65537. + google.protobuf.UInt64Value table_size = 1 [(validate.rules).uint64 = {lte: 5000011}]; } // Specific configuration for the diff --git a/generated_api_shadow/envoy/config/cluster/v4alpha/cluster.proto b/generated_api_shadow/envoy/config/cluster/v4alpha/cluster.proto index 89b335fb9d7a..4286fabd7a18 100644 --- a/generated_api_shadow/envoy/config/cluster/v4alpha/cluster.proto +++ b/generated_api_shadow/envoy/config/cluster/v4alpha/cluster.proto @@ -417,8 +417,8 @@ message Cluster { // The table size for Maglev hashing. The Maglev aims for ‘minimal disruption’ rather than an absolute guarantee. // Minimal disruption means that when the set of upstreams changes, a connection will likely be sent to the same // upstream as it was before. Increasing the table size reduces the amount of disruption. - // The table size must be prime number. If it is not specified, the default is 65537. - google.protobuf.UInt64Value table_size = 1 [(validate.rules).uint64 = {lte: 8388608}]; + // The table size must be prime number limited to 4M. If it is not specified, the default is 65537. + google.protobuf.UInt64Value table_size = 1 [(validate.rules).uint64 = {lte: 5000011}]; } // Specific configuration for the diff --git a/test/server/server_corpus/big_maglev_table b/test/server/server_corpus/big_maglev_table new file mode 100644 index 000000000000..1852b6164886 --- /dev/null +++ b/test/server/server_corpus/big_maglev_table @@ -0,0 +1,106 @@ +static_resources { + clusters { + name: "ser" + type: STATIC + connect_timeout { + nanos: 813 + } + lb_policy: MAGLEV + circuit_breakers { + } + http_protocol_options { + default_host_for_http_10: "\005" + } + dns_lookup_family: V6_ONLY + metadata { + filter_metadata { + key: "\177" + value { + } + } + } + alt_stat_name: "search" + load_assignment { + cluster_name: "." + endpoints { + locality { + sub_zone: "\002\000\000\000\000\000\000\000" + } + priority: 50 + } + endpoints { + lb_endpoints { + endpoint { + address { + envoy_internal_address { + } + } + } + health_status: DRAINING + } + } + endpoints { + lb_endpoints { + endpoint { + address { + envoy_internal_address { + } + } + } + health_status: DRAINING + } + lb_endpoints { + endpoint { + address { + pipe { + path: ")" + } + } + } + health_status: DRAINING + } + load_balancing_weight { + value: 262144 + } + priority: 16 + } + endpoints { + } + endpoints { + locality { + sub_zone: "\002\000\000\000\000\000\000\000" + } + priority: 16 + } + } + upstream_http_protocol_options { + auto_sni: true + auto_san_validation: true + } + maglev_lb_config { + table_size { + value: 18374967954648334337 + } + } + } +} +watchdog { + megamiss_timeout { + nanos: 95 + } + multikill_timeout { + nanos: 620756992 + } + max_kill_timeout_jitter { + nanos: 262239 + } +} +stats_config { +} +hds_config { + refresh_delay { + seconds: -648518346341351424 + } +} +stats_server_version_override { +} \ No newline at end of file From 1970896db05c228ddabda9e810ed8e5e89ff37a4 Mon Sep 17 00:00:00 2001 From: chaoqin-li1123 Date: Wed, 26 May 2021 05:14:17 +0000 Subject: [PATCH 3/4] format Signed-off-by: chaoqin-li1123 --- test/server/server_corpus/big_maglev_table | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/server/server_corpus/big_maglev_table b/test/server/server_corpus/big_maglev_table index 1852b6164886..8d8667c06b38 100644 --- a/test/server/server_corpus/big_maglev_table +++ b/test/server/server_corpus/big_maglev_table @@ -103,4 +103,4 @@ hds_config { } } stats_server_version_override { -} \ No newline at end of file +} From 86fd7c95e4228478d3f007a1fac36ab17851e6a1 Mon Sep 17 00:00:00 2001 From: chaoqin-li1123 Date: Tue, 8 Jun 2021 02:20:43 +0000 Subject: [PATCH 4/4] fix comment Signed-off-by: chaoqin-li1123 --- api/envoy/config/cluster/v3/cluster.proto | 2 +- api/envoy/config/cluster/v4alpha/cluster.proto | 2 +- generated_api_shadow/envoy/config/cluster/v3/cluster.proto | 2 +- generated_api_shadow/envoy/config/cluster/v4alpha/cluster.proto | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/envoy/config/cluster/v3/cluster.proto b/api/envoy/config/cluster/v3/cluster.proto index 2752f8ec0082..4f61e31e1726 100644 --- a/api/envoy/config/cluster/v3/cluster.proto +++ b/api/envoy/config/cluster/v3/cluster.proto @@ -412,7 +412,7 @@ message Cluster { // The table size for Maglev hashing. The Maglev aims for ‘minimal disruption’ rather than an absolute guarantee. // Minimal disruption means that when the set of upstreams changes, a connection will likely be sent to the same // upstream as it was before. Increasing the table size reduces the amount of disruption. - // The table size must be prime number limited to 4M. If it is not specified, the default is 65537. + // The table size must be prime number limited to 5000011. If it is not specified, the default is 65537. google.protobuf.UInt64Value table_size = 1 [(validate.rules).uint64 = {lte: 5000011}]; } diff --git a/api/envoy/config/cluster/v4alpha/cluster.proto b/api/envoy/config/cluster/v4alpha/cluster.proto index 81970e68fd09..305721c57fb9 100644 --- a/api/envoy/config/cluster/v4alpha/cluster.proto +++ b/api/envoy/config/cluster/v4alpha/cluster.proto @@ -415,7 +415,7 @@ message Cluster { // The table size for Maglev hashing. The Maglev aims for ‘minimal disruption’ rather than an absolute guarantee. // Minimal disruption means that when the set of upstreams changes, a connection will likely be sent to the same // upstream as it was before. Increasing the table size reduces the amount of disruption. - // The table size must be prime number limited to 4M. If it is not specified, the default is 65537. + // The table size must be prime number limited to 5000011. If it is not specified, the default is 65537. google.protobuf.UInt64Value table_size = 1 [(validate.rules).uint64 = {lte: 5000011}]; } diff --git a/generated_api_shadow/envoy/config/cluster/v3/cluster.proto b/generated_api_shadow/envoy/config/cluster/v3/cluster.proto index d64fce42fc50..b8e495a71c3a 100644 --- a/generated_api_shadow/envoy/config/cluster/v3/cluster.proto +++ b/generated_api_shadow/envoy/config/cluster/v3/cluster.proto @@ -415,7 +415,7 @@ message Cluster { // The table size for Maglev hashing. The Maglev aims for ‘minimal disruption’ rather than an absolute guarantee. // Minimal disruption means that when the set of upstreams changes, a connection will likely be sent to the same // upstream as it was before. Increasing the table size reduces the amount of disruption. - // The table size must be prime number limited to 4M. If it is not specified, the default is 65537. + // The table size must be prime number limited to 5000011. If it is not specified, the default is 65537. google.protobuf.UInt64Value table_size = 1 [(validate.rules).uint64 = {lte: 5000011}]; } diff --git a/generated_api_shadow/envoy/config/cluster/v4alpha/cluster.proto b/generated_api_shadow/envoy/config/cluster/v4alpha/cluster.proto index 4286fabd7a18..9ad38d164870 100644 --- a/generated_api_shadow/envoy/config/cluster/v4alpha/cluster.proto +++ b/generated_api_shadow/envoy/config/cluster/v4alpha/cluster.proto @@ -417,7 +417,7 @@ message Cluster { // The table size for Maglev hashing. The Maglev aims for ‘minimal disruption’ rather than an absolute guarantee. // Minimal disruption means that when the set of upstreams changes, a connection will likely be sent to the same // upstream as it was before. Increasing the table size reduces the amount of disruption. - // The table size must be prime number limited to 4M. If it is not specified, the default is 65537. + // The table size must be prime number limited to 5000011. If it is not specified, the default is 65537. google.protobuf.UInt64Value table_size = 1 [(validate.rules).uint64 = {lte: 5000011}]; }