[ https://issues.apache.org/jira/browse/SOLR-13151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16773126#comment-16773126 ]
Gus Heck commented on SOLR-13151: --------------------------------- {quote} no metadata validation is done during the CreateAlias command. {quote} This is not quite true validations are presently done, but there's still some work to do in the case of CRAs, but at the very initial entry point we don't know if it's a routed alias or a regular alias, so we can only check for inconsistent parameters there (in CollectionsHandler.CREATEALIAS_OP). Once we know it's a routed alias we don't know which type of routing, so RoutedAlias.fromProps() can only check that the routing type is one we know of. If you look at TimeRoutedAlias most of the input validation occurs in the constructor, where we finally know which type of alias we are dealing with. The general ethos there is to check that we did get valid values for our expected props and ignore/drop anything we don't recognize. The CategoryRoutedAlias constructor should do the same, but until your recent additions we didn't have very much to validate, and I was planning on using 13152 to clean that up along with changing an error message in TimeRoutedAlias() and anything else that remains to be done to make the admin command work as expected (plus documentation of course). With this in mind the check you added in CreateAliasCmd#callCreateRoutedAlias:121 is slightly redundant, but the listing of missing required params seems nice so I decided to keep it :) This design plus the "almost immutable" design of the routed alias implementations ensures that we are never handling a Routed Alias class that is miss-configured. (they do accept changes to the list of collections from zookeeper so not quite immutable, but they are unmodifiable from a code perspective once created) > Provide regex based category validation for CategoryRoutedAliases > ----------------------------------------------------------------- > > Key: SOLR-13151 > URL: https://issues.apache.org/jira/browse/SOLR-13151 > Project: Solr > Issue Type: Sub-task > Security Level: Public(Default Security Level. Issues are Public) > Components: UpdateRequestProcessors > Affects Versions: master (9.0) > Reporter: Gus Heck > Priority: Major > > This ticket will add the check to enforce a (configurable, optional) regular > expression to enreject requests that attempt to add an unexpected category, > or a malformed category to a category routed alias. The purpose of this check > is to provide a safety valve to ensure that unexpected data values don't > cause creation of collections inconsistent with the user's intended design. > This check should happen within the validateRouteValue() method specified by > RoutedAlias -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org