Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace 'discovered_master' with 'discovered_cluster_manager' in 'GET Cat Health' API #2438

Merged
merged 9 commits into from
Mar 18, 2022

Conversation

tlfeng
Copy link
Collaborator

@tlfeng tlfeng commented Mar 11, 2022

Description

  • Replace 'discovered_master' with 'discovered_cluster_manager' in the table header of GET Cat Health API, to promote inclusive language.
  • Add dcm as the alias for the table header discovered_cluster_manager
  • Add discovered_master as the alias for the table header discovered_cluster_manager, for keeping compatibility when using GET _cat/nodes?v&h=discovered_master to show the specific column only.
  • Add YAML rest test

Current response of 'GET Cat Health' API:

http://localhost:9200/_cat/health?v

epoch      timestamp cluster status node.total node.data discovered_master shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1646972456 04:20:56  runTask green           1         1              true      0   0    0    0        0             0                  -                100.0%

Proposed response of 'GET Cat Health' API:

http://localhost:9200/_cat/health?v

epoch      timestamp cluster status node.total node.data discovered_cluster_manager shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1646972456 04:20:56  runTask green           1         1                       true      0   0    0    0        0             0                  -                100.0%

Explanation on the API response compatibility
Because "cat API is a human-readable interface" (https://opensearch.org/docs/latest/opensearch/rest-api/cat/index/), and are not intended for use by software program, the old name "master" is not retained.

To keep the same API response with nodes in 1.x version, users can specify "header" in the request parameter, then the API response will remain the same for nodes in both 1.x and 2.x versions.
For example:

GET _cat/health?v&h=status&discovered_master

status discovered_master
green               true

Testing

./gradlew ':rest-api-spec:yamlRestTest' \
--tests "org.opensearch.test.rest.ClientYamlTestSuiteIT" \
-Dtests.method="test {p0=cat.health/10_basic/*}"

Issues Resolved

Part of #1549

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@tlfeng tlfeng requested a review from a team as a code owner March 11, 2022 04:30
@tlfeng tlfeng changed the title Replace 'discovered_master' with 'discovered_cluster_manager' in 'GET Cat Health API' Replace 'discovered_master' with 'discovered_cluster_manager' in 'GET Cat Health' API Mar 11, 2022
@opensearch-ci-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@tlfeng tlfeng added enhancement Enhancement or improvement to existing feature or request v2.0.0 Version 2.0.0 documentation pending Tracks issues which have PRs merged but documentation changes pending >breaking Identifies a breaking change. labels Mar 11, 2022
@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 9eb177f1ff93a497f6ba9269969ca51b808ca1f7
Log 3251

Reports 3251

…th api

Signed-off-by: Tianli Feng <ftianli@amazon.com>
@tlfeng tlfeng force-pushed the replace-master-in-cat-health branch from 9eb177f to c6ba67d Compare March 11, 2022 05:37
@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure c6ba67d
Log 3254

Reports 3254

@tlfeng
Copy link
Collaborator Author

tlfeng commented Mar 11, 2022

In log 3254:

> Task :server:internalClusterTest

REPRODUCE WITH: ./gradlew ':server:internalClusterTest' --tests "org.opensearch.blocks.SimpleBlocksIT.testAddBlockWhileDeletingIndices" -Dtests.seed=EF2BD3D9D42CE8CA -Dtests.security.manager=true -Dtests.jvm.argline="-XX:TieredStopAtLevel=1 -XX:ReservedCodeCacheSize=64m" -Dtests.locale=ar-LB -Dtests.timezone=Asia/Manila -Druntime.java=17

org.opensearch.blocks.SimpleBlocksIT > testAddBlockWhileDeletingIndices FAILED
    com.carrotsearch.randomizedtesting.UncaughtExceptionError: Captured an uncaught exception in thread: Thread[id=732, name=Thread-16, state=RUNNABLE, group=TGRP-SimpleBlocksIT]

        Caused by:
        java.lang.AssertionError: 
        Expected: an instance of org.opensearch.index.IndexNotFoundException
             but: <ProcessClusterEventTimeoutException[failed to process cluster event (delete-index [[glwvxoqqaa/i2W7ssjoTUeQ4iwAk6ARBQ]]) within 30s]> is a org.opensearch.cluster.metadata.ProcessClusterEventTimeoutException
            at __randomizedtesting.SeedInfo.seed([EF2BD3D9D42CE8CA]:0)
            at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:18)
            at org.junit.Assert.assertThat(Assert.java:964)
            at org.junit.Assert.assertThat(Assert.java:930)
            at org.opensearch.blocks.SimpleBlocksIT.lambda$testAddBlockWhileDeletingIndices$14(SimpleBlocksIT.java:483)
            at org.opensearch.blocks.SimpleBlocksIT.lambda$testAddBlockWhileDeletingIndices$15(SimpleBlocksIT.java:498)

    com.carrotsearch.randomizedtesting.UncaughtExceptionError: Captured an uncaught exception in thread: Thread[id=734, name=Thread-18, state=RUNNABLE, group=TGRP-SimpleBlocksIT]

        Caused by:
        java.lang.AssertionError: 
        Expected: an instance of org.opensearch.index.IndexNotFoundException
             but: <ProcessClusterEventTimeoutException[failed to process cluster event (delete-index [[pfoumeuzfk/SuaajRD-SWqAsgyGa_h31Q]]) within 30s]> is a org.opensearch.cluster.metadata.ProcessClusterEventTimeoutException
            at __randomizedtesting.SeedInfo.seed([EF2BD3D9D42CE8CA]:0)
            at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:18)
            at org.junit.Assert.assertThat(Assert.java:964)
            at org.junit.Assert.assertThat(Assert.java:930)
            at org.opensearch.blocks.SimpleBlocksIT.lambda$testAddBlockWhileDeletingIndices$14(SimpleBlocksIT.java:483)
            at org.opensearch.blocks.SimpleBlocksIT.lambda$testAddBlockWhileDeletingIndices$15(SimpleBlocksIT.java:498)

It's not reproducible locally.

@dblock
Copy link
Member

dblock commented Mar 11, 2022

start gradle check

@dblock dblock requested a review from kartg March 11, 2022 19:00
@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure c6ba67d
Log 3267

Reports 3267

@tlfeng
Copy link
Collaborator Author

tlfeng commented Mar 11, 2022

In log 3267:

> Task :qa:mixed-cluster:v1.3.0#mixedClusterTest

REPRODUCE WITH: ./gradlew ':qa:mixed-cluster:v1.3.0#mixedClusterTest' --tests "org.opensearch.backwards.MixedClusterClientYamlTestSuiteIT" -Dtests.method="test {p0=indices.get_field_mapping/20_missing_field/Return empty object if field doesn't exist, but index does}" -Dtests.seed=2E22A45097655A52 -Dtests.security.manager=true -Dtests.jvm.argline="-XX:TieredStopAtLevel=1 -XX:ReservedCodeCacheSize=64m" -Dtests.locale=pl -Dtests.timezone=AGT -Druntime.java=17

org.opensearch.backwards.MixedClusterClientYamlTestSuiteIT > test {p0=indices.get_field_mapping/20_missing_field/Return empty object if field doesn't exist, but index does} FAILED
    java.lang.AssertionError: Failure at [indices.get_field_mapping/20_missing_field:13]: expected [2xx] status code but api [indices.get_field_mapping] returned [404 Not Found] [{}]
        at __randomizedtesting.SeedInfo.seed([2E22A45097655A52:A6769B8A399937AA]:0)
        at org.opensearch.test.rest.yaml.OpenSearchClientYamlSuiteTestCase.executeSection(OpenSearchClientYamlSuiteTestCase.java:442)
        at org.opensearch.test.rest.yaml.OpenSearchClientYamlSuiteTestCase.test(OpenSearchClientYamlSuiteTestCase.java:415)
...

Same test failure as issue #2440, but running on a different version of OpenSearch (v1.3.0). It can't be reproduced by the command ./gradlew ':qa:mixed-cluster:v1.3.0#mixedClusterTest' --tests "org.opensearch.backwards.MixedClusterClientYamlTestSuiteIT" -Dtests.method="test {p0=indices.get_field_mapping/20_missing_field/Return empty object if field doesn't exist, but index does}" -Dtests.seed=2E22A45097655A52

Signed-off-by: Tianli Feng <ftianli@amazon.com>
@tlfeng tlfeng force-pushed the replace-master-in-cat-health branch from 336231f to f9e741f Compare March 13, 2022 06:35
…ster_manager' for compatibility

Signed-off-by: Tianli Feng <ftianli@amazon.com>
@tlfeng tlfeng force-pushed the replace-master-in-cat-health branch from f9e741f to 49f5a9d Compare March 13, 2022 06:37
@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 336231fd56670994df6337148c69066f4bb0655a
Log 3306

Reports 3306

@tlfeng
Copy link
Collaborator Author

tlfeng commented Mar 13, 2022

In log 3306:

> Task :qa:mixed-cluster:v1.3.0#mixedClusterTest

REPRODUCE WITH: ./gradlew ':qa:mixed-cluster:v1.3.0#mixedClusterTest' --tests "org.opensearch.backwards.MixedClusterClientYamlTestSuiteIT" -Dtests.method="test {p0=cat.health/10_basic/Help}" -Dtests.seed=C90F9A5215A51187 -Dtests.security.manager=true -Dtests.jvm.argline="-XX:TieredStopAtLevel=1 -XX:ReservedCodeCacheSize=64m" -Dtests.locale=es-UY -Dtests.timezone=Asia/Katmandu -Druntime.java=17

org.opensearch.backwards.MixedClusterClientYamlTestSuiteIT > test {p0=cat.health/10_basic/Help} FAILED
    java.lang.AssertionError: Failure at [cat.health/10_basic:10]: field [$body] was expected to match the provided regex but didn't
    Expected: ^  epoch         .+ \n
        timestamp     .+ \n
        cluster       .+ \n
        status        .+ \n
        node.total    .+ \n
        node.data     .+ \n
        discovered_master .+ \n
        shards        .+ \n
        pri           .+ \n
        relo          .+ \n
        init          .+ \n
        unassign      .+ \n
        pending_tasks .+ \n
        max_task_wait_time .+ \n
        active_shards_percent .+ \n

    $
         but: was "epoch                      | t,time                                   | seconds since 1970-01-01 00:00:00   \ntimestamp                  | ts,hms,hhmmss                            | time in HH:MM:SS                    \ncluster                    | cl                                       | cluster name                        \nstatus                     | st                                       | health status                       \nnode.total                 | nt,nodeTotal                             | total number of nodes               \nnode.data                  | nd,nodeData                              | number of nodes that can store data \ndiscovered_cluster_manager | dcm,dm,discovered_master                 | cluster manager is discovered or not\nshards                     | t,sh,shards.total,shardsTotal            | total number of shards              \npri                        | p,shards.primary,shardsPrimary 
...

This is reproducible. The API response is 2.0.0 version, for a cluster with "minimum OpenSearch version [1.3.0], master version [1.3.0]".

Suite: Test class org.opensearch.backwards.MixedClusterClientYamlTestSuiteIT
  1> [2022-03-14T07:21:56,216][INFO ][o.o.b.MixedClusterClientYamlTestSuiteIT] [test] [p0=cat.health/10_basic/Help] before test
  1> [2022-03-14T07:21:56,273][INFO ][o.o.b.MixedClusterClientYamlTestSuiteIT] [test] initializing REST clients against [http://[::1]:35989, http://127.0.0.1:39105, http://[::1]:40329, http://127.0.0.1:40685, http://[::1]:45253, http://127.0.0.1:41003, http://[::1]:37375, http://127.0.0.1:34907]
  1> [2022-03-14T07:21:56,615][INFO ][o.o.b.MixedClusterClientYamlTestSuiteIT] [test] initializing client, minimum es version [1.3.0], master version, [1.3.0], hosts [http://[::1]:35989, http://127.0.0.1:39105, http://[::1]:40329, http://127.0.0.1:40685, http://[::1]:45253, http://127.0.0.1:41003, http://[::1]:37375, http://127.0.0.1:34907]
  1> [2022-03-14T07:21:56,628][INFO ][o.o.b.MixedClusterClientYamlTestSuiteIT] [test] Stash dump on test failure [{
  1>   "stash" : {
  1>     "body" : "epoch                      | t,time                                   | seconds since 1970-01-01 00:00:00   
  1> timestamp                  | ts,hms,hhmmss                            | time in HH:MM:SS                    
  1> cluster                    | cl                                       | cluster name                        
  1> status                     | st                                       | health status                       
  1> node.total                 | nt,nodeTotal                             | total number of nodes               
  1> node.data                  | nd,nodeData                              | number of nodes that can store data 
  1> discovered_cluster_manager | dcm,dm,discovered_master                 | cluster manager is discovered or not
...

@tlfeng tlfeng marked this pull request as draft March 13, 2022 07:24
@opensearch-ci-bot
Copy link
Collaborator

✅   Gradle Check success f9e741ff6ee4d4952a54475fbb974b15a8a568f6
Log 3307

Reports 3307

@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 49f5a9d
Log 3308

Reports 3308

Signed-off-by: Tianli Feng <ftianli@amazon.com>
@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 9575e62
Log 3312

Reports 3312

@tlfeng
Copy link
Collaborator Author

tlfeng commented Mar 13, 2022

In log 3312:

> Task :qa:mixed-cluster:v1.4.0#mixedClusterTest

REPRODUCE WITH: ./gradlew ':qa:mixed-cluster:v1.4.0#mixedClusterTest' --tests "org.opensearch.backwards.MixedClusterClientYamlTestSuiteIT" -Dtests.method="test {p0=cat.health/10_basic/Help}" -Dtests.seed=81BC6F0247CA4A37 -Dtests.security.manager=true -Dtests.jvm.argline="-XX:TieredStopAtLevel=1 -XX:ReservedCodeCacheSize=64m" -Dtests.locale=ru-RU -Dtests.timezone=Pacific/Kwajalein -Druntime.java=17

org.opensearch.backwards.MixedClusterClientYamlTestSuiteIT > test {p0=cat.health/10_basic/Help} FAILED
    java.lang.AssertionError: Failure at [cat.health/10_basic:10]: field [$body] was expected to match the provided regex but didn't
    Expected: ^  epoch         .+ \n
        timestamp     .+ \n
        cluster       .+ \n
        status        .+ \n
        node.total    .+ \n
        node.data     .+ \n
        discovered_master .+ \n
        shards        .+ \n
        pri           .+ \n
        relo          .+ \n
        init          .+ \n
        unassign      .+ \n
        pending_tasks .+ \n
        max_task_wait_time .+ \n
        active_shards_percent .+ \n

    $
         but: was "epoch                      | t,time                                   | seconds since 1970-01-01 00:00:00   \ntimestamp                  | ts,hms,hhmmss                            | time in HH:MM:SS                    \ncluster                    | cl                                       | cluster name                        \nstatus                     | st                                       | health status                       \nnode.total                 | nt,nodeTotal                             | total number of nodes               \nnode.data                  | nd,nodeData                              | number of nodes that can store data \ndiscovered_cluster_manager | dcm,dm,discovered_master                 | cluster manager is discovered or not\nshards                     | t,sh,shards.total,shardsTotal            | total number of shards              \npri                        | p,shards.primary,shardsPrimary           | number of primary shards            \nrelo                       | r,shards.relocating,shardsRelocating     | number of relocating nodes          \ninit                       | i,shards.initializing,shardsInitializing | number of initializing nodes        \nunassign                   | u,shards.unassigned,shardsUnassigned     | number of unassigned shards         \npending_tasks              | pt,pendingTasks                          | number of pending tasks             \nmax_task_wait_time         | mtwt,maxTaskWaitTime                     | wait time of longest task pending   \nactive_shards_percent      | asp,activeShardsPercent                  | active number of shards in percent  \n"
REPRODUCE WITH: ./gradlew ':server:internalClusterTest' --tests "org.opensearch.gateway.RecoveryFromGatewayIT.testReuseInFileBasedPeerRecovery" -Dtests.seed=81BC6F0247CA4A37 -Dtests.security.manager=true -Dtests.jvm.argline="-XX:TieredStopAtLevel=1 -XX:ReservedCodeCacheSize=64m" -Dtests.locale=is -Dtests.timezone=Europe/Skopje -Druntime.java=17

org.opensearch.gateway.RecoveryFromGatewayIT > testReuseInFileBasedPeerRecovery FAILED
    java.lang.AssertionError: shard [test][0] on node [node_t1] has pending operations:
     --> RetentionLeaseBackgroundSyncAction.Request{retentionLeases=RetentionLeases{primaryTerm=1, version=1547, leases={peer_recovery/oyPwOGGkQNW8Y4rF2xKeWQ=RetentionLease{id='peer_recovery/oyPwOGGkQNW8Y4rF2xKeWQ', retainingSequenceNumber=713, timestamp=1647158126249, source='peer recovery'}, peer_recovery/twOZnWW1QNqDa4-ktwGYig=RetentionLease{id='peer_recovery/twOZnWW1QNqDa4-ktwGYig', retainingSequenceNumber=713, timestamp=1647158126249, source='peer recovery'}}}, shardId=[test][0], timeout=1m, index='test', waitForActiveShards=0}
    	at org.opensearch.index.shard.IndexShardOperationPermits.acquire(IndexShardOperationPermits.java:248)
    	at org.opensearch.index.shard.IndexShard.acquirePrimaryOperationPermit(IndexShard.java:3130)

It's reported in issue #1746

Signed-off-by: Tianli Feng <ftianli@amazon.com>
@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 2d32ac0
Log 3322

Reports 3322

Tianli Feng added 2 commits March 13, 2022 20:59
Signed-off-by: Tianli Feng <ftianli@amazon.com>
Signed-off-by: Tianli Feng <ftianli@amazon.com>
@tlfeng tlfeng force-pushed the replace-master-in-cat-health branch from 21c4800 to 9486914 Compare March 14, 2022 04:03
@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure eb3f1ed
Log 3323

Reports 3323

@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 21c480000b050082dd3741119b9a3cbc270ba7d2
Log 3324

Reports 3324

@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 9486914
Log 3325

Reports 3325

@tlfeng
Copy link
Collaborator Author

tlfeng commented Mar 14, 2022

In log 3325:
This is caused by discovered_cluster_manager changed back to discovered_master by my mistake.

> Task :rest-api-spec:yamlRestTest

REPRODUCE WITH: ./gradlew ':rest-api-spec:yamlRestTest' --tests "org.opensearch.test.rest.ClientYamlTestSuiteIT" -Dtests.method="test {p0=cat.health/10_basic/Help}" -Dtests.seed=509C299162A8ADE4 -Dtests.security.manager=true -Dtests.jvm.argline="-XX:TieredStopAtLevel=1 -XX:ReservedCodeCacheSize=64m" -Dtests.locale=he -Dtests.timezone=America/St_Johns -Druntime.java=17

org.opensearch.test.rest.ClientYamlTestSuiteIT > test {p0=cat.health/10_basic/Help} FAILED
    java.lang.AssertionError: Failure at [cat.health/10_basic:47]: field [$body] was expected to match the provided regex but didn't
    Expected: ^  epoch         .+ \n
        timestamp     .+ \n
        cluster       .+ \n
        status        .+ \n
        node.total    .+ \n
        node.data     .+ \n
        discovered_master .+ \n
        shards        .+ \n
        pri           .+ \n
        relo          .+ \n
        init          .+ \n
        unassign      .+ \n
        pending_tasks .+ \n
        max_task_wait_time .+ \n
        active_shards_percent .+ \n

    $
         but: was "epoch                      | t,time                                   | seconds since 1970-01-01 00:00:00   \ntimestamp                  | ts,hms,hhmmss                            | time in HH:MM:SS                    \ncluster                    | cl                                       | cluster name                        \nstatus                     | st                                       | health status                       \nnode.total                 | nt,nodeTotal                             | total number of nodes               \nnode.data                  | nd,nodeData                              | number of nodes that can store data \ndiscovered_cluster_manager | dcm,dm,discovered_master         
...
> Task :qa:smoke-test-multinode:integTest

REPRODUCE WITH: ./gradlew ':qa:smoke-test-multinode:integTest' --tests "org.opensearch.smoketest.SmokeTestMultiNodeClientYamlTestSuiteIT" -Dtests.method="test {yaml=cat.health/10_basic/Help}" -Dtests.seed=509C299162A8ADE4 -Dtests.security.manager=true -Dtests.jvm.argline="-XX:TieredStopAtLevel=1 -XX:ReservedCodeCacheSize=64m" -Dtests.locale=en-PH -Dtests.timezone=Etc/GMT-0 -Druntime.java=17

org.opensearch.smoketest.SmokeTestMultiNodeClientYamlTestSuiteIT > test {yaml=cat.health/10_basic/Help} FAILED
    java.lang.AssertionError: Failure at [cat.health/10_basic:47]: field [$body] was expected to match the provided regex but didn't
    Expected: ^  epoch         .+ \n
        timestamp     .+ \n
        cluster       .+ \n
        status        .+ \n
        node.total    .+ \n
        node.data     .+ \n
        discovered_master .+ \n

Tianli Feng added 2 commits March 13, 2022 21:53
Signed-off-by: Tianli Feng <ftianli@amazon.com>
Signed-off-by: Tianli Feng <ftianli@amazon.com>
@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure b89a754
Log 3333

Reports 3333

@tlfeng
Copy link
Collaborator Author

tlfeng commented Mar 14, 2022

In log 3333:
Seems not related to the code changes.

> Task :server:internalClusterTest

REPRODUCE WITH: ./gradlew ':server:internalClusterTest' --tests "org.opensearch.indices.state.CloseWhileRelocatingShardsIT.testCloseWhileRelocatingShards" -Dtests.seed=25C5B40A42AAB4CC -Dtests.security.manager=true -Dtests.jvm.argline="-XX:TieredStopAtLevel=1 -XX:ReservedCodeCacheSize=64m" -Dtests.locale=hu-HU -Dtests.timezone=Africa/Addis_Ababa -Druntime.java=17

org.opensearch.indices.state.CloseWhileRelocatingShardsIT > testCloseWhileRelocatingShards FAILED
    java.lang.Exception: Test abandoned because suite timeout was reached.
        at __randomizedtesting.SeedInfo.seed([25C5B40A42AAB4CC]:0)

... (lots of test failures)

        Caused by:
        java.lang.OutOfMemoryError: Java heap space
Tests with failures:
 - org.opensearch.indices.state.CloseWhileRelocatingShardsIT.testCloseWhileRelocatingShards
 - org.opensearch.indices.state.CloseWhileRelocatingShardsIT.classMethod

3637 tests completed, 1038 failed, 48 skipped

@tlfeng
Copy link
Collaborator Author

tlfeng commented Mar 14, 2022

start gradle check

@tlfeng tlfeng marked this pull request as ready for review March 14, 2022 05:57
@opensearch-ci-bot
Copy link
Collaborator

✅   Gradle Check success b89a754
Log 3335

Reports 3335

@tlfeng tlfeng removed the request for review from kartg March 16, 2022 02:35
@@ -88,7 +88,12 @@ protected Table getTableWithHeader(final RestRequest request) {
t.addCell("status", "alias:st;desc:health status");
t.addCell("node.total", "alias:nt,nodeTotal;text-align:right;desc:total number of nodes");
t.addCell("node.data", "alias:nd,nodeData;text-align:right;desc:number of nodes that can store data");
t.addCell("discovered_master", "alias:dm;text-align:right;desc:discovered master");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the Cluster Health API - #2437 - we chose to add a "cluster_manager" field alongside the "master" one, but here we're replacing "master" with "cluster_manager". Why the difference in approach?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

D'oh, should've read the PR description more carefully 😅

To answer my own question - #2437 is adding a new field in the response, so we cannot replace it in-line. In this PR, the change affects the human-readable table header in the output, which we hardly expect to be parsed by code.

Feel free to ignore my question above 😄

Copy link
Collaborator Author

@tlfeng tlfeng Mar 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kartg, I really appreciate your careful attitude, to put the explanation in detail.
It's also my negligence that I didn't explain more in this PR description, after add more description in anther PR with the same concern: #2441 (comment) .
I will update in this PR description to encourage users who wants to use the same API request to parse the response of CAT Health in 2.x nodes, to filter output by specifying table header, such as GET _cat/health?v&h=discovered_master

Copy link
Contributor

@Poojita-Raj Poojita-Raj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@tlfeng tlfeng merged commit ee04885 into opensearch-project:main Mar 18, 2022
@tlfeng tlfeng deleted the replace-master-in-cat-health branch March 18, 2022 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>breaking Identifies a breaking change. documentation pending Tracks issues which have PRs merged but documentation changes pending enhancement Enhancement or improvement to existing feature or request v2.0.0 Version 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants