diff --git a/api/envoy/config/cluster/v3/cluster.proto b/api/envoy/config/cluster/v3/cluster.proto index 957c2b3341e3..4f61e31e1726 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; + // 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}]; } // Specific configuration for the diff --git a/api/envoy/config/cluster/v4alpha/cluster.proto b/api/envoy/config/cluster/v4alpha/cluster.proto index 8adf5ea460e4..305721c57fb9 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; + // 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}]; } // 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..b8e495a71c3a 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; + // 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}]; } // 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..9ad38d164870 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; + // 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}]; } // 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..8d8667c06b38 --- /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 { +}