-
Notifications
You must be signed in to change notification settings - Fork 113
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
Interval schedule should take start time from the request, should not… #1040
Merged
bowenlan-amzn
merged 6 commits into
opensearch-project:main
from
ikibo:index-rollup-schedue-start-time
Nov 29, 2023
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e973b81
Interval schedule should take start time from the request, should not…
ikibo d7e0a1a
Changed the "delayed continuous execution test" to be more expressive…
ikibo d5a97d9
fixed the NPE if schedule.startTime is NULL
ikibo 876e1b6
fixed the NPE if schedule.startTime is NULL
ikibo eb190b9
fixed styling
ikibo 4758e48
- removed null checks from RollUp and Transforms
ikibo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -387,7 +387,7 @@ data class Transform( | |
if (seqNo == SequenceNumbers.UNASSIGNED_SEQ_NO || primaryTerm == SequenceNumbers.UNASSIGNED_PRIMARY_TERM) { | ||
// we instantiate the start time | ||
if (schedule is IntervalSchedule) { | ||
schedule = IntervalSchedule(schedule.startTime, schedule.interval, schedule.unit) | ||
schedule = IntervalSchedule(schedule.startTime ?: Instant.now(), schedule.interval, schedule.unit) | ||
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. @bowenlan-amzn I will remove this null check, the same story as with rollup. |
||
} | ||
|
||
// we clear out metadata if its a new job | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@bowenlan-amzn I will remove this null check. It is not necessary. And we did not break anything. The
schedule
is parsed earlier in this method on line 286 , and in this line the NPE is thrown ifschedule.startTime == null
(https://github.com/opensearch-project/index-management/blob/59cf8dd54b9617f0bc161a0e9b653529442f8e70/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/Rollup.kt#L286C1-L286C32)I checked it. I removed my changes and sent
transform
withschedule.start_time : null
. Got 400 : numeric field may not be null.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 see, thanks, previously I thought this schedule field is optional, but turns out this is a required field, and schedule startTime is also required, which means user has to provide some long values here anyway. So I guess this has been a bad user experience till now, and we are just making it more reasonable.