SAI-5884: hook lucene Unloader into Solr container lifecycle#294
SAI-5884: hook lucene Unloader into Solr container lifecycle#294magibney wants to merge 42 commits intofs/branch_9_7from
Conversation
20a9197 to
1f35b45
Compare
…y/unloading-terms-and-dvs
…rable (power of 2)
…urable (default true)
a6953e1 to
6bd3222
Compare
d547e3b to
ab94a74
Compare
…erFieldDocValuesFormat
858d109 to
23a4b50
Compare
There was a problem hiding this comment.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on December 18
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| if (dynamic < 0) { | ||
| threshold = minSegSizeForUnload; | ||
| } else { | ||
| threshold = dynamicMinSegSize; |
There was a problem hiding this comment.
Bug: Volatile field read twice causing potential race condition
The code reads the volatile field dynamicMinSegSize into a local variable dynamic but then reads dynamicMinSegSize again instead of using the local variable. Since dynamicMinSegSize is volatile and can be modified by another thread, this creates a race condition where the threshold check could use a different value than was tested in the conditional. The assignment should be threshold = dynamic to use the cached value.
…y/unloading-terms-and-dvs
| } catch (Exception e) { | ||
| log.warn("problem parsing unloadMinSegSize spec=\"{}\"", o, e); | ||
| } | ||
| return true; |
There was a problem hiding this comment.
Bug: Cluster properties listener incorrectly removed after first call
The second registerClusterPropertiesListener for unloadMinSegSize returns true at line 148, but according to the ClusterPropertiesListener interface contract, returning true means "the listener should be removed". This causes the listener to unregister itself after the first cluster properties change notification, preventing it from responding to future changes to unloadMinSegSize. The first listener for minUnloadTime correctly returns false to remain active.
Note
Integrates Lucene Unloader across CoreContainer and Directory lifecycle with a dedicated executor, metrics, coordination points, and adds test/gradle options to control unloading.
ScheduledExecutorService(unloaderExecutor) inCoreContainerwith lifecycle management and accessor.org.apache.solr.core.UnloadHelpersupplying LuceneUnloader.UnloadHelper, tracking metrics, and reacting to cluster props.CachingDirectoryFactory: wireUnloaderCoordinationPoint.setUnloadHelperSupplier(...); cacheCoreContainerweak ref; initialize unload helper from object cache.TeeDirectory: implementUnloaderCoordinationPoint; propagate unload helper toaccessandpersistentdirectories.TeeDirectoryFactory: tolerate nullCoreContainer; keep weak ref volatile; initialize node-level state viaObjectCache.MetricUtilsto support custom histogram/timer snapshot writing viaSnapshotWriter.lucene.unload.ttl,lucene.unload.initial,lucene.unload.disable,lucene.unload.trackReloads.Written by Cursor Bugbot for commit fc53df4. This will update automatically on new commits. Configure here.