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

Amrit Sarkar commented on SOLR-12934:
-------------------------------------

While looking at the code; for each URP; the base methods 
processAdd,processDelete.... and rest are called, which triggers the next URP 
execution, at the end of each method implementation, like:
{code}
    @Override
    public void processAdd(AddUpdateCommand cmd) throws IOException {
      final SolrInputDocument doc = cmd.getSolrInputDocument();
      if (! doc.containsKey(fieldName)) {
        doc.addField(fieldName, getDefaultValue());
      }
      super.processAdd(cmd);
    }
{code}
which means we have to accommodate the CDCR aware logic at each overridden 
method; it is cumbersome but works fine. Updated CdcrBidirectionalTest with 
clusters have their default / own URP chain, and it works.
Still, need to update documentation, showcasing for custom URPs you need to 
implement the logic yourself; so half-baked solution.
{code}
      if (cmd.getReq().getParams().get(CDCR_UPDATE) != null) {
        super.processAdd(cmd);
        return;
      }
{code}

> Make Update Request Processors CDCR aware (i.e. skip process if CDCR 
> forwarded update)
> --------------------------------------------------------------------------------------
>
>                 Key: SOLR-12934
>                 URL: https://issues.apache.org/jira/browse/SOLR-12934
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: CDCR, UpdateRequestProcessors
>            Reporter: Amrit Sarkar
>            Priority: Major
>
> While [setting up 
> CDCR|https://lucene.apache.org/solr/guide/7_5/cdcr-config.html] in 
> {{solrconfig.xml}} at {{target}} cluster, we need to make default update 
> processor chain with {{CdcrUpdateProcessorFactory}} like:
> {code}
> <updateRequestProcessorChain name="cdcr-processor-chain">
>   <processor class="solr.CdcrUpdateProcessorFactory"/>
>   <processor class="solr.RunUpdateProcessorFactory"/>
> </updateRequestProcessorChain>
> {code}
> {code}
> <requestHandler name="/update" class="solr.UpdateRequestHandler">
>   <lst name="defaults">
>     <str name="update.chain">cdcr-processor-chain</str>
>   </lst>
> </requestHandler>
> {code}
> The motivation having a default update processor chain with no other but 
> {{CdcrUpdateProcessorFactory}} is to NOT MODIFY already processed and 
> transformed data at source. And it works perfectly.
> In {{Bidirectional}} scenario, we need to set this default chain at both 
> clusters, source & target. And while sending documents from application side; 
> we need to EXPLICITLY SET 
> [update.chain|https://lucene.apache.org/solr/guide/6_6/update-request-processors.html#UpdateRequestProcessors-CustomUpdateRequestProcessorChain]
>  with each batch at the primary/source cluster. This introduces an extra 
> activity/effort at the application end.
> It would be great if we can make Update Request Processors CDCR aware; i.e. 
> skip and don't process the doc batches which are CDCR forwarded ones and 
> treat the others as default. 



--
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