Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1455 by using per-file persisted metadata for incremental indexing decisions to prevent unnecessary re-indexing caused by aggregated log sizes.
The previous incremental indexing logic could incorrectly trigger re-indexing due to
log.LastSizebeing an aggregated value across rotated log files (e.g.,access.logandaccess.log.1). This led to false positives where the system believed a file had shrunk or grown, causing infinite rebuilds. This PR injects the actualPersistenceManagerto use accurate per-file metadata forLastModifiedandLastSize, ensuring indexing only occurs when truly needed. A fallback mechanism is also included for cases where persistence data isn't available, clamping theLastSizeto prevent similar issues.Note
Switch incremental indexing to per-file persisted metadata with a safe fallback, add rotation-aware doc count updates, and include unit tests.
logIndexProvider) to decide indexing via per-file metadata (GetLogIndex/NeedsIndexing).LastSize, handles never-indexed files, and refines change detection.LogFileManagerintoneedsIncrementalIndexingand job loop.queueIncrementalIndexing):SaveIndexMetadata) and manage statuses via persistence-backedsetFileIndexStatuswith simple queue ordering.internal/cron/incremental_indexing_test.gowith stub provider covering unchanged file skip and growth detection.Written by Cursor Bugbot for commit 8e9fa7d. This will update automatically on new commits. Configure here.