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

Automated cherry pick of #6284: Fix single rule deletion for NodePortLocal on Linux (#6284) #6299

Commits on May 7, 2024

  1. Fix single rule deletion for NodePortLocal on Linux (antrea-io#6284)

    The logic for deleting an individual NPL mapping was broken. It
    incorrectly believed that the protocol socket was still in use, and the
    mapping could never be deleted, putting the NPL controller in an endless
    error loop.
    
    The State field in ProtocolSocketData was left over from pre Antrea
    v1.7, back when we would always use the same port number for multiple
    protocols, for a give Pod IP + port. With the current version of the NPL
    implementation, this field is not needed and should be removed. By
    removing the field, we avoid the deletion issue.
    
    This patch also ensures that if a rule is only partially cleaned-up, we
    can attempt to delete it again, by making DeleteRule idempotent. To
    identify that a prior deletion attempt failed, we introduce a "defunct"
    field in the NPL rule data. If this field is set, the controller knows
    that the rule has been partially deleted and deletion needs to be
    attempted again. Without this, it would be possible for the controller
    (with the right sequence of updates) to assume that a partially-deleted
    rule is still valid, which would break the datapath. I plan on improving
    the NPL code further with a follow-up patch, but in order to keep this
    patch small (for back-porting), I went with the simplest solution I
    could think of.
    
    Fixes antrea-io#6281
    
    Signed-off-by: Antonin Bas <antonin.bas@broadcom.com>
    antoninbas committed May 7, 2024
    Configuration menu
    Copy the full SHA
    a4290b2 View commit details
    Browse the repository at this point in the history