Doug Cutting wrote:
Yonik Seeley wrote:
One could keep around all old segments until a close() but that would
cost disk space.
One could optimize that so that intermediate segments, created since
open, would be deleted. So, for example, batch indexing starting with
an empty index could freely delete segments as they're obsoleted, since
no one else should yet reference them.
This is in fact what I did to make addIndexes(*) calls transactional
(so that on disk full or other error, the index reverted to the
starting point) for LUCENE-702. Intermediate segments are freely
deleted but ones that existed at the start are not. And, no
segments_N file is written until the end.
But this wouldn't solve the "bulk delete then add" case because the
reader needs to close and sync its state to disk in such a way that
other readers using isCurrent() would know not to refresh.
Another use case is optimize() while readers are using the index. If
you have readers refreshing during optimize (based on isCurrent()) you
can accidentally tie up tons of disk space, temporarily. Yet you also
want the writer to "checkpoint" periodically to disk so that if it
crashes you could resume from the last checkpoint rather than roll
back way to the start of your optimize.
Mike
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]