-
Notifications
You must be signed in to change notification settings - Fork 635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lucene index amend improvements #14513
Conversation
Opened for running regressions, still WIP |
@@ -147,12 +153,12 @@ internal void CreateLuceneIndexWriter() | |||
{ | |||
|
|||
DisposeWriter(); | |||
(ExecutionEvents.ActiveSession.GetParameterValue(ParameterKeys.Logger) as DynamoLogger).LogError($"LuceneNET LockObtainFailedException {ex}"); | |||
dynamoModel.Logger.LogError($"LuceneNET LockObtainFailedException {ex}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to revert this because I found in edge case if the index is ever locked (although would rarely happen after all the improvements in this PR), the previous code will make Dynamo hang because of threading issues
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a comment
@@ -366,7 +367,7 @@ private void RefreshBackupFileList(IEnumerable<string> filePaths) | |||
IEnumerable<string> filePaths) | |||
{ | |||
files.Clear(); | |||
foreach (var filePath in filePaths) | |||
foreach (var filePath in filePaths.Where(x => x != null)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is throwing a bunch of exceptions so filtering out the nulls from the list
@@ -37,6 +37,9 @@ public static Exception CreateFolderIfNotExist(string folderPath) | |||
{ | |||
try | |||
{ | |||
// Do not even try when folder path is null or empty. | |||
// This usually happens when system folder dialog is initialized with empty path | |||
if (string.IsNullOrEmpty(folderPath)) return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was throwing exception when folder path is null
I am considering adding getter for |
Hi @reddyashish This should be ready for a final review |
There are some new regressions that I am taking a look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once the regressions are fixed.
Looks like it is my last commit about refactoring cause the regressions, looking at it |
@@ -395,8 +403,8 @@ internal void DisposeWriter() | |||
/// </summary> | |||
internal void DisposeAll() | |||
{ | |||
writer?.Dispose(); | |||
dirReader?.Dispose(); | |||
DisposeWriter(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this was causing the regressions, because writer was disposed first so we need to set it to null, otherwise in the DirReader
getter, we will be trying to access an already disposed object
Regressions fixed, waiting for PR validation task to pass |
All tests passing, merging |
* Use index writer to amend index after Dynamo Launch * Update sorting * Update * Update * Update * Make sure package loading end will already release index lock * Update Comments * Clean Up * Code clean up * clean up * Code Clean Up * regressions * revert code clean up because it affects running tests in parallel * update
* DYN-6038 Lucene search IMP (#14428) * improvements * Simply initialization logic * Skip indexing as part of DynamoModel if the index files already exist * Remove DynamoModel reference and use singleton * clean up * improvements and package manager search * Use single constructor and other code clean up * Update... * Update * Dispose all Lucene objects in the correct order * Adding DynamoModel back to test regressions * Null check * Update * IndexWriter dispose sequence only for non-RAM mode * Update * Lucene index amend improvements (#14513) * Use index writer to amend index after Dynamo Launch * Update sorting * Update * Update * Update * Make sure package loading end will already release index lock * Update Comments * Clean Up * Code clean up * clean up * Code Clean Up * regressions * revert code clean up because it affects running tests in parallel * update * update * Update AssemblySharedInfo.cs
Purpose
Lucene index improvements to make sure index locks can always be released and amended when needed by multiple Dynamo sessions. Index lifetime diagrams as below:
What this PR includes:
Here is what it looks like:
Declarations
Check these if you believe they are true
*.resx
filesRelease Notes
Multiple Dynamo sessions can use search independently
Reviewers
(FILL ME IN) Reviewer 1 (If possible, assign the Reviewer for the PR)
(FILL ME IN, optional) Any additional notes to reviewers or testers.
FYIs
(FILL ME IN, Optional) Names of anyone else you wish to be notified of