mirror of https://github.com/status-im/consul.git
ef3b81ab13
* Allow to rename nodes with IDs, will fix #3974 and #4413 This change allow to rename any well behaving recent agent with an ID to be renamed safely, ie: without taking the name of another one with case insensitive comparison. Deprecated behaviour warning ---------------------------- Due to asceding compatibility, it is still possible however to "take" the name of another name by not providing any ID. Note that when not providing any ID, it is possible to have 2 nodes having similar names with case differences, ie: myNode and mynode which might lead to DB corruption on Consul server side and lead to server not properly restarting. See #3983 and #4399 for Context about this change. Disabling registration of nodes without IDs as specified in #4414 should probably be the way to go eventually. * Removed the case-insensitive search when adding a node within the else block since it breaks the test TestAgentAntiEntropy_Services While the else case is probably legit, it will be fixed with #4414 in a later release. * Added again the test in the else to avoid duplicated names, but enforce this test only for nodes having IDs. Thus most tests without any ID will work, and allows us fixing * Added more tests regarding request with/without IDs. `TestStateStore_EnsureNode` now test registration and renaming with IDs `TestStateStore_EnsureNodeDeprecated` tests registration without IDs and tests removing an ID from a node as well as updated a node without its ID (deprecated behaviour kept for backwards compatibility) * Do not allow renaming in case of conflict, including when other node has no ID * Fixed function GetNodeID that was not working due to wrong type when searching node from its ID Thus, all tests about renaming were not working properly. Added the full test cas that allowed me to detect it. * Better error messages, more tests when nodeID is not a valid UUID in GetNodeID() * Added separate TestStateStore_GetNodeID to test GetNodeID. More complete test coverage for GetNodeID * Added new unit test `TestStateStore_ensureNoNodeWithSimilarNameTxn` Also fixed comments to be clearer after remarks from @banks * Fixed error message in unit test to match test case * Use uuid.ParseUUID to parse Node.ID as requested by @mkeeler |
||
---|---|---|
.. | ||
autopilot | ||
fsm | ||
prepared_query | ||
state | ||
acl.go | ||
acl_endpoint.go | ||
acl_endpoint_test.go | ||
acl_replication.go | ||
acl_replication_test.go | ||
acl_test.go | ||
autopilot.go | ||
autopilot_oss.go | ||
autopilot_test.go | ||
catalog_endpoint.go | ||
catalog_endpoint_test.go | ||
client.go | ||
client_serf.go | ||
client_test.go | ||
config.go | ||
connect_ca_endpoint.go | ||
connect_ca_endpoint_test.go | ||
consul_ca_delegate.go | ||
coordinate_endpoint.go | ||
coordinate_endpoint_test.go | ||
enterprise_client_oss.go | ||
enterprise_server_oss.go | ||
filter.go | ||
filter_test.go | ||
flood.go | ||
health_endpoint.go | ||
health_endpoint_test.go | ||
helper_test.go | ||
intention_endpoint.go | ||
intention_endpoint_test.go | ||
internal_endpoint.go | ||
internal_endpoint_test.go | ||
issue_test.go | ||
kvs_endpoint.go | ||
kvs_endpoint_test.go | ||
leader.go | ||
leader_test.go | ||
merge.go | ||
merge_test.go | ||
operator_autopilot_endpoint.go | ||
operator_autopilot_endpoint_test.go | ||
operator_endpoint.go | ||
operator_raft_endpoint.go | ||
operator_raft_endpoint_test.go | ||
prepared_query_endpoint.go | ||
prepared_query_endpoint_test.go | ||
raft_rpc.go | ||
rpc.go | ||
rpc_test.go | ||
rtt.go | ||
rtt_test.go | ||
segment_oss.go | ||
serf_test.go | ||
server.go | ||
server_lookup.go | ||
server_lookup_test.go | ||
server_oss.go | ||
server_serf.go | ||
server_test.go | ||
session_endpoint.go | ||
session_endpoint_test.go | ||
session_timers.go | ||
session_timers_test.go | ||
session_ttl.go | ||
session_ttl_test.go | ||
snapshot_endpoint.go | ||
snapshot_endpoint_test.go | ||
stats_fetcher.go | ||
stats_fetcher_test.go | ||
status_endpoint.go | ||
status_endpoint_test.go | ||
txn_endpoint.go | ||
txn_endpoint_test.go | ||
util.go | ||
util_test.go |