-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Add delayed datacheck to the datafeed job runner #35387
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
Add delayed datacheck to the datafeed job runner #35387
Conversation
Pinging @elastic/ml-core |
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.
Code LGTM I have some general comments about the behaviour
.../rest-high-level/src/test/java/org/elasticsearch/client/ml/datafeed/DatafeedConfigTests.java
Show resolved
Hide resolved
x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/DatafeedJob.java
Outdated
Show resolved
Hide resolved
I say no. If we are using the model where the user has to set both params then it's a problem is both aren't set, otherwise the behaviour may be unexpected. I do think
With a 10 minute bucket the current value of 10,000 buckets is over 64 days. Did you consider making the limit an absolute time value rather than a function of the bucket length.
Yes please.
Less frequently 🤷♂️ |
x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/DatafeedJob.java
Outdated
Show resolved
Hide resolved
@davidkyle when it comes to a sane upper limit I can see benefits to either using a true TimeValue or a multiple of the bucket span. I do realize that it is way too large right now, the current limit is dictated by the number of documents that are searchable at a time and not by a realistic use case.
There is nothing preventing this right now...but if we store the latest timestamp of the bucket with missing docs && how many docs are missing overall, we could simply check if the values have changed and skip writing the message so that the audit log does not get spammed.
Any suggestions on a sensible value? |
@davidkyle Updated. Key updates
|
client/rest-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/DatafeedConfig.java
Outdated
Show resolved
Hide resolved
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.
LGTM
* The window must be larger than the {@link org.elasticsearch.client.ml.job.config.AnalysisConfig#bucketSpan}, less than | ||
* 24 hours, and span less than 10,000x buckets. | ||
* | ||
* @param delayedDataCheckWindow The time length in the past from the latest finalized bucket to look for latent data |
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.
nit missing full stop at the end of the sentence
Jenkins retest this please |
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.
Looks good! Left a few recommendations.
client/rest-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/DatafeedConfig.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedConfig.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/DelayedDataDetector.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/DatafeedJob.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/DelayedDataDetector.java
Outdated
Show resolved
Hide resolved
Jenkins retest this please |
...st-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/DelayedDataCheckConfig.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedConfig.java
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedConfig.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedUpdate.java
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedUpdate.java
Outdated
Show resolved
Hide resolved
...plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedJobValidator.java
Outdated
Show resolved
Hide resolved
...in/java/org/elasticsearch/xpack/ml/datafeed/delayeddatacheck/DelayedDataDetectorFactory.java
Outdated
Show resolved
Hide resolved
...in/java/org/elasticsearch/xpack/ml/datafeed/delayeddatacheck/DelayedDataDetectorFactory.java
Outdated
Show resolved
Hide resolved
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.
LGTM I think this looks wonderful now, great work Ben!
Jenkins retest this please |
* ML: Adding missing datacheck to datafeedjob * Adding client side and docs * Making adjustments to validations * Making values default to on, having more sensible limits * Intermittent commit, still need to figure out interval * Adjusting delayed data check interval * updating docs * Making parameter Boolean, so it is nullable * bumping bwc to 7 before backport * changing to version current * moving delayed data check config its own object * Separation of duties for delayed data detection * fixing checkstyles * fixing checkstyles * Adjusting default behavior so that null windows are allowed * Mentioning the default value * Fixing comments, syncing up validations
This adds a latent data check to the
DatafeedJob
when it runs real-time jobs.It can optionally be enabled via the
DatafeedConfig
.Two new options added to the
DatafeedConfig
object, client side, and docs have been updated accordingly.Couple of decision points I could not really settle on:
delayed_data_check_window
ifshould_run_delayed_data_check
istrue
?delayed_data_check_window
outside of the current bucket length checks? If so, what are those sane limits?The integration tests are done within
DelayedDataDetectorIT
previously included, that covered the actual looking up of missing data and doing real queries, etc. against a cluster.Consequently, I just mocked out
DelayedDataDetector
in theDatafeedJobTests
class and thought that coverage adequate.Screenshot of how it looks:
Relates to #35131