Summary: | [index] Wrong indexes may be used while performing a search request | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Frederic Fusier <frederic_fusier> | ||||||||||||
Component: | Core | Assignee: | Frederic Fusier <frederic_fusier> | ||||||||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||||||||
Severity: | normal | ||||||||||||||
Priority: | P3 | CC: | jerome_lanneluc, kent_johnson, yuming_liu | ||||||||||||
Version: | 3.4 | ||||||||||||||
Target Milestone: | 3.5 M4 | ||||||||||||||
Hardware: | PC | ||||||||||||||
OS: | Windows XP | ||||||||||||||
See Also: | https://bugs.eclipse.org/bugs/show_bug.cgi?id=566262 | ||||||||||||||
Whiteboard: | |||||||||||||||
Attachments: |
|
Description
Frederic Fusier
2008-10-21 04:38:55 EDT
Created attachment 118573 [details] Proposed patch Patch extracted from last bug 12044 patch and improved a little bit. With this patch, the index is not recreated while indexing a jar file, but reset instead. This avoid a running request to lose the index pointer if a re-indexing occurs concurrently (see PatternSearchJob.execute(IProgressMonitor) method)... Note that the index will be recreated if none is found while resetting it... Created attachment 118574 [details]
Real proposed patch
Previous patch included temporary changes DiskIndex which I think are not finalized yet...
Created attachment 118575 [details]
Final? proposed patch
I got some troubles this morning with patches...
Previous one has a compiler error!
Jerome, Kent, could you have a look on the patch and let me know your mind about it? TIA (In reply to comment #3) It looks like the index file is reused when reset (actually only the header is reused). I'm not sure what the content of the header is, but it might be safer to do as before: delete the file and recreate it from scratch. (In reply to comment #5) > (In reply to comment #3) > It looks like the index file is reused when reset (actually only the header is > reused). I'm not sure what the content of the header is, but it might be safer > to do as before: delete the file and recreate it from scratch. > Good point. I thought it could be a possible optimization not delete/recreate the index file, but then we would keep categories tables offset in the header which make its contents invalid. It seems that the DiskIndex.initialize(boolean) can be used only for to clone DiskIndex objects when the argument is true... Created attachment 118601 [details]
Last proposed patch
Released for 3.5M4 in HEAD stream. Unfortunately it was not possible to write test for the fix of this bug. I'm afraid that only code review can be done to verify it... Created attachment 118611 [details]
Last patch improvement
Additional change to always create a new index file while resetting the Index.
Thanks Jerome :-)
Verified for 3.5M4 using I20081209-0100 *** Bug 241592 has been marked as a duplicate of this bug. *** |