Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to rename nodes with IDs #5

Merged

Commits on Jul 18, 2018

  1. Allow to rename nodes with IDs, will fix hashicorp#3974 and hashicorp…

    …#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 hashicorp#3983 and hashicorp#4399 for Context about this change.
    
    Disabling registration of nodes without IDs as specified in hashicorp#4414
    should probably be the way to go eventually.
    pierresouchay committed Jul 18, 2018
    Configuration menu
    Copy the full SHA
    5aca4e5 View commit details
    Browse the repository at this point in the history
  2. 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 hashicorp#4414 in
    a later release.
    pierresouchay committed Jul 18, 2018
    Configuration menu
    Copy the full SHA
    6161266 View commit details
    Browse the repository at this point in the history
  3. 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
    pierresouchay committed Jul 18, 2018
    Configuration menu
    Copy the full SHA
    1a837dc View commit details
    Browse the repository at this point in the history

Commits on Jul 19, 2018

  1. 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)
    pierresouchay committed Jul 19, 2018
    Configuration menu
    Copy the full SHA
    b030880 View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2018

  1. Configuration menu
    Copy the full SHA
    bbf5822 View commit details
    Browse the repository at this point in the history

Commits on Jul 21, 2018

  1. 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.
    pierresouchay committed Jul 21, 2018
    Configuration menu
    Copy the full SHA
    6f52314 View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2018

  1. Configuration menu
    Copy the full SHA
    e323155 View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2018

  1. Added separate TestStateStore_GetNodeID to test GetNodeID.

    More complete test coverage for GetNodeID
    pierresouchay committed Jul 26, 2018
    Configuration menu
    Copy the full SHA
    55d3380 View commit details
    Browse the repository at this point in the history

Commits on Jul 27, 2018

  1. Added new unit test TestStateStore_ensureNoNodeWithSimilarNameTxn

    Also fixed comments to be clearer after remarks from @banks
    pierresouchay committed Jul 27, 2018
    Configuration menu
    Copy the full SHA
    a58a977 View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2018

  1. Configuration menu
    Copy the full SHA
    c717608 View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2018

  1. Configuration menu
    Copy the full SHA
    05af3a1 View commit details
    Browse the repository at this point in the history