apache / apache/lucene

IndexFileDeleter AssertionError in presence of *_upgraded.si files [LUCENE-5492]

Open
#6,555 9 comments 0 reactions 1 assignee Claimed by @mikemccand View on GitHub
affects-version:4.7 legacy-jira-priority:Major type:bug
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

When calling IndexWriter.deleteUnusedFiles against an index that contains 3.x segments, i am seeing the following exception:

```Java
java.lang.AssertionError: failAndDumpStackJunitStatment: RefCount is 0 pre-decrement for file "_0_upgraded.si"
at org.apache.lucene.index.IndexFileDeleter$RefCount.DecRef(IndexFileDeleter.java:630)
at org.apache.lucene.index.IndexFileDeleter.decRef(IndexFileDeleter.java:514)
at org.apache.lucene.index.IndexFileDeleter.deleteCommits(IndexFileDeleter.java:286)
at org.apache.lucene.index.IndexFileDeleter.revisitPolicy(IndexFileDeleter.java:393)
at org.apache.lucene.index.IndexWriter.deleteUnusedFiles(IndexWriter.java:4617)
```

I believe this is caused by IndexFileDeleter not being aware of the Lucene3x Segment Infos Format (notably the _upgraded.si files created to "upgrade" an old index)

This is new in 4.7 and did not occur in 4.6.1

Still trying to track down a workaround/fix

---
Migrated from [LUCENE-5492](https://issues.apache.org/jira/browse/LUCENE-5492) by Tim Smith, updated Sep 11 2014
Linked issues:
- #7002

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.