OAK-12247: Keep track of total indexed documents#2943
Open
bhabegger wants to merge 1 commit into
Open
Conversation
f8ed88c to
baa33dc
Compare
Adds getTotalDocCount() to FulltextIndexWriter (default -1 = not tracked) and wires it through all writer implementations: - DefaultIndexWriter: commit() then numDocs() before close() — no extra I/O since close() calls commit() internally; accurate after pending deletes. - MultiplexingIndexWriter: sums sub-writer counts (filters negatives for mounts that were never opened). - PooledLuceneIndexWriter: delegates to the wrapped writer. - ElasticIndexWriter: LongAdder initialised to prevTotal (incremental) or 0 (reindex); incremented/decremented in afterBulk() and deleteDocuments(). - LocalIndexWriter (NRT): returns -1 — NRT docs are in-memory only; the persistent count is updated by the next async cycle. closeWriter() reads getTotalDocCount() and persists it to :status/totalIndexedNodes when the value is >= 0. For the Elastic gap (empty reindex returns indexUpdated=false so the legacy :status block never ran), a separate additive block writes totalIndexedNodes and REINDEX_COMPLETION_TIMESTAMP for the !indexUpdated && reindex case. Kill switch FT_OAK-12247 (AtomicBoolean FT_OAK_12247_DISABLE, default false = tracking active) is registered as a FeatureToggle in LuceneIndexProviderService following the FT_OAK_12193 precedent. IndexStatsCollector and IndexStatsImpl are removed (net ~200 lines).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Persists `totalIndexedNodes` to `:status` after each indexing cycle so planners can know whether an index is empty.
What it does: