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
Only iterate the files that we recovered from the commit #9761
Conversation
LGTM |
LGTM do we want a test that injects evil files? |
that one is going be available at the lucene release next to you soon |
Today we use Directory#listAll() to find all the files we recovered. Yet, this is not accurate since there might be leftovers etc. It's better to only iterate over the known files from the segments info that we recovered.
a8a5aad
to
50a56b6
Compare
*/ | ||
public static Iterable<String> files(SegmentInfos infos) throws IOException { | ||
final List<Collection<String>> list = new ArrayList<>(); | ||
for (SegmentCommitInfo info : infos) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this include the segments file? (e.g. call infos.files() instead) The old listAll() would have included it too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pushed a fix for this here e8f276b
Today we use Directory#listAll() to find all the files we recovered. Yet,
this is not accurate since there might be leftovers etc. It's better to
only iterate over the known files from the segments info that we recovered.