Scheduler in HA

Registered by Limor Stotland

The problem:
==========
If 2 engines/scheduler runs simultaneously there could be a race condition that will lead for some task will be executed more than once.
This can happen because the transaction is released before the RPC called but it will be committed after the RPC.

The solution:
==========
1)Create new column ,processed, in the delayed_calls_v2 table:this column will mark the the schindler is work on this delayed_call but it didn't send it yet. This column will be updated just before sending the call on the RPC.If the update return 0 liens were updated that means that another scheduler already process those calls and this scheduler should not send it again.
2) The scheduler will from the delayed_calls_v2 only the cells that are marked as processed=false.
3)After sending the rpc call the scheduler will delete the delayed_calls.
4)The scheduler will send the RPC call with the delayed_calls id.
5)On the on_complete action the engine will try to delete the call (with the id from the RPC call).This is a fullback, if the scheduler will fail before deleting the calls

Future:
=====
Create a recovery mechanism

Blueprint information

Status:
Complete
Approver:
Renat Akhmerov
Priority:
High
Drafter:
Limor Stotland
Direction:
Approved
Assignee:
Limor Stotland
Definition:
Approved
Series goal:
Accepted for liberty
Implementation:
Implemented
Milestone target:
milestone icon 1.0.0
Started by
Limor Stotland
Completed by
Renat Akhmerov

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.