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

Fix missed deletion events when reconnecting to/disconnecting from remote clusters (ipcache entries) #25675

Commits on Jun 1, 2023

  1. IPIdentityPair: implement the store.Key interface

    This commit extends the IPIdentityPair struct implementing the store.Key
    interface, to allow reading/writing it through the store abstractions.
    
    Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
    giorio94 committed Jun 1, 2023
    Configuration menu
    Copy the full SHA
    8175769 View commit details
    Browse the repository at this point in the history
  2. clustermesh: delete stale ipcache entries on reconnect/disconnect

    Currently, a new ipcache watcher is created for each connection to the
    kvstore backend of a remote cluster, and the old one is dropped. Yet,
    this approach leads to missing the deletion event for possible entries
    that are removed in the remote cluster during the reconnection process
    (added entries would instead be detected by the initial "list" operation).
    
    This commit fixes this issue moving to a single ipcache watcher per
    remote cluster, which is reused upon reconnection. Specifically, it now
    leverages the newly introduced RestartableWatchStore to automatically
    trigger a deletion event for all previously known entries that are no
    longer present after a reconnection. Special handling is performed in
    case the ClusterID associated with the watcher is changed, draining all
    previously known entries as no longer valid (even if still present, they
    need to be observed again with the new ClusterID).
    
    Additionally, all ipcache entries are drained when disconnecting from a
    remote cluster, to properly clean-up the status without requiring to
    restart the agent. Differently, they are not drained when simply shutting
    down, to avoid breaking existing connections on restart.
    
    Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
    giorio94 committed Jun 1, 2023
    Configuration menu
    Copy the full SHA
    47c93e5 View commit details
    Browse the repository at this point in the history