You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "David Lee (JIRA)" <ji...@apache.org> on 2017/05/08 15:16:04 UTC

[jira] [Comment Edited] (SOLR-10511) Unable to view replication status

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

David Lee edited comment on SOLR-10511 at 5/8/17 3:15 PM:
----------------------------------------------------------

This error appears to occur if there are failed "iterations" on one of the slaves.

There appears to be a logic issue in the replications.js code:
{code:title=replication.js}
var getIterations = function(slave) {

    var iterations = [];

    var find = function(list, date) {
        return list.filter(function(e) {return e.date == date});
    };

    for (var i in slave.indexReplicatedAtList) {
        var date = slave.indexReplicatedAtList[i];
        var iteration = {date:date, status:"replicated", latest: false};
        if (date == slave.indexReplicatedAt) {
            iteration.latest = true;
        }
        iterations.push(iteration);
    }

    for (var i in slave.replicationFailedAtList) {
        var failedDate = slave.replicationFailedAtList[i];
        var matchingIterations = find(iterations, failedDate);
        if (matchingIterations) {
            iteration = matchingIterations[0];
        } else {
            iteration = {date: failedDate, latest:false};
            iterations.push(iteration);
        }
        iteration.status = "failed";
        if (failedDate == slave.replicationFailedAt) {
            iteration.latest = true;
        }
    }
    iterations.sort(function(a,b){ return a.date> b.date;}).reverse();
    return iterations;
};
{code}

The `iteration` variable doesn't exist if there are no elements in  `slave.indexReplicatedAtList`.

This error was encountered while still working out firewall issues to allow for replication. We've since removed all solr data and re-installed and the error no longer occurs for us. I no longer see any failed iterations.


was (Author: david.lee@wisc.edu):
This error appears to occur if there are failed "iterations" on one of the slaves.

There appears to be a logic issue in the replications.js code:
```
var getIterations = function(slave) {

    var iterations = [];

    var find = function(list, date) {
        return list.filter(function(e) {return e.date == date});
    };

    for (var i in slave.indexReplicatedAtList) {
        var date = slave.indexReplicatedAtList[i];
        var iteration = {date:date, status:"replicated", latest: false};
        if (date == slave.indexReplicatedAt) {
            iteration.latest = true;
        }
        iterations.push(iteration);
    }

    for (var i in slave.replicationFailedAtList) {
        var failedDate = slave.replicationFailedAtList[i];
        var matchingIterations = find(iterations, failedDate);
        if (matchingIterations) {
            iteration = matchingIterations[0];
        } else {
            iteration = {date: failedDate, latest:false};
            iterations.push(iteration);
        }
        iteration.status = "failed";
        if (failedDate == slave.replicationFailedAt) {
            iteration.latest = true;
        }
    }
    iterations.sort(function(a,b){ return a.date> b.date;}).reverse();
    return iterations;
};
```

The `iteration` variable doesn't exist if there are no elements in  `slave.indexReplicatedAtList`.

This error was encountered while still working out firewall issues to allow for replication. We've since removed all solr data and re-installed and the error no longer occurs for us. I no longer see any failed iterations.

> Unable to view replication status
> ---------------------------------
>
>                 Key: SOLR-10511
>                 URL: https://issues.apache.org/jira/browse/SOLR-10511
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: Admin UI
>    Affects Versions: 6.5
>            Reporter: David Lee
>
> When viewing replication page none of the buttons work and no data shows up for next run, iterations, index versions, and master settings.
> Javascript Console error:  
> angular.js:11617 TypeError: Cannot set property 'status' of undefined
>     at getIterations (replication.js:114)
>     at replication.js:32
>     at angular-resource.min.js:33
>     at processQueue (angular.js:13193)
>     at angular.js:13209
>     at Scope.$eval (angular.js:14406)
>     at Scope.$digest (angular.js:14222)
>     at Scope.$apply (angular.js:14511)
>     at done (angular.js:9669)
>     at completeRequest (angular.js:9859)
> The original UI works as expected



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