-
Notifications
You must be signed in to change notification settings - Fork 103
Issue 6049 - lmdb - changelog is wrongly recreated by reindex task #6050
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
Conversation
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.
Fix looks good. A minor question in the review.
Also something I do not understand, do you know why this problem raise only now. It should have failed similarly with BDB.
| @@ -736,7 +736,11 @@ dbmdb_import_all_done(ImportJob *job, int ret) | |||
| ldbm_set_last_usn(inst->inst_be); | |||
|
|
|||
| /* bring backend online again */ | |||
| slapi_mtn_be_enable(inst->inst_be); | |||
| if (job->flags & FLAG_REINDEXING) { | |||
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.
Looking at bdb_import_all_done we have similar lines (enable backend even in case of reindex). Should it be also fixed in bdb_import_all_done ?
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.
No: Unlike in lmdb, bdb_import_all_done is not called after bdb_db2index (And that is why there is no problem with bdb)
That is due to a difference in the way xxx_db2index are coded:
- bdb: The function is quite large (864 lines) because it prepares the reindex - performs the reindex - sets back backend in non_busy mode. BTW that is why bdb reindex is slower than import
- mdb: The function is simpler (85 lines) because it simply prepare the reindex then reuse the import framework pipeline (in lmdb, the reindex processing is quite similar to the import except than data are read from entryid instead of ldif)
| @@ -736,7 +736,11 @@ dbmdb_import_all_done(ImportJob *job, int ret) | |||
| ldbm_set_last_usn(inst->inst_be); | |||
|
|
|||
| /* bring backend online again */ | |||
| slapi_mtn_be_enable(inst->inst_be); | |||
| if (job->flags & FLAG_REINDEXING) { | |||
| instance_set_not_busy(inst); | |||
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.
Fix looks good. A bit painful to retrieve where it was set, I found bdb_db2index and dbmdb_db2index. Do you mind to put a comment from where the BUSY flag was set.
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.
Ok, I will add a comment
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.
Done.
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.
Thanks for the explanations.
LGTM
…6050) * Issue 6049 - using lmdb the changelog is wrongly recreated by reindex task dbmdb_import_all_done called at the end of import, bulk import and reindex is reenabling the backend which trigger the replication plugin to check if data were not reloaded, but in the reindex case, the backend was not disabled (so the db ruv is not up to date) and changelog is then discarded . The solution is to set back the backend in not busy mode when doing a reindex. Issue: #6049 Reviewed by: @tbordaz (Thanks!) (cherry picked from commit d7e255a)
dbmdb_import_all_done called at the end of import, bulk import and reindex is reenabling the backend
which trigger the replication plugin to check if data were not reloaded, but in the reindex case, the backend was not disabled (so the db ruv is not up to date) and changelog is then discarded .
The solution is to set back the backend in not busy mode when doing a reindex.
Issue: #6049
Reviewed by: @tbordaz (Thanks!)