rename ReloadPolicy onCommit to onCommitWithDelay #2235
Merged
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.
Here is the pull request for issue #1824 that we dicussed on discord.
I simply renamed the reload policy from OnCommit to OnCommitWithDelay and updated the reference in the documentation and tests.
I tried to implement an OnCommit policy for synchronous reload but I did not succeed.
Here are the main issues I faced:
test_index_on_commit_reload_policy_different_directories
incore/test.rs
) and as far as I understand they share the access to the same directory. When an IndexWriter commits the changes are propagated to the file system, if an IndexReader is executed in a different process there is no simple way to notify the commit in a synchronous way because "there isn't a channel" between them (aside from the file system). I checked if there are some notifications for updating mmapped files but I did not find anythingmmap_directory
, direct call inside atomic_write forram_directory
). If the ReloadPolicy is "directory implementation indipendent" there is the need to associate it to the callback.If you think it'd feasible to implement a sync OnCommit policy I ask for some advice and I'll start to dig further into the problem.