Skip to content

Commit

Permalink
[Non-Inclusive Language] Replace master in comments, variables and fu…
Browse files Browse the repository at this point in the history
…nction names (#1778) (#1793)

As part of the meta issue opensearch-project/OpenSearch#2589 to track the plan and progress of applying inclusive naming across OpenSearch Repositories.

Issue - #1692
Signed-off-by: Manasvini B Suryanarayana <[email protected]>
(cherry picked from commit e32a259)

Co-authored-by: Manasvini B Suryanarayana <[email protected]>
  • Loading branch information
opensearch-trigger-bot[bot] and manasvinibs authored Jun 24, 2022
1 parent 53bd77b commit c87e8af
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/core/server/http/http_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export class HttpService
* Indicates if http server has configured to start listening on a configured port.
* We shouldn't start http service in two cases:
* 1. If `server.autoListen` is explicitly set to `false`.
* 2. When the process is run as dev cluster master in which case cluster manager
* 2. When the process is run as dev cluster manager.
* will fork a dedicated process where http service will be set up instead.
* @internal
* */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const getNodeId = async (
})) as ApiResponse;
/* Aggregate different cluster_ids from the OpenSearch nodes
* if all the nodes have the same cluster_id, retrieve nodes.info from _local node only
* Using _cluster/state/nodes to retrieve the cluster_id of each node from master node which is considered to be a lightweight operation
* Using _cluster/state/nodes to retrieve the cluster_id of each node from cluster manager node which is considered to be a lightweight operation
* else if the nodes have different cluster_ids then fan out the request to all nodes
* else there are no nodes in the cluster
*/
Expand Down Expand Up @@ -214,7 +214,7 @@ export const pollOpenSearchNodesVersion = ({
* Originally, Dashboards queries OpenSearch cluster to get the version info of each node and check the version compatibility with each node.
* The /nodes request could fail even one node in cluster fail to response
* For better dashboards resilience, the behaviour is changed to only query the local node when all the nodes have the same cluster_id
* Using _cluster/state/nodes to retrieve the cluster_id of each node from the master node
* Using _cluster/state/nodes to retrieve the cluster_id of each node from the cluster manager node
*/
if (optimizedHealthcheckId) {
return from(getNodeId(internalClient, optimizedHealthcheckId)).pipe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,19 @@ async function fetchLicense(opensearchClient: OpenSearchClient, local: boolean)
* Like any X-Pack related API, X-Pack must installed for this to work.
*
* In OSS we'll get a 400 response using the new opensearch client.
* @deprecated
*/
async function getLicenseFromLocalOrMaster(opensearchClient: OpenSearchClient) {
// Fetching the local license is cheaper than getting it from the master node and good enough
async function getLicenseFromLocalOrClusterManager(opensearchClient: OpenSearchClient) {
// Fetching the local license is cheaper than getting it from the cluster manager node and good enough
const { license } = await fetchLicense(opensearchClient, true).catch(async (err) => {
if (cachedLicense) {
try {
// Fallback to the master node's license info
// Fallback to the cluster manager node's license info
const response = await fetchLicense(opensearchClient, false);
return response;
} catch (masterError) {
if ([400, 404].includes(masterError.statusCode)) {
// If the master node does not have a license, we can assume there is no license
} catch (clusterManagerError) {
if ([400, 404].includes(clusterManagerError.statusCode)) {
// If the cluster manager node does not have a license, we can assume there is no license
cachedLicense = undefined;
} else {
throw err;
Expand All @@ -77,7 +78,7 @@ async function getLicenseFromLocalOrMaster(opensearchClient: OpenSearchClient) {
}

export const getLocalLicense: LicenseGetter = async (clustersDetails, { opensearchClient }) => {
const license = await getLicenseFromLocalOrMaster(opensearchClient);
const license = await getLicenseFromLocalOrClusterManager(opensearchClient);
// It should be called only with 1 cluster element in the clustersDetails array, but doing reduce just in case.
return clustersDetails.reduce((acc, { clusterUuid }) => ({ ...acc, [clusterUuid]: license }), {});
};
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ export function dateHistogram(
? getDateHistogramForLastBucketMode()
: getDateHistogramForEntireTimerangeMode();

// master

overwrite(doc, `aggs.${series.id}.meta`, {
timeField,
intervalString,
Expand Down

0 comments on commit c87e8af

Please sign in to comment.