You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Andrzej Bialecki (JIRA)" <ji...@apache.org> on 2017/01/31 18:54:51 UTC

[jira] (SOLR-10054) Core swapping doesn't work with new metrics changes in place

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

Andrzej Bialecki  commented on SOLR-10054:
------------------------------------------

Yeah, we definitely need more test coverage of such fundamental functionality... :(

The issue turned out to be less trivial than I thought. When rename or swap core is requested the metrics subsystem needs to preserve metrics that are already accumulated under the old core name (we use separate registries per core). Since metrics' initialization occurs when core is constructed we can't easily re-register all {{SolrMetricProducer}}-s in the new registry, so the existing code tried to move actual {{Metric}} instances from the old to the new repository. The problem was that more or less the same metric names already existed in the target repository, because they were registered there by the other core's producers - and vice versa.

The solution was to implement a dedicated operation {{SolrMetricManager.swap(name1, name2)}} that knows how to atomically (or rather under proper locking) swap these two registries, without moving metric instances between registries.

I also added {{TestCoreAdmin.testCoreSwap}} and {{testValidCoreRename}}, and extended {{CoreAdminRequest}} to support the swap operation.

> Core swapping doesn't work with new metrics changes in place
> ------------------------------------------------------------
>
>                 Key: SOLR-10054
>                 URL: https://issues.apache.org/jira/browse/SOLR-10054
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>    Affects Versions: master (7.0), 6.4.0
>            Reporter: Shawn Heisey
>            Assignee: Andrzej Bialecki 
>         Attachments: solr64coreswap1.png, solr64coreswap2.png, solr64coreswap3.png
>
>
> The new 6.4.0 version includes some significant changes having to do with metrics.  These changes have broken core swapping.  Will attach some screenshots.
> For the screenshots that I will attach, I started Solr directly from the 6.4.0 download on Windows 7 (bin\solr start).  Then I created a "foo" core and a "bar" core, each from a different configset, using the bin\solr command.
>  * Screenshot 1: you can see the two cores in CoreAdmin.
>  * Screenshot 2: Attempting to swap the cores, an error message appears about a metric already existing for the ping handler.
>  * Screenshot 3: Clicking somewhere else and then back to CoreAdmin shows that both cores have the same name -- bar.
>  * If Solr is stopped and then started back up, the admin UI looks like screenshot 1 again -- the change that caused two cores with the same name only took place within the running Solr and did not update core.properties files.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org