# Flushing small index is corrupting index file

**URL:** <https://discuss.elastic.co/t/flushing-small-index-is-corrupting-index-file/8583>\
**Category:** Elasticsearch\
**Created:** [July 31, 2012, 3:41pm UTC](https://discuss.elastic.co/t/flushing-small-index-is-corrupting-index-file/8583 "2012-07-31T15:41:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vinicius\_Carvalho](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vinicius_carvalho/32/770_2.png) [@Vinicius\_Carvalho](https://discuss.elastic.co/u/Vinicius_Carvalho)\
**Post date:** [July 31, 2012, 3:41pm UTC](https://discuss.elastic.co/t/flushing-small-index-is-corrupting-index-file/8583/1 "2012-07-31T15:41:02Z")

</div>

Well, this is odd. I'm doing some testing, so I created an index, and added  
one doc to it. Later I used Luke to read it (get some analytics on the  
fields and ngrams). But luke could not read, I assumed since there was only  
one record it probably was not even on the disk yet, so I did a flush on  
the index, and after that, luke or even ES after a restart could not read  
the index anymore: read past EOF errors:

The gist of the commands: [https://gist.github.com/3217914](https://gist.github.com/3217914)

Is this expected?

Regards

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [July 31, 2012, 8:54pm UTC](https://discuss.elastic.co/t/flushing-small-index-is-corrupting-index-file/8583/2 "2012-07-31T20:54:39Z")

</div>

I have received the same errors when attempting to do the same steps.  
For me, closing and re-opening makes the index load in Luke. I would  
assume calling optimize/refresh would have the same benefit. But flush  
does have issues.

Cheers,

Ivan

On Tue, Jul 31, 2012 at 8:41 AM, Vinicius Carvalho  
[viniciusccarvalho@gmail.com](mailto:viniciusccarvalho@gmail.com) wrote:

> Well, this is odd. I'm doing some testing, so I created an index, and added  
> one doc to it. Later I used Luke to read it (get some analytics on the  
> fields and ngrams). But luke could not read, I assumed since there was only  
> one record it probably was not even on the disk yet, so I did a flush on the  
> index, and after that, luke or even ES after a restart could not read the  
> index anymore: read past EOF errors:
> 
> The gist of the commands: [ES corrupt index example · GitHub](https://gist.github.com/3217914)
> 
> Is this expected?
> 
> Regards

---

<div class="post-metadata">

**Author:** ![Vinicius\_Carvalho](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vinicius_carvalho/32/770_2.png) [@Vinicius\_Carvalho](https://discuss.elastic.co/u/Vinicius_Carvalho)\
**Post date:** [July 31, 2012, 9:03pm UTC](https://discuss.elastic.co/t/flushing-small-index-is-corrupting-index-file/8583/3 "2012-07-31T21:03:44Z")

</div>

Well, I tried to re-open, refresh, optimize, nothing works. Index is gone ☹

When I restart ES it complains about not being able to open the index.

I managed to get my tests working, by creating the index, adding 1  
document, shutting down ES, starting it again, and with that I was able to  
load the results from luke.

Kinda odd, but I really don't care, as I don't expect to have such small  
index 😃

Cheers

On Tuesday, July 31, 2012 4:54:39 PM UTC-4, Ivan Brusic wrote:

> I have received the same errors when attempting to do the same steps.  
> For me, closing and re-opening makes the index load in Luke. I would  
> assume calling optimize/refresh would have the same benefit. But flush  
> does have issues.
> 
> Cheers,
> 
> Ivan
> 
> On Tue, Jul 31, 2012 at 8:41 AM, Vinicius Carvalho  
> [viniciusccarvalho@gmail.com](mailto:viniciusccarvalho@gmail.com) wrote:
> 
> > Well, this is odd. I'm doing some testing, so I created an index, and  
> > added  
> > one doc to it. Later I used Luke to read it (get some analytics on the  
> > fields and ngrams). But luke could not read, I assumed since there was  
> > only  
> > one record it probably was not even on the disk yet, so I did a flush on  
> > the  
> > index, and after that, luke or even ES after a restart could not read  
> > the  
> > index anymore: read past EOF errors:
> > 
> > The gist of the commands: [ES corrupt index example · GitHub](https://gist.github.com/3217914)
> > 
> > Is this expected?
> > 
> > Regards

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [July 31, 2012, 10:23pm UTC](https://discuss.elastic.co/t/flushing-small-index-is-corrupting-index-file/8583/4 "2012-07-31T22:23:09Z")

</div>

I should have explain myself better. My scenario is identical to  
yours. Executing a flush (via BigDesk) renders the index useless. If I  
want to test via Luke, I simple close and re-open the index, no need  
to restart Elasticsearch. Always wanted to open an issue, but I wanted  
to come up with some better test cases and I never have.

--  
Ivan

On Tue, Jul 31, 2012 at 2:03 PM, Vinicius Carvalho  
[viniciusccarvalho@gmail.com](mailto:viniciusccarvalho@gmail.com) wrote:

> Well, I tried to re-open, refresh, optimize, nothing works. Index is gone ☹
> 
> When I restart ES it complains about not being able to open the index.
> 
> I managed to get my tests working, by creating the index, adding 1 document,  
> shutting down ES, starting it again, and with that I was able to load the  
> results from luke.
> 
> Kinda odd, but I really don't care, as I don't expect to have such small  
> index 😃
> 
> Cheers
> 
> On Tuesday, July 31, 2012 4:54:39 PM UTC-4, Ivan Brusic wrote:
> 
> > I have received the same errors when attempting to do the same steps.  
> > For me, closing and re-opening makes the index load in Luke. I would  
> > assume calling optimize/refresh would have the same benefit. But flush  
> > does have issues.
> > 
> > Cheers,
> > 
> > Ivan
> > 
> > On Tue, Jul 31, 2012 at 8:41 AM, Vinicius Carvalho  
> > [viniciusccarvalho@gmail.com](mailto:viniciusccarvalho@gmail.com) wrote:
> > 
> > > Well, this is odd. I'm doing some testing, so I created an index, and  
> > > added  
> > > one doc to it. Later I used Luke to read it (get some analytics on the  
> > > fields and ngrams). But luke could not read, I assumed since there was  
> > > only  
> > > one record it probably was not even on the disk yet, so I did a flush on  
> > > the  
> > > index, and after that, luke or even ES after a restart could not read  
> > > the  
> > > index anymore: read past EOF errors:
> > > 
> > > The gist of the commands: [ES corrupt index example · GitHub](https://gist.github.com/3217914)
> > > 
> > > Is this expected?
> > > 
> > > Regards

---

<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:** [July 6, 2017, 3:18am UTC](https://discuss.elastic.co/t/flushing-small-index-is-corrupting-index-file/8583/5 "2017-07-06T03:18:12Z")

</div>


