# Can we get 'Checksum' of an Index

**URL:** <https://discuss.elastic.co/t/can-we-get-checksum-of-an-index/217933>\
**Category:** Elasticsearch\
**Created:** [February 5, 2020, 9:02am UTC](https://discuss.elastic.co/t/can-we-get-checksum-of-an-index/217933 "2020-02-05T09:02:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prashant\_Sharma1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prashant_sharma1/32/62102_2.png) [@Prashant\_Sharma1](https://discuss.elastic.co/u/Prashant_Sharma1)\
**Post date:** [February 5, 2020, 9:02am UTC](https://discuss.elastic.co/t/can-we-get-checksum-of-an-index/217933/1 "2020-02-05T09:02:45Z")

</div>

In an upgrade Scenario where I need to verify data in ES Db after upgrade , Is there any API by which I can get Checksum of indexes for an ES Db ....

---

<div class="post-metadata">

**Author:** ![Armin\_Braun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/armin_braun/32/20092_2.png) [@Armin\_Braun](https://discuss.elastic.co/u/Armin_Braun)\
**Post date:** [February 5, 2020, 12:10pm UTC](https://discuss.elastic.co/t/can-we-get-checksum-of-an-index/217933/2 "2020-02-05T12:10:13Z")

</div>

Elasticsearch does not ship with functionality to hash the full contents of an index that I can think of.  
Note two things though:

1. ES's underlying storage layer based on Lucene does verify the consistency of index files automatically as it use them, so any physical data file corruption will be detected anyway.
2. When you upgrade ES, the index data (handled by Lucene) itself is not upgraded or transformed in any way so it will not be modified because of an ES version upgrade. This is the reason you will have to reindex some indices if you want to continue using them after a major version upgrade as documented [here](https://www.elastic.co/guide/en/elasticsearch/reference/7.5/reindex-upgrade.html).

=\> I don't think there is a use-case for hashing index contents to verify consistency after upgrade as that consistency is ensured by other means.

---

<div class="post-metadata">

**Author:** ![Prashant\_Sharma1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prashant_sharma1/32/62102_2.png) [@Prashant\_Sharma1](https://discuss.elastic.co/u/Prashant_Sharma1)\
**Post date:** [February 5, 2020, 4:57pm UTC](https://discuss.elastic.co/t/can-we-get-checksum-of-an-index/217933/3 "2020-02-05T16:57:23Z")

</div>

Thanks for replying .  
Just one more question .. May I know " that consistency is ensured by other means" --\> what are those means can you highlight some of them .. are they native to ES upgrade handling or even we can also try those means to verify .... because I couldn't get any way to verify the same ..

Thanks In Advance

---

<div class="post-metadata">

**Author:** ![Armin\_Braun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/armin_braun/32/20092_2.png) [@Armin\_Braun](https://discuss.elastic.co/u/Armin_Braun)\
**Post date:** [February 5, 2020, 5:19pm UTC](https://discuss.elastic.co/t/can-we-get-checksum-of-an-index/217933/4 "2020-02-05T17:19:00Z")

</div>

> [@Prashant\_Sharma1](#):
>
> what are those means can you highlight some of them

Sure, there's nothing special there. As I mentioned:

1. The upgrade doesn't really modify the data files in the first place so there's pretty much no risk to corrupting the index data silently.
2. The storage layer itself writes a checksum in the footer of all the data files and checks that checksum's validate during normal ES operation in a few spots. If files got corrupted for whatever reason, then those checksums will be off and the affected shards be failed, again preventing silent corruption.

Hope that helps 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 4, 2020, 5:19pm UTC](https://discuss.elastic.co/t/can-we-get-checksum-of-an-index/217933/5 "2020-03-04T17:19:04Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
