diff options
author | Noriko Hosoi <nhosoi@redhat.com> | 2010-09-12 21:59:29 -0700 |
---|---|---|
committer | Noriko Hosoi <nhosoi@redhat.com> | 2010-09-13 10:06:51 -0700 |
commit | 80ce631a97977c273a56b5d4d7e99a7eaf109d57 (patch) | |
tree | 75207bb0b02a57485d87efedabfcc2fe243eeb06 /ldap/servers/slapd/back-ldbm/import-threads.c | |
parent | 2a25e6518f6e2bd83dd4750bf023d332edef2063 (diff) | |
download | ds-80ce631a97977c273a56b5d4d7e99a7eaf109d57.tar.gz ds-80ce631a97977c273a56b5d4d7e99a7eaf109d57.tar.xz ds-80ce631a97977c273a56b5d4d7e99a7eaf109d57.zip |
Bug 633168 - Share backend dbEnv with the replication changelog
https://bugzilla.redhat.com/show_bug.cgi?id=633168
Description:
* cl5_api.c, cl5_api.h
- fetches dbEnv from backend using slapi_back_get_info.
- unused macros and DB helper functions and APIs are removed.
* cl5_config.c
- local changelog DB related config parameters are removed.
* Added SLAPI_PLUGIN_BE_PRE_CLOSE_FN and SLAPI_PLUGIN_BE_POST_OPEN_FN to
close changelog DB before dbEnv is closed and to open changelog DB after
dbEnv is opened, respectively.
* Added slapi APIs slapi_back_get_info and slapi_back_set_info to get/set
the backend info.
* back-ldbm
- db2bak[.pl] and bak2db[.pl] backs up and restores the database files
including changelog db.
- changelog dir is backed up in <backupdir>/.repl_changelog_backup.
- underlying implementation ldbm_back_get_info for slapi_back_get_info
is added.
* Added an upgrade script 81changelog.pl
See also:
http://directory.fedoraproject.org/wiki/Move_changelog
Diffstat (limited to 'ldap/servers/slapd/back-ldbm/import-threads.c')
-rw-r--r-- | ldap/servers/slapd/back-ldbm/import-threads.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/ldap/servers/slapd/back-ldbm/import-threads.c b/ldap/servers/slapd/back-ldbm/import-threads.c index 1fc269b9..1d490546 100644 --- a/ldap/servers/slapd/back-ldbm/import-threads.c +++ b/ldap/servers/slapd/back-ldbm/import-threads.c @@ -549,6 +549,7 @@ import_producer(void *param) } continue; } + /* From here, e != NULL */ if (0 == my_version) { /* after the first entry version string won't be given */ my_version = -1; @@ -556,10 +557,7 @@ import_producer(void *param) if (! import_entry_belongs_here(e, inst->inst_be)) { /* silently skip */ - if (e) { - slapi_entry_free(e); - } - + slapi_entry_free(e); continue; } @@ -569,9 +567,7 @@ import_producer(void *param) "violates schema, ending line %d of file " "\"%s\"", escape_string(slapi_entry_get_dn(e), ebuf), curr_lineno, curr_filename); - if (e) { - slapi_entry_free(e); - } + slapi_entry_free(e); job->skipped++; continue; @@ -625,9 +621,7 @@ import_producer(void *param) "violates attribute syntax, ending line %d of " "file \"%s\"", escape_string(slapi_entry_get_dn(e), ebuf), curr_lineno, curr_filename); - if (e) { - slapi_entry_free(e); - } + slapi_entry_free(e); job->skipped++; continue; @@ -640,8 +634,10 @@ import_producer(void *param) } ep = import_make_backentry(e, id); - if (!ep || !ep->ep_entry) + if (!ep) { + slapi_entry_free(e); goto error; + } /* check for include/exclude subtree lists */ if (! ldbm_back_ok_to_dump(backentry_get_ndn(ep), @@ -729,8 +725,8 @@ import_producer(void *param) "ending line %d of file \"%s\"", escape_string(slapi_entry_get_dn(e), ebuf), curr_lineno, curr_filename); - import_log_notice(job, "REASON: entry too large (%ld bytes) for " - "the buffer size (%lu bytes)", newesize, job->fifo.bsize); + import_log_notice(job, "REASON: entry too large (%u bytes) for " + "the buffer size (%u bytes)", newesize, job->fifo.bsize); backentry_free(&ep); job->skipped++; continue; @@ -1422,6 +1418,7 @@ upgradedn_producer(void *param) continue; } + /* From here, e != NULL */ /* Check DN syntax attr values if it contains '\\' or not */ /* Start from the rdn */ if (entryrdn_get_switch()) { /* subtree-rename: on */ @@ -1615,7 +1612,7 @@ upgradedn_producer(void *param) upgradedn_free_list(&ud_list); ep = import_make_backentry(e, temp_id); - if (!ep || !ep->ep_entry) { + if (!ep) { slapi_entry_free(e); e = NULL; goto error; } @@ -2130,7 +2127,7 @@ import_foreman(void *param) * Note: FLAG_UPGRADEDNFORMAT only. */ Slapi_Attr *orig_entrydn = NULL; - Slapi_Attr *new_entrydn = slapi_attr_new(); + Slapi_Attr *new_entrydn = NULL; Slapi_Attr *nsuniqueid = NULL; const char *uuidstr = NULL; char *new_dn = NULL; @@ -2150,6 +2147,7 @@ import_foreman(void *param) orig_dn, fi->entry->ep_id); goto cont; } + new_entrydn = slapi_attr_new(); new_dn = slapi_create_dn_string("nsuniqueid=%s+%s", uuidstr, orig_dn); /* releasing original dn */ @@ -2724,6 +2722,10 @@ static int bulk_import_queue(ImportJob *job, Slapi_Entry *entry) Slapi_Attr *attr = NULL; size_t newesize = 0; + if (!entry) { + return -1; + } + PR_Lock(job->wire_lock); /* Let's do this inside the lock !*/ id = job->lead_ID + 1; @@ -2732,7 +2734,7 @@ static int bulk_import_queue(ImportJob *job, Slapi_Entry *entry) /* make into backentry */ ep = import_make_backentry(entry, id); - if (!ep || !ep->ep_entry) { + if (!ep) { import_abort_all(job, 1); PR_Unlock(job->wire_lock); return -1; @@ -3157,9 +3159,10 @@ dse_conf_verify_core(struct ldbminfo *li, char *src_dir, char *file_name, char * if (entry_filter != NULL) /* Single instance restoration */ { - if (NULL == strstr(estr, entry_filter)) + if (NULL == strstr(estr, entry_filter)) { slapi_ch_free_string(&estr); continue; + } } e = slapi_str2entry(estr, 0); |