opensearch-project / opensearch-project/opensearch-java

[BUG] `OpenSearchNodesClient#info` is unable to parse custom roles

Open
#893 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
165
Forks
250
Avg merge
1d 18h
Merged PRs (30d)
26

Description

What is the bug?

When a node exists in the cluster having a (custom) role which is not listed in NodeRole, executing OpenSearchClient#nodes#info fails with a JsonParsingException: Invalid enum 'customrole'.

How can one reproduce the bug?

Start a node in the cluster with a custom role.

What is the expected behavior?

OpenSearchClient#nodes#info should succeed, either stripping the custom role from the list of roles of that node, or returning a collection of strings instead of enums.

What is your host/environment?

Operating system, version.

Do you have any screenshots?

If applicable, add screenshots to help explain your problem.

Do you have any additional context?

Add any other context about the problem.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with java-client/src/main/java/org/opensearch/client/opensearch/_types/NodeRole.java and trace the OpenSearchClient#nodes#info response parsing. Reproduce the failure with a cluster node using a custom role, then verify that nodes info succeeds and handles the unlisted role according to the chosen expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.