[ 
https://issues.apache.org/jira/browse/SOLR-13280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16779790#comment-16779790
 ] 

Christine Poerschke commented on SOLR-13280:
--------------------------------------------

Attached proposed patch which adds validation to check that the 
{{preferredOperation}} parameter is at least a valid {{CollectionAction}} enum 
value (though not all enum values may be applicable or supported for a 
scheduled trigger). The "set-trigger" call then returns an "error" response 
like this in case of typos:
{code}
"Error validating trigger config scheduled_event_trigger: 
TriggerValidationException{name=scheduled_event_trigger, 
details='{preferredOperation=unrecognized value of: 'MOVE_REPLICA'}'}"
{code}


> strengthen ScheduledTrigger's preferredOperation parameter validation
> ---------------------------------------------------------------------
>
>                 Key: SOLR-13280
>                 URL: https://issues.apache.org/jira/browse/SOLR-13280
>             Project: Solr
>          Issue Type: Improvement
>          Components: AutoScaling
>            Reporter: Christine Poerschke
>            Assignee: Christine Poerschke
>            Priority: Minor
>         Attachments: SOLR-13280.patch
>
>
> Currently a typo such as (say) {{MOVE_REPLICA}} instead of the correct 
> {{MOVEREPLICA}} results in a "success" response for the "set-trigger" call 
> but in the Solr logs NullPointerException stuff is happening e.g.
> {code}
>   "eventType":"SCHEDULED",
>   "properties":{
>     "actualEventTime":...,
>     "preferredOperation":"MOVE_REPLICA",
>     "_enqueue_time_":...}}
>         at 
> org.apache.solr.cloud.autoscaling.ComputePlanAction.process(ComputePlanAction.java:160)
>  ~[?:?]
>         at 
> org.apache.solr.cloud.autoscaling.ScheduledTriggers.lambda$null$3(ScheduledTriggers.java:324)
>  ~[?:?]
>         ... 6 more
> Caused by: java.lang.NullPointerException
>         at 
> org.apache.solr.client.solrj.cloud.autoscaling.Policy$Session.getSuggester(Policy.java:628)
>  ~[?:?]
>         at 
> org.apache.solr.cloud.autoscaling.ComputePlanAction.getSuggester(ComputePlanAction.java:262)
>  ~[?:?]
>         at 
> org.apache.solr.cloud.autoscaling.ComputePlanAction.process(ComputePlanAction.java:97)
>  ~[?:?]
>         at 
> org.apache.solr.cloud.autoscaling.ScheduledTriggers.lambda$null$3(ScheduledTriggers.java:324)
>  ~[?:?]
>         ... 6 more
> {code}
> Proposed patch to follow.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to