-
Notifications
You must be signed in to change notification settings - Fork 751
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
[GOBBLIN-1930] Improve Multi-active related logs and metrics #3800
Changes from 1 commit
00a26ee
e3bfa64
d4c7c2f
fff6670
07ea65c
627e7ec
afaedbe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,28 +79,42 @@ abstract class LeaseAttemptStatus {} | |
class NoLongerLeasingStatus extends LeaseAttemptStatus {} | ||
|
||
/* | ||
The participant calling this method acquired the lease for the event in question. The class contains the | ||
`eventTimestamp` associated with the lease as well as the time the caller obtained the lease or | ||
`leaseAcquisitionTimestamp`. | ||
The participant calling this method acquired the lease for the event in question. `Flow action`'s flow execution id | ||
is the timestamp associated with the lease and the time the caller obtained the lease is stored within the | ||
`leaseAcquisitionTimestamp` field. | ||
*/ | ||
@Data | ||
class LeaseObtainedStatus extends LeaseAttemptStatus { | ||
private final DagActionStore.DagAction flowAction; | ||
private final long eventTimestamp; | ||
private final long leaseAcquisitionTimestamp; | ||
|
||
/** | ||
* Returns event time in millis since epoch for the event of this lease acquisition. | ||
* @return | ||
umustafi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
*/ | ||
public long getEventTimeMillis() { | ||
return Long.parseLong(flowAction.getFlowExecutionId()); | ||
} | ||
} | ||
|
||
/* | ||
This flow action event already has a valid lease owned by another participant. | ||
`eventTimeMillis` is the timestamp the lease is associated with, which may be a different timestamp for the same flow | ||
action corresponding to the same instance of the event or a distinct one. | ||
`Flow action`'s flow execution id is the timestamp the lease is associated with, which may be a different timestamp | ||
for the same flow action corresponding to the same instance of the event or a distinct one. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. somewhat confusing, "which may be a different timestamp for the same..." - reword? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tried to reword lmk what u think |
||
`minimumLingerDurationMillis` is the minimum amount of time to wait before this participant should return to check if | ||
the lease has completed or expired | ||
*/ | ||
@Data | ||
class LeasedToAnotherStatus extends LeaseAttemptStatus { | ||
private final DagActionStore.DagAction flowAction; | ||
private final long eventTimeMillis; | ||
private final long minimumLingerDurationMillis; | ||
|
||
/** | ||
* Returns event time in millis since epoch for the event whose lease was obtained by another participant. | ||
* @return | ||
*/ | ||
public long getEventTimeMillis() { | ||
return Long.parseLong(flowAction.getFlowExecutionId()); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,13 +117,15 @@ public void handleTriggerEvent(Properties jobProps, DagActionStore.DagAction flo | |
this.leaseObtainedCount.inc(); | ||
if (persistFlowAction(leaseObtainedStatus)) { | ||
log.info("Successfully persisted lease: [{}, eventTimestamp: {}] ", leaseObtainedStatus.getFlowAction(), | ||
leaseObtainedStatus.getEventTimestamp()); | ||
leaseObtainedStatus.getEventTimeMillis()); | ||
return; | ||
} | ||
// If persisting the flow action failed, then we set another trigger for this event to occur immediately to | ||
// re-attempt handling the event | ||
DagActionStore.DagAction updatedFlowAction = DagActionStore.DagAction.updateFlowExecutionId(flowAction, | ||
leaseObtainedStatus.getEventTimeMillis()); | ||
scheduleReminderForEvent(jobProps, | ||
new MultiActiveLeaseArbiter.LeasedToAnotherStatus(flowAction, leaseObtainedStatus.getEventTimestamp(), 0L), | ||
new MultiActiveLeaseArbiter.LeasedToAnotherStatus(updatedFlowAction, 0L), | ||
Comment on lines
+125
to
+128
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we still need this if we are using the event timetime millisecond, which should be synchronized across all hosts? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes we do, the timestamp within |
||
eventTimeMillis); | ||
return; | ||
} else if (leaseAttemptStatus instanceof MultiActiveLeaseArbiter.LeasedToAnotherStatus) { | ||
|
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.
this would better belong as a method of the
DagAction
class defined on line 39There 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.
this is included as a method of the class, it's static because it returns a new dagAction obj