Skip to content

Conversation

@benwtrent
Copy link
Member

There are certain settings that could be made dynamic. This addresses that and marks old settings as deprecated in preparation to v7.

DONT_PERSIST_MODEL_STATE_SETTING is the only other setting I could find, but I do not think that should be made dynamic as the state may already be persisted and the pipeline already created.

Another possible setting is DEFAULT_BASE_PERSIST_INTERVAL, however, I am not sure end users really care about this as replaying the job with just 3 hours of data to recover is pretty simple. @droberts195 @dimitris-athanasiou let me know what you think.

closes #33565

@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core

Copy link
Contributor

@dimitris-athanasiou dimitris-athanasiou left a 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 comment about how we access the max anomaly records setting.

}

autodetectBuilder.build();
autodetectBuilder.build(maxAnomalyRecords);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we are creating a new AutodetectBuilder each time, I think we can pass it the settings in each constructor. We currently pass it the stored settings that could be out of date. But we can pass it instead clusterService.settings(). I am not sure what the difference between clusterService.settings() and clusterService.clusterSettings() is, but if we figure that out I'm sure we can make it work. This would mean we don't need to have a listener in AutodetectProcessManager for the setting plus we can keep the build() method without any arguments.


static String maxAnomalyRecordsArg(int maxAnomalyRecords) {
return "--maxAnomalyRecords=" + maxAnomalyRecords;
static String maxAnomalyRecordsArg(Settings settings) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! Only thing is we now could make this method non-static and not have to pass in the settings. There are possibly more methods in there that could be non-static. Not necessary to do this in this PR though, only if you feel like it :-)

Copy link
Contributor

@dimitris-athanasiou dimitris-athanasiou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

public static final Setting<Integer> MAX_ANOMALY_RECORDS_SETTING = Setting.intSetting("max.anomaly.records", DEFAULT_MAX_NUM_RECORDS,
Setting.Property.NodeScope);
Setting.Property.NodeScope, Setting.Property.Deprecated);
public static final Setting<Integer> MAX_ANOMALY_RECORDS_SETTING_DYNAMIC = Setting.intSetting(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to add a comment that although this is now dynamic, updates only apply to newly opened jobs, not already running jobs.

I don't think this setting will be changed often enough that this is worth fixing. (At the moment the setting is completely undocumented, so it's unlikely anyone will be changing it.) But it's good to have a comment pointing out the limitation so that if we ever do decide to document it then the limitation will hopefully get documented too.

@benwtrent benwtrent merged commit 74d7be8 into elastic:master Sep 24, 2018
benwtrent added a commit that referenced this pull request Sep 24, 2018
* Make certain ML node settings dynamic (#33565)

* Changing to pull in updating settings and pass to constructor

* adding note about only newly opened jobs getting updated value
kcm pushed a commit that referenced this pull request Oct 30, 2018
* Make certain ML node settings dynamic (#33565)

* Changing to pull in updating settings and pass to constructor

* adding note about only newly opened jobs getting updated value
@benwtrent benwtrent deleted the feature/make-ml-settings-dynamic branch November 26, 2018 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ML] Review and upgrade static node settings and into dynamic cluster settings

4 participants