Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions changelog/unreleased/SOLR-18317.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
title: Admin UI no longer sends nodes=all in standalone mode.
type: fixed
authors:
- name: Nick Shanin
links:
- name: SOLR-18317
url: https://issues.apache.org/jira/browse/SOLR-18317
9 changes: 8 additions & 1 deletion solr/webapp/web/js/angular/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,14 @@ solrAdminApp.controller('MainController', function($scope, $route, $rootScope, $

SystemV2.getNodeSystemInfo({}, function(error, data, response) {
$timeout(function() {
if (error) { ApiErrorHandler.handle(response); return; }
if (error) {
ApiErrorHandler.handle(response);
// The mode could not be determined. Treat the node as standalone so that
// pages waiting for isCloudEnabled to settle (e.g. the logging page) fall
// back to local-only behavior instead of waiting forever.
$scope.isCloudEnabled = false;
return;
}
$scope.isCloudEnabled = data.mode.match( /solrcloud/i );
$scope.usersPermissions = data.security.permissions;
$scope.isSecurityEnabled = data.security.authenticationPlugin != null;
Expand Down
25 changes: 22 additions & 3 deletions solr/webapp/web/js/angular/controllers/logging.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,28 @@ solrAdminApp.controller('LoggingController',
// broadcast the level change to every live node. The v2 NodeLoggingApis endpoint is
// single-node only until SOLR-16738 wires it up to the new V2SolrRequestBasedProxy (see the
// TODO in NodeLogging.java). Move this to LoggingV2.modifyLocalLogLevel once that lands.
Logging.setLevel({set: setString}, function(data) {
$scope.refresh();
});
var doSetLevel = function() {
var params = {set: setString};
// "nodes=all" only makes sense in SolrCloud mode; in standalone (user-managed) mode the
// request is handled locally, so the param is omitted entirely.
if ($scope.isCloudEnabled) {
params.nodes = "all";
}
Logging.setLevel(params, function(data) {
$scope.refresh();
});
};
// isCloudEnabled populates asynchronously via resetMenu(), so wait for it to settle
// before deciding whether to broadcast (same pattern as in paramsets.js).
if ($scope.isCloudEnabled === undefined) {
var unwatchCloudEnabled = $scope.$watch('isCloudEnabled', function(value) {
if (value === undefined) return;
unwatchCloudEnabled();
doSetLevel();
});
} else {
doSetLevel();
}
};

$scope.refresh();
Expand Down
10 changes: 6 additions & 4 deletions solr/webapp/web/js/angular/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,13 @@ solrAdminServices.factory('Metrics',
}])
.factory('Logging',
['$resource', function($resource) {
// This v1 factory only covers "setLevel", which needs the "nodes=all" broadcast-to-every-node
// behavior that the v2 NodeLoggingApis endpoint doesn't support yet (see SOLR-16738). Retire
// this factory once setLevel moves to LoggingV2.
// This v1 factory only covers "setLevel", which in SolrCloud mode needs the "nodes=all"
// broadcast-to-every-node behavior that the v2 NodeLoggingApis endpoint doesn't support yet
// (see SOLR-16738). The caller (LoggingLevelController) passes nodes:'all' only when
// SolrCloud is enabled; in standalone mode the param is omitted entirely. Retire this
// factory once setLevel moves to LoggingV2.
return $resource('admin/info/logging', {'wt':'json', '_':Date.now()}, {
"setLevel": {params: {nodes:'all'}}
"setLevel": {}
});
}])
.factory('Zookeeper',
Expand Down
Loading