open-consul/agent/structs
R.B. Boyer 0a80e82f21
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 13:41:54 -05:00
..
acl.go ACL Node Identities (#7970) 2020-06-16 12:54:27 -04:00
acl_cache.go
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 12:54:27 -04:00
acl_legacy_test.go Enable gofmt simplify 2020-06-16 13:21:11 -04:00
acl_oss.go ACL Node Identities (#7970) 2020-06-16 12:54:27 -04:00
acl_test.go Enable gofmt simplify 2020-06-16 13:21:11 -04:00
auto_encrypt.go
catalog.go
check_definition.go Fix GRPCUseTLS flag HTTP API mapping 2020-09-29 18:29:56 +03:00
check_definition_test.go Replace goe/verify.Values with testify/require.Equal (#7993) 2020-06-02 12:41:25 -04:00
check_type.go Fix GRPCUseTLS flag HTTP API mapping 2020-09-29 18:29:56 +03:00
config_entry.go server: config entry replication now correctly uses namespaces in comparisons (#9024) 2020-10-23 13:41:54 -05:00
config_entry_discoverychain.go connect: support defining intentions using layer 7 criteria (#8839) 2020-10-06 17:09:13 -05: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 Add session flag to cookie config 2020-09-11 18:34:03 -06:00
config_entry_gateways.go connect: all config entries pick up a meta field (#8596) 2020-09-02 14:10:25 -05:00
config_entry_gateways_test.go Add http2 and grpc support to ingress gateways (#8458) 2020-08-27 15:34:08 -06:00
config_entry_intentions.go connect: support defining intentions using layer 7 criteria (#8839) 2020-10-06 17:09:13 -05:00
config_entry_intentions_test.go connect: support defining intentions using layer 7 criteria (#8839) 2020-10-06 17:09:13 -05:00
config_entry_oss.go Split up unused key validation for oss/ent (#8189) 2020-06-25 13:58:29 -06:00
config_entry_oss_test.go Split up unused key validation for oss/ent (#8189) 2020-06-25 13:58:29 -06:00
config_entry_test.go connect: support defining intentions using layer 7 criteria (#8839) 2020-10-06 17:09:13 -05:00
connect.go
connect_ca.go Move IntermediateCertTTL to common CA config 2020-09-10 00:23:22 -07:00
connect_ca_test.go Move IntermediateCertTTL to common CA config 2020-09-10 00:23:22 -07:00
connect_oss.go
connect_proxy_config.go server: config entry replication now correctly uses namespaces in comparisons (#9024) 2020-10-23 13:41:54 -05: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 agent: make the json/hcl decoding of ConnectProxyConfig fully work with CamelCase and snake_case (#8741) 2020-09-24 13:58:52 -05:00
discovery_chain.go Update resolver defaulting 2020-09-03 13:08:44 -06:00
discovery_chain_oss.go Updates to Config Entries and Connect for Namespaces (#7116) 2020-01-24 10:04:58 -05:00
errors.go DNS: add IsErrQueryNotFound function for easier error evaluation 2020-07-01 03:41:44 +01:00
federation_state.go wan federation via mesh gateways (#6884) 2020-03-09 15:59:02 -05:00
intention.go Add HasExact to topology endpoint (#9010) 2020-10-23 10:45:41 -06:00
intention_oss.go connect: intentions are now managed as a new config entry kind "service-intentions" (#8834) 2020-10-06 13:24:05 -05:00
intention_test.go connect: support defining intentions using layer 7 criteria (#8839) 2020-10-06 17:09:13 -05:00
operator.go
prepared_query.go Catalog + Namespace OSS changes. (#7219) 2020-02-10 10:40:44 -05:00
prepared_query_test.go
protobuf_compat.go Refactor the agentpb package (#8362) 2020-07-23 11:24:20 -04:00
sanitize_oss.go
service_definition.go OSS Changes for various config entry namespacing bugs (#7226) 2020-02-06 10:52:25 -05:00
service_definition_test.go Replace goe/verify.Values with testify/require.Equal (#7993) 2020-06-02 12:41:25 -04:00
snapshot.go
structs.go Enhance the output of consul snapshot inspect (#8787) 2020-10-09 14:57:29 -05:00
structs_filtering_test.go Enable gofmt simplify 2020-06-16 13:21:11 -04:00
structs_oss.go Enhance the output of consul snapshot inspect (#8787) 2020-10-09 14:57:29 -05:00
structs_test.go structs: add CheckServiceNode.CanRead 2020-10-07 18:15:13 -04:00
system_metadata.go connect: intentions are now managed as a new config entry kind "service-intentions" (#8834) 2020-10-06 13:24:05 -05: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
testing_intention.go Updates to Config Entries and Connect for Namespaces (#7116) 2020-01-24 10:04:58 -05:00
testing_service_definition.go
txn.go connect: intentions are now managed as a new config entry kind "service-intentions" (#8834) 2020-10-06 13:24:05 -05:00