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

Add Index UUID to /_stats Response #31871

Merged
merged 4 commits into from
Jul 17, 2018

Conversation

original-brownbear
Copy link
Member

* Add "uuid" field to each index's section in the `/_stats` response
* closes elastic#31791
@original-brownbear original-brownbear added the :Data Management/Indices APIs APIs to create and manage indices and templates label Jul 6, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

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

I have one question.

public void testUuidOnRootStatsIndices() throws IOException {
String uuid = createIndex("test").indexUUID();
IndicesStatsResponse rsp = client().admin().indices().prepareStats().get();
try (XContentParser parser = createParser(JsonXContent.jsonXContent, rsp.toString())) {
Copy link
Member

Choose a reason for hiding this comment

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

Instead of parsing json, could you use rsp.getIndex("test") like the other tests here do and then get the uuid from the IndexStats object returned?

Copy link
Member Author

Choose a reason for hiding this comment

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

@rjernst I did that to get coverage on https://github.com/elastic/elasticsearch/pull/31871/files#diff-eaeb35137f4e84d0f731422d07701547R176
If I don't add in the serialization roundtrip I don't get the actual response rendered do I (just checking the return of rap.getIndex("test") also passes without that line for serializing the uuid added)?

Copy link
Member

Choose a reason for hiding this comment

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

I think testing this directly (not rest) is better as a start. Testing this via rest is a different matter, and could be done through a rest api test, and/or a client test when this is added to the high level rest client.

Copy link
Member Author

Choose a reason for hiding this comment

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

@rjernst thanks for taking a look :)

so, make this test directly for now and leave the REST test for later since that API isn't in the REST client yet?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, but you could add this to an existing test under rest-api-spec/src/main/resources/rest-api-spec/test/indices.stats to ensure it exists in the rest layer.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in 2b932e3 I think/hope :)

@original-brownbear
Copy link
Member Author

@rjernst can you take another look when you have a sec? :)

@original-brownbear
Copy link
Member Author

@rjernst ping :)

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

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

Were you going to add a rest api test? LGTM otherwise.

@original-brownbear
Copy link
Member Author

@rjernst
Copy link
Member

rjernst commented Jul 16, 2018

Oops, I see it now. Looks good!

@original-brownbear
Copy link
Member Author

@rjernst thanks! => merging :)

@original-brownbear original-brownbear merged commit 4b5071f into elastic:master Jul 17, 2018
@original-brownbear original-brownbear deleted the 31791 branch July 17, 2018 04:50
martijnvg added a commit that referenced this pull request Jul 17, 2018
* es/master:
  Add Index UUID to `/_stats` Response (#31871)
  Painless: Move and Rename Several Methods in the lookup package (#32105)
  Bypass highlight query terms extraction on empty fields (#32090)
  Switch non-x-pack to new style requests (#32106)
  [Rollup] Add new capabilities endpoint for concrete rollup indices (#30401)
  Revert "[test] disable packaging tests for suse boxes"
  SQL: allow LEFT and RIGHT as function names (#32066)
  DOCS: put LIMIT 10 to the SQL query (#32065)
  [test] turn on host io cache for opensuse (#32053)
  Tweaked Elasticsearch Service links for SEO
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Jul 17, 2018
* Add "uuid" field to each index's section in the `/_stats` response
* closes elastic#31791
original-brownbear added a commit that referenced this pull request Jul 17, 2018
* Add "uuid" field to each index's section in the `/_stats` response
* closes #31791
dnhatn added a commit that referenced this pull request Jul 19, 2018
* 6.x:
  Fix rollup on date fields that don't support epoch_millis (#31890)
  Revert "Introduce a Hashing Processor (#31087)" (#32179)
  [test] use randomized runner in packaging tests (#32109)
  Painless: Fix caching bug and clean up addPainlessClass. (#32142)
  Fix BwC Tests looking for UUID Pre 6.4 (#32158) (#32169)
  Call setReferences() on custom referring tokenfilters in _analyze (#32157)
  Add more contexts to painless execute api (#30511)
  Add EC2 credential test for repository-s3 (#31918)
  Fix CP for namingConventions when gradle home has spaces (#31914)
  Convert Version to Java - clusterformation part1 (#32009)
  Fix Java 11 javadoc compile problem
  Improve docs for search preferences (#32098)
  Configurable password hashing algorithm/cost(#31234) (#32092)
  [DOCS] Update TLS on Docker for 6.3
  ESIndexLevelReplicationTestCase doesn't support replicated failures but it's good to know what they are
  Switch distribution to new style Requests (#30595)
  Build: Skip jar tests if jar disabled
  Build: Move shadow customizations into common code (#32014)
  Painless: Add PainlessClassBuilder (#32141)
  Fix accidental duplication of bwc test for script behavior
  Handle missing values in painless (#30975) (#31903)
  Build: Make additional test deps of check (#32015)
  Painless: Fix Bug with Duplicate PainlessClasses (#32110)
  Adjust translog after versionType removed in 7.0 (#32020)
  Disable C2 from using AVX-512 on JDK 10 (#32138)
  [Rollup] Add new capabilities endpoint for concrete rollup indices (#32111)
  Mute :qa:mixed-cluster indices.stats/10_index/Index - all’
  [ML] Wait for aliases in multi-node tests (#32086)
  Ensure to release translog snapshot in primary-replica resync (#32045)
  Docs: Fix missing example script quote (#32010)
  Add Index UUID to `/_stats` Response (#31871) (#32113)
  [ML] Move analyzer dependencies out of categorization config (#32123)
  [ML][DOCS] Add missing 6.3.0 release notes (#32099)
  Updates the build to gradle 4.9 (#32087)
  Update monitoring template version to 6040099 (#32088)
  Fix put mappings java API documentation (#31955)
  Add exclusion option to `keep_types` token filter (#32012)
Mpdreamz added a commit to elastic/elasticsearch-net that referenced this pull request Oct 1, 2018
russcam pushed a commit to elastic/elasticsearch-net that referenced this pull request Oct 17, 2018
russcam pushed a commit to elastic/elasticsearch-net that referenced this pull request Oct 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/Indices APIs APIs to create and manage indices and templates >enhancement v6.4.0 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose index uuid in _stats endpoint
4 participants