| |
@@ -704,12 +704,22 @@
|
| |
}
|
| |
|
| |
/* check if an import/restore is already ongoing... */
|
| |
- if ((instance_set_busy(inst) != 0) ||
|
| |
- (slapi_counter_get_value(inst->inst_ref_count) > 0)) {
|
| |
+ if ((instance_set_busy(inst) != 0)) {
|
| |
slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldif2ldbm", "ldbm: '%s' is already in the middle of "
|
| |
"another task and cannot be disturbed.\n",
|
| |
inst->inst_name);
|
| |
return -1;
|
| |
+ } else {
|
| |
+ uint64_t refcnt;
|
| |
+ refcnt = slapi_counter_get_value(inst->inst_ref_count);
|
| |
+ if (refcnt > 0) {
|
| |
+ slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldif2ldbm", "ldbm: '%s' there are %d pending operation(s)."
|
| |
+ " Import can not proceed until they are completed.\n",
|
| |
+ inst->inst_name,
|
| |
+ refcnt);
|
| |
+ instance_set_not_busy(inst);
|
| |
+ return -1;
|
| |
+ }
|
| |
}
|
| |
|
| |
if ((task_flags & SLAPI_TASK_RUNNING_FROM_COMMANDLINE)) {
|
| |
Bug Description:
At the beginning of an import, a flag is set to mark the target backend is busy.
Then import tests if there are pending operations. If such operations exist the import can not proceed and fails.
The problem is that in such case of pending operations, the import fails without resetting the busy flag.
It let the backend busy (until next reboot) and prevent new import.
Fix Description:
It needs to reset the busy flag if there are pending operations
https://pagure.io/389-ds-base/issue/50117
Reviewed by: ?
Platforms tested: F27
Flag Day: no
Doc impact: no