Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

Fix the admin UI green core-size graph on nodes screen (#1963)

Jan Høydahld58815694748
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index df10be97fc9..b58374160ce 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -220,6 +220,8 @@ Bug Fixes
* SOLR-16997: OTEL configurator NPE when SOLR_HOST not set (janhoy)
+* PR#1963: Fix the admin UI green core-size graph on nodes screen (janhoy)
+
* SOLR-16980: Connect to SOLR standalone with basic authentication (Alex Deparvu)
* SOLR-16992: Non-reproducible StreamingTest failures -- suggests CloudSolrStream concurency race condition (Alex Deparvu, hossman)
diff --git a/solr/webapp/web/js/angular/controllers/cloud.js b/solr/webapp/web/js/angular/controllers/cloud.js
index ece27cb657a..70b89611614 100644
--- a/solr/webapp/web/js/angular/controllers/cloud.js
+++ b/solr/webapp/web/js/angular/controllers/cloud.js
@@ -423,9 +423,10 @@ var nodesSubController = function($scope, Collections, System, Metrics) {
// These are the cores we _expect_ to find on this node according to the CLUSTERSTATUS
var cores = nodes[node]['cores'];
var indexSizeTotal = 0;
+ var indexSizeMax = 0;
var docsTotal = 0;
var graphData = [];
- for (coreId in cores) {
+ for (let coreId in cores) {
var core = cores[coreId];
if (core['shard_state'] !== 'active' || core['state'] !== 'active') {
// If core state is not active, display the real state, or if shard is inactive, display that
@@ -440,7 +441,8 @@ var nodesSubController = function($scope, Collections, System, Metrics) {
size = (typeof size !== 'undefined') ? size : 0;
core['sizeInBytes'] = size;
core['size'] = bytesToSize(size);
- indexSizeTotal += size;
+ indexSizeTotal = indexSizeTotal + size;
+ indexSizeMax = size > indexSizeMax ? size : indexSizeMax;
var numDocs = coreMetric['SEARCHER.searcher.numDocs'];
numDocs = (typeof numDocs !== 'undefined') ? numDocs : 0;
core['numDocs'] = numDocs;
@@ -455,12 +457,14 @@ var nodesSubController = function($scope, Collections, System, Metrics) {
core['warmupTime'] = warmupTime;
docsTotal += core['numDocs'];
}
-
+ }
+ for (let coreId in cores) {
+ var core = cores[coreId];
var graphObj = {};
graphObj['label'] = core['label'];
graphObj['size'] = core['sizeInBytes'];
graphObj['sizeHuman'] = core['size'];
- graphObj['pct'] = (core['sizeInBytes'] / indexSizeTotal) * 100;
+ graphObj['pct'] = (core['sizeInBytes'] / indexSizeMax) * 100;
graphData.push(graphObj);
}
if (cores) {