-
Notifications
You must be signed in to change notification settings - Fork 59
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
Add back tranmutex #153
Open
trozet
wants to merge
2
commits into
eBay:master
Choose a base branch
from
trozet:add_back_tranmutex
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add back tranmutex #153
Conversation
This file contains 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
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 <[email protected]> Signed-off-by: Tim Rozet <[email protected]>
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 <[email protected]> Signed-off-by: Tim Rozet <[email protected]>
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
@@ -164,7 +166,8 @@ func (odbi *ovndb) transact(db string, ops ...libovsdb.Operation) ([]libovsdb.Op | |||
if i < len(ops) { | |||
opsInfo = fmt.Sprintf("%v", ops[i]) | |||
} | |||
return nil, fmt.Errorf("Transaction Failed due to an error: %v details: %v in %s", | |||
odbi.close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it doesn't trigger reconnect if odbi.reconn is not true.
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