consul/agent/structs
R.B. Boyer a155423f29 server: config entry replication now correctly uses namespaces in comparisons (#9024)
Previously config entries sharing a kind & name but in different
namespaces could occasionally cause "stuck states" in replication
because the namespace fields were ignored during the differential
comparison phase.

Example:

Two config entries written to the primary:

    kind=A,name=web,namespace=bar
    kind=A,name=web,namespace=foo

Under the covers these both get saved to memdb, so they are sorted by
all 3 components (kind,name,namespace) during natural iteration. This
means that before the replication code does it's own incomplete sort,
the underlying data IS sorted by namespace ascending (bar comes before
foo).

After one pass of replication the primary and secondary datacenters have
the same set of config entries present. If
"kind=A,name=web,namespace=bar" were to be deleted, then things get
weird. Before replication the two sides look like:

primary: [
    kind=A,name=web,namespace=foo
]
secondary: [
    kind=A,name=web,namespace=bar
    kind=A,name=web,namespace=foo
]

The differential comparison phase walks these two lists in sorted order
and first compares "kind=A,name=web,namespace=foo" vs
"kind=A,name=web,namespace=bar" and falsely determines they are the SAME
and are thus cause an update of "kind=A,name=web,namespace=foo". Then it
compares "<nothing>" with "kind=A,name=web,namespace=foo" and falsely
determines that the latter should be DELETED.

During reconciliation the deletes are processed before updates, and so
for a brief moment in the secondary "kind=A,name=web,namespace=foo" is
erroneously deleted and then immediately restored.

Unfortunately after this replication phase the final state is identical
to the initial state, so when it loops around again (rate limited) it
repeats the same set of operations indefinitely.
2020-10-23 18:42:45 +00:00
..
acl.go ACL Node Identities (#7970) 2020-06-16 16:55:01 +00:00
acl_cache.go acl: adding support for kubernetes auth provider login (#5600) 2019-04-26 14:49:25 -05:00
acl_cache_test.go test: Remove t.Parallel() from agent/structs tests 2020-05-08 14:06:10 -04:00
acl_legacy.go ACL Node Identities (#7970) 2020-06-16 16:55:01 +00:00
acl_legacy_test.go Tokens converted from legacy ACLs get their Hash computed (#8047) (#8054) 2020-06-08 23:36:55 +02:00
acl_oss.go ACL Node Identities (#7970) 2020-06-16 16:55:01 +00:00
acl_test.go test: Remove t.Parallel() from agent/structs tests 2020-05-08 14:06:10 -04:00
auto_encrypt.go tls: auto_encrypt enables automatic RPC cert provisioning for consul clients (#5597) 2019-06-27 22:22:07 +02:00
catalog.go Sync of OSS changes to support namespaces (#6909) 2019-12-09 21:26:41 -05:00
check_definition.go feat: support sending body in HTTP checks (#6602) 2020-02-10 09:27:12 -07:00
check_definition_test.go test: Remove t.Parallel() from agent/structs tests 2020-05-08 14:06:10 -04:00
check_type.go feat: support sending body in HTTP checks (#6602) 2020-02-10 09:27:12 -07:00
config_entry.go server: config entry replication now correctly uses namespaces in comparisons (#9024) 2020-10-23 18:42:45 +00:00
config_entry_discoverychain.go connect: all config entries pick up a meta field (#8596) 2020-09-02 19:22:37 +00:00
config_entry_discoverychain_oss.go Updates to Config Entries and Connect for Namespaces (#7116) 2020-01-24 10:04:58 -05:00
config_entry_discoverychain_test.go test: Remove t.Parallel() from agent/structs tests 2020-05-08 14:06:10 -04:00
config_entry_gateways.go connect: all config entries pick up a meta field (#8596) 2020-09-02 19:22:37 +00:00
config_entry_gateways_test.go Add http2 and grpc support to ingress gateways (#8458) 2020-08-27 15:41:39 -06:00
config_entry_oss.go Split up unused key validation for oss/ent (#8189) 2020-06-26 12:02:56 +02:00
config_entry_oss_test.go Split up unused key validation for oss/ent (#8189) 2020-06-26 12:02:56 +02:00
config_entry_test.go connect: all config entries pick up a meta field (#8596) 2020-09-02 19:22:37 +00:00
connect.go Intentions ACL enforcement updates (#7028) 2020-01-13 15:51:40 -05:00
connect_ca.go Merge pull request #8646 from hashicorp/common-intermediate-ttl 2020-09-15 19:04:27 +00:00
connect_ca_test.go Merge pull request #8646 from hashicorp/common-intermediate-ttl 2020-09-15 19:04:27 +00:00
connect_oss.go Intentions ACL enforcement updates (#7028) 2020-01-13 15:51:40 -05:00
connect_proxy_config.go server: config entry replication now correctly uses namespaces in comparisons (#9024) 2020-10-23 18:42:45 +00:00
connect_proxy_config_oss.go Updates to Config Entries and Connect for Namespaces (#7116) 2020-01-24 10:04:58 -05:00
connect_proxy_config_test.go Make sure IngressHosts isn't parsed during JSON decode 2020-05-06 15:06:14 -05:00
discovery_chain.go OSS Changes for various config entry namespacing bugs (#7226) 2020-02-06 10:52:25 -05:00
discovery_chain_oss.go Updates to Config Entries and Connect for Namespaces (#7116) 2020-01-24 10:04:58 -05:00
errors.go Merge pull request #8218 from yurkeen/fix-dns-rcode 2020-07-01 13:13:55 +00:00
federation_state.go wan federation via mesh gateways (#6884) 2020-03-09 15:59:02 -05:00
intention.go Replace whitelist/blacklist terminology with allowlist/denylist (#7971) 2020-06-01 10:40:14 -05:00
intention_oss.go Intentions ACL enforcement updates (#7028) 2020-01-13 15:51:40 -05:00
intention_test.go test: Remove t.Parallel() from agent/structs tests 2020-05-08 14:06:10 -04:00
operator.go Move autopilot to a standalone package 2017-12-11 16:45:33 -08:00
prepared_query.go Catalog + Namespace OSS changes. (#7219) 2020-02-10 10:40:44 -05:00
prepared_query_test.go agent: move agent/consul/structs to agent/structs 2017-08-09 14:32:12 +02:00
protobuf_compat.go Backport: #8362 (#8366) 2020-07-23 12:44:27 -04:00
sanitize_oss.go Update to use a consulent build tag instead of just ent (#5759) 2019-05-01 11:11:27 -04:00
service_definition.go OSS Changes for various config entry namespacing bugs (#7226) 2020-02-06 10:52:25 -05:00
service_definition_test.go test: Remove t.Parallel() from agent/structs tests 2020-05-08 14:06:10 -04:00
snapshot.go agent: move agent/consul/structs to agent/structs 2017-08-09 14:32:12 +02:00
structs.go Merge pull request #8537 from hashicorp/dnephin/fix-panic-on-connect-nil 2020-08-20 22:01:30 +00:00
structs_filtering_test.go test: Remove t.Parallel() from agent/structs tests 2020-05-08 14:06:10 -04:00
structs_oss.go Merge pull request #8099 from hashicorp/gateway-services-endpoint 2020-06-12 21:15:25 +00:00
structs_test.go Merge pull request #8537 from hashicorp/dnephin/fix-panic-on-connect-nil 2020-08-20 22:01:30 +00:00
testing.go agent: ensure that we always use the same settings for msgpack (#7245) 2020-02-07 15:50:24 -06:00
testing_catalog.go Ingress Gateways for TCP services (#7509) 2020-04-16 14:00:48 -07:00
testing_connect_proxy_config.go Add -sidecar-for and new /agent/service/:service_id endpoint (#4691) 2018-10-10 16:55:34 +01:00
testing_intention.go Updates to Config Entries and Connect for Namespaces (#7116) 2020-01-24 10:04:58 -05:00
testing_service_definition.go Add Proxy Upstreams to Service Definition (#4639) 2018-10-10 16:55:34 +01:00
txn.go OSS KV Modifications to Support Namespaces 2019-11-25 12:57:35 -05:00