Solr
  1. Solr
  2. SOLR-821

replication must allow copying conf file in a different name to slave

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4
    • Component/s: None
    • Labels:
      None

      Description

      It is likely that a file is different in master and slave. for instance replicating solrconfig.xml is not possible with the current config if master and slave has diffferent solrconfig.xml (which is always true)

      We can add an alias feature in the confFiles as

      <str name="confFiles">slave_solrconfig.xml:solrconfig.xml,slave_schema.xml:schema.xml</str>
      

      This means that the file slave_solrconfig.xml should be copied to the slave as solrconfig.xml and slave_schema.xml must be saved to slave as schema.xml

      1. SOLR-821.patch
        92 kB
        Akshay K. Ukey
      2. SOLR-821.patch
        8 kB
        Noble Paul
      3. SOLR-821.patch
        7 kB
        Akshay K. Ukey
      4. SOLR-821.patch
        7 kB
        Noble Paul
      5. SOLR-821.patch
        6 kB
        Noble Paul

        Issue Links

          Activity

          Hide
          Noble Paul added a comment -

          untested.

          Show
          Noble Paul added a comment - untested.
          Hide
          Noble Paul added a comment -

          it had an obvious bug. But still untested

          Show
          Noble Paul added a comment - it had an obvious bug. But still untested
          Hide
          Akshay K. Ukey added a comment -

          Patch with minor bug fix.

          Show
          Akshay K. Ukey added a comment - Patch with minor bug fix.
          Hide
          Noble Paul added a comment -

          allows copying a file in many names as follows

          <str name="confFiles">slave_solrconfig.xml,slave_solrconfig.xml:solrconfig.xml</str>
          
          Show
          Noble Paul added a comment - allows copying a file in many names as follows <str name= "confFiles" >slave_solrconfig.xml,slave_solrconfig.xml:solrconfig.xml</str>
          Hide
          Shalin Shekhar Mangar added a comment -

          Noble, since we use comma as separator for multiple files, did you mean this instead?

          <str name="confFiles">slave_solrconfig.xml:slave_solrconfig.xml,slave_solrconfig.xml:solrconfig.xml</str>
          

          This will make it possible to have config replication while allowing setting up repeaters for replicating across different data centers.

          Show
          Shalin Shekhar Mangar added a comment - Noble, since we use comma as separator for multiple files, did you mean this instead? <str name= "confFiles" > slave_solrconfig.xml:slave_solrconfig.xml,slave_solrconfig.xml:solrconfig.xml </str> This will make it possible to have config replication while allowing setting up repeaters for replicating across different data centers.
          Hide
          Noble Paul added a comment -

          Noble, since we use comma as separator for multiple files, did you mean this instead?

          nope . Both the configurations will have same effect. If name and alias are same no need to repeat it. I mean that is the default behavior where the colon is not used.

          Show
          Noble Paul added a comment - Noble, since we use comma as separator for multiple files, did you mean this instead? nope . Both the configurations will have same effect. If name and alias are same no need to repeat it. I mean that is the default behavior where the colon is not used.
          Hide
          Shalin Shekhar Mangar added a comment -

          If name and alias are same no need to repeat it. I mean that is the default behavior where the colon is not used.

          Ok I see. Sorry for the confusion.

          We need a test for this. Though the change is small, the feature is very important. I'll give a patch with a test.

          Show
          Shalin Shekhar Mangar added a comment - If name and alias are same no need to repeat it. I mean that is the default behavior where the colon is not used. Ok I see. Sorry for the confusion. We need a test for this. Though the change is small, the feature is very important. I'll give a patch with a test.
          Hide
          Akshay K. Ukey added a comment -

          Patch with test case.

          Show
          Akshay K. Ukey added a comment - Patch with test case.
          Hide
          Akshay K. Ukey added a comment -
          1. Patch with test case.
          2. Removed unused parts from solrconfig.xml and schema.xml in the test files.
          3. Few missing null pointer checks added.
          Show
          Akshay K. Ukey added a comment - Patch with test case. Removed unused parts from solrconfig.xml and schema.xml in the test files. Few missing null pointer checks added.
          Hide
          Shalin Shekhar Mangar added a comment -

          This is looking good, thanks Akshay!

          I'll commit this in a day or two.

          Show
          Shalin Shekhar Mangar added a comment - This is looking good, thanks Akshay! I'll commit this in a day or two.
          Hide
          Shalin Shekhar Mangar added a comment -

          Committed revision 727319.

          Thanks Akshay and Noble!

          Show
          Shalin Shekhar Mangar added a comment - Committed revision 727319. Thanks Akshay and Noble!
          Hide
          Grant Ingersoll added a comment -

          Bulk close for Solr 1.4

          Show
          Grant Ingersoll added a comment - Bulk close for Solr 1.4
          Hide
          Graham P added a comment -

          We don't have that problem, because we use solrcore.properties, containing:

          enable.master=true
          enable.slave=false

          (or visa versa on the slaves)

          Then the same solrconfig can be used on both (where solr.master is defined in solr.xml above the cores:

          <requestHandler name="/replication" class="solr.ReplicationHandler" >
          <lst name="master">
          <str name="enable">$

          {enable.master:false}

          </str>
          <str name="replicateAfter">commit</str>
          <str name="replicateAfter">startup</str>
          </lst>
          <lst name="slave">
          <str name="enable">$

          {enable.slave:false}

          </str>
          <str name="masterUrl">$

          {solr.master}

          /$

          {solr.core.name}

          /replication</str>
          <str name="pollInterval">00:00:60</str>
          </lst>
          </requestHandler>

          Show
          Graham P added a comment - We don't have that problem, because we use solrcore.properties, containing: enable.master=true enable.slave=false (or visa versa on the slaves) Then the same solrconfig can be used on both (where solr.master is defined in solr.xml above the cores: <requestHandler name="/replication" class="solr.ReplicationHandler" > <lst name="master"> <str name="enable">$ {enable.master:false} </str> <str name="replicateAfter">commit</str> <str name="replicateAfter">startup</str> </lst> <lst name="slave"> <str name="enable">$ {enable.slave:false} </str> <str name="masterUrl">$ {solr.master} /$ {solr.core.name} /replication</str> <str name="pollInterval">00:00:60</str> </lst> </requestHandler>

            People

            • Assignee:
              Shalin Shekhar Mangar
              Reporter:
              Noble Paul
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development