Changeset 33392 for main


Ignore:
Timestamp:
2019-08-08T15:15:11+12:00 (5 years ago)
Author:
ak19
Message:

Kathy found a problem whereby she wanted to run consecutive buildcols without activate on a solr collection. She experienced file locking issues on Windows, which the original solr related building code would inevitably cause without activate. Dr Bainbridge's solution was to change our way of thinking about what activate and buildcol should now be doing as regards solr collections. The solution was to unload building-cores for indexes at the end of buildcol, instead of only doing this during activate.pl. I've tried to be conservative with the changes made to the existing code, so that activate still attempts to also unload building-cores, but first pings them (and any other cores it attempts to unload) to ensure the cores exist. During buildcol too, the building-cores are pinged to check they exist before we attempt to unload them.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/bin/script/activate.pl

    r32178 r33392  
    277277   
    278278    # If the Solr/Jetty server is not already running, the following starts
    279     # it up, and only returns when the server is "reading and listening"   
     279    # it up, and only returns when the server is "ready and listening" 
    280280    $solr_server = new solrserver($build_dir);
    281281    $solr_server->start();
    282282   
    283     # We'll be moving building to index. For solr collection, there's further
     283    # We'll be moving building to index. For a solr collection, there's further
    284284    # special processing to make a corresponding change to the solr.xml
    285285    # by removing the temporary building cores and (re)creating the index cores
     
    307307        # if solr, remove any cores that are using the index_dir before deleting this dir
    308308        foreach my $corename (@corenames) {
    309             $solr_server->admin_unload_core($corename);
     309            $solr_server->admin_unload_core($corename) if ($solr_server->admin_ping_core($corename));
    310310        }
    311311        }   
     
    327327        # if solr, remove any cores that are using the building_dir before moving this dir onto index
    328328        foreach my $corename (@corenames) {
    329         $solr_server->admin_unload_core("building-$corename");
     329        $solr_server->admin_unload_core("building-$corename") if ($solr_server->admin_ping_core("building-$corename"));
    330330        }
    331331    }
     
    376376            $solr_server->admin_unload_core($corename);
    377377        }
    378             $solr_server->admin_create_core($corename, $index_dir);
     378        $solr_server->admin_create_core($corename, $index_dir);
    379379       
    380380        }
Note: See TracChangeset for help on using the changeset viewer.