Closed GuptaManan100 closed 23 hours ago
Hello reviewers! :wave: Please follow this checklist when reviewing this Pull Request.
release notes (needs details)
label if users need to know about this change.-
), and have a clear help text.Jobs
should be named in order to mark it as required
.required
, the maintainer team must be notified._vt
tables and RPCs need to be backward compatible.vtctl
command output order should be stable and awk
-able.All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 67.39%. Comparing base (
2c6e053
) to head (eadb128
). Report is 5 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
🚨 Try these New Features:
If we're able, you could consider swapping this for the fairly new atomic.Bool in Go to eliminate this lock all together!
If we're able, you could consider swapping this for the fairly new atomic.Bool in Go to eliminate this lock all together!
I don't think that's possible here, because we depend on a consistent view over multiple fields (isServingPrimary
, state
).
If a consistent view over multiple fields is necessary then https://pkg.go.dev/sync/atomic#Pointer with a struct is also an option. No strong feelings, just wanted to offer a suggestion to eliminate the lock.
Description
While we fixed a couple of deadlocks in https://github.com/vitessio/vitess/pull/17230, one was left pending. It was found while testing for deadlocks in https://github.com/vitessio/vitess/pull/17238.
The deadlock is similar to the ones fixed in https://github.com/vitessio/vitess/pull/17230, it was occurring between MakePrimary and the reload. The fix employed is to let go of the lock once it is not required instead of defering its unlocking.
Related Issue(s)
17229
Checklist
Deployment Notes