-
Notifications
You must be signed in to change notification settings - Fork 23
Improve BackbeatAPI pause/resume logic #2644
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
base: development/9.1
Are you sure you want to change the base?
Conversation
Hello benzekrimaha,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
5c752cc to
8bdad47
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files
... and 3 files with indirect coverage changes
@@ Coverage Diff @@
## development/9.1 #2644 +/- ##
===================================================
- Coverage 74.81% 74.61% -0.20%
===================================================
Files 201 200 -1
Lines 13579 13553 -26
===================================================
- Hits 10159 10113 -46
- Misses 3410 3430 +20
Partials 10 10
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Request integration branchesWaiting for integration branch creation to be requested by the user. To request integration branches, please comment on this pull request with the following command: Alternatively, the |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
|
c0d3dcc to
ff585d7
Compare
c054a62 to
a22cfb0
Compare
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.
I tried to review everything but due to some changes I discuss, some of my comments will likely end up irrelevant, I suggest reading the whole review and work on the "big part"s first, so you don't waste time addressing some of my comments I wrote with the current code
1bad81a to
fdad4ff
Compare
55315b6 to
e7ff27d
Compare
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.
Overall, still seems very complex to me, mixing different layers and trying to introduce functions which "abstract everything" and make it very complex to understand what happens.
- We need to find a way to keep the "abstraction" (mongo vs zookeeper) somewhat cleanly separated, and not intermingle it with state management ;
- The state is already managed in memory (that is the starting point of the bug), in LocationStatus, so this is where the state management would need to be updated ;
- Since we want to fix inconsistent state, it means we need intermediary states (like PAUSE_IN_PROGRESS) in the FSM, and transition both before initiating the backend operation and once it has succeeded (or failed)
Since we have multiple processes (or restart), I wonder however if this approach really works in every case : we may write the state to the backend, but then another process could overwrite this state in between, and we would still be inconsistent?
(i.e. maybe the safer -and simpler- way is to rely on the backend information and using more "transactional" operations instead of in-memory cache)
e7ff27d to
0119161
Compare
0119161 to
764200f
Compare
0c74609 to
82fe1a3
Compare
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.
also please rebase 🙏
82fe1a3 to
9a02b7b
Compare
To avoid race conditions and state inconsistency issues we remove the in-memory state entirely and replace it with conditional mongo updates. Issue: BB-658
- Only initialize the DB once (done in the primary process) - Queue previously scheduled resumes Issue: BB-658
Issue: BB-658
returning an error when the update condition fails and no document is updated instead of silently failing Issue: BB-658
9a02b7b to
0b81a26
Compare
Issue: BB-658