Conversation
Mutex is needed to protect client usage when client may be nil during a reconnect. Otherwise the code will panic in multiple places. Co-authored-by: Surya Seetharaman <suryaseetharaman.9@gmail.com> Signed-off-by: Tim Rozet <trozet@redhat.com>
This is a workaround due to a bug in ovsdb-server where it may silently drop monitors: https://bugzilla.redhat.com/show_bug.cgi?id=2000375 Related to ovnkube bug: https://bugzilla.redhat.com/show_bug.cgi?id=1998614 tl;dr ovsdb-server may drop the monitor to go-ovn silently which will cause the go-ovn cache to go stale. Subsequent retry txns for the resource will result in errors from ovsdb-server (since the resource may have been created in ovsdb, but we are not getting updates) threfore a txn error is encountered force reconnect to rebuild cache and get a new monitor. Co-authored-by: Surya Seetharaman <suryaseetharaman.9@gmail.com> Signed-off-by: Tim Rozet <trozet@redhat.com>
Contributor
|
Hi @trozet, the problem looks clear but I wonder if this is the right way to fix. There can be different reasons for a transaction to fail - it can be temporary. Are we going to blindly reconnect regardless of the reason? |
hzhou8
reviewed
Sep 17, 2021
| opsInfo = fmt.Sprintf("%v", ops[i]) | ||
| } | ||
| return nil, fmt.Errorf("Transaction Failed due to an error: %v details: %v in %s", | ||
| odbi.close() |
Contributor
There was a problem hiding this comment.
it doesn't trigger reconnect if odbi.reconn is not true.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Need a RWMutex to protect nil client usage during reconnect. Also includes a workaround for https://bugzilla.redhat.com/show_bug.cgi?id=2000375