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
Fixes errors when adding NAT with existing entry #2105
Conversation
@fedepaol PTAL |
611a8df
to
84789f7
Compare
/lgtm |
@trozet The usage for it is....
.. in that when the TYPE is
So, your UpdateRouterNAT() will not work for |
@trozet I also didn't understand your comment below // Combining lr-nat-del and lr-nat-add will fail OVSDB transaction check because On my test machine, I could do:
So, I was able to delete and add in the same transaction. I might be missing something. |
IIRC the problem is when you use --may-exist, quoting Dimitru from an internal discussion about this topic
|
@girishmg maybe you are using an older version of OVN/OVS? This is what I see:
|
sigh...we really need to move to go-bindings. I'll change the function to only handle SNAT. |
84789f7
to
8ffba1a
Compare
@dceara FYI this looks like a regression where lr-nat-del -- lr-nat-add used to work. I dont expect you to rush to fix this or anything, just wanted to highlight it in case there is a bigger regression here that went unnoticed. |
@trozet thank you for not using Your changes LGTM. Looks like it is complaining about |
When adding SNAT per pod with an existing entry, the code will fail and report an error because with OVN we cannot do lr-nat-del and lr-nat-add in the same OVSDB transaction. This is because OVSDB evaluates the lr-nat-add and thinks there will be a conflict because an entry already exists. Additionally, during gateway init for a node, this failure may also occur. In which case the GR will be left with missing config. To handle this case, split add and delete into separate transactions, and only del/add if the entry is missing. Signed-off-by: Tim Rozet <trozet@redhat.com>
8ffba1a
to
a3978f2
Compare
/gtm |
When adding SNAT per pod with an existing entry, the code will fail and
report an error because with OVN we cannot do lr-nat-del and lr-nat-add
in the same OVSDB transaction. This is because OVSDB evaluates the
lr-nat-add and thinks there will be a conflict because an entry already
exists.
Additionally, during gateway init for a node, this failure may also
occur. In which case the GR will be left with missing config.
To handle this case, split add and delete into separate transactions,
and only del/add if the entry is missing.
Signed-off-by: Tim Rozet trozet@redhat.com