[GOBBLIN-2016] Add eventTime to DagAction reminder key#3995
Conversation
| break; | ||
| case "DELETE": | ||
| log.debug("Deleted dagAction from DagActionStore: {}", dagAction); | ||
| /* TODO: skip deadline removal for now and let them fire |
There was a problem hiding this comment.
there's no event time in dagActionStore so cannot remove job from scheduler & this will be addressed in future pr to handle race condition between creating and deleting trigger
| * Creates a key for the reminder job by concatenating all dagAction fields and the eventTime of the dagAction to | ||
| * allow reminders for actions associated with multiple flow executions within a deadline period (e.g. another | ||
| * flow execution may occur before a flow finish or job start deadline expires) |
There was a problem hiding this comment.
this doesn't capture the nuance of why incorporating the flowExecId into the key (as already being done) is insufficient and an event timestamp is needed in addition.
please explain... (doesn't it have to do w/ event consolidation?)
There was a problem hiding this comment.
I believe there is a valid scenario to have multiple kill (or resume) dagActions on the same flow execution that are requested far enough apart (let's say 30 sec apart) to be considered unique events and we were not able to handle storage of reminders for the same actionType on the same execution. If epsilon is 20 sec and the requests are 30 sec apart they're distinct, but if the reminder is 90 sec then there is overlap for storing these reminders in the scheduler.
| * allow reminders for distinct action requests of the same flow execution within a deadline period (e.g. multiple | ||
| * kill requests for the same flow execution). |
There was a problem hiding this comment.
when you say "deadline period", that's not related to job-start or flow-completion deadlines, is it? do you mean "reminder period" (approx. the 'linger' setting)?
also, this is when multiple instances of the same action on the same flow execution originate more than 'epsilon' apart, right? and it's applicable to only KILL and RESUME, not other types, correct?
There was a problem hiding this comment.
it should be deadline or reminder period and more likely the former will actually cause the issue bc the SLA deadline (ie: job complete within 2 hours) is stored in this scheduler and will conflict with another SLA deadline reminder (job complete within 2 hours) stored in the Scheduler. The same conflict can also happen with the reminder period.
The latter is precisely correct, yes.
Dear Gobblin maintainers,
Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!
JIRA
Description
Handles the issue of identical KILL DagActions caused by multiple kill endpoint calls for the same FG+FN+flowExecId.
Adds
eventTimeto the key of thedagActionReminderSchedulerto ensure unique keys for multiple instances of the same action on the same flow execution that originate more than 'epsilon' apart.MultiActiveLeaseArbiteruses theeventTimeto distinguish these distinct occurrences of the same action. This is necessary to prevent insertion failures due to previous reminders.Applicable only for KILL and RESUME actions; duplication for other actions is an error.
Tests
My PR adds the following unit tests OR does not need testing for this extremely good reason:
updates existing scheduler unit tests to check for eventTimeMillis in key
also checks multiple flow execution deadlines can be added to scheduler at once
Commits