mayorga / 389-ds-base

Forked from 389-ds-base 7 years ago
Clone

1d5859f 597375 - Deleting LDBM database causes backup/restore problem

Authored and Committed by nhosoi 13 years ago
    597375 - Deleting LDBM database causes backup/restore problem
    
    https://bugzilla.redhat.com/show_bug.cgi?id=597375
    
    Fix Description:
    1) When a backend was removed, the db instance directory was removed
    as well (See also 463774 - index files for database should be deleted
    when db is deleted).  In case DB_RECOVER_FATAL is set in the DB open
    after the removal (e.g., in restore), the logs in the transaction
    logs are replayed and compared with the contents of the DB files.
    At that time, if the db instance directory does not exist, libdb
    returns FATAL error.  To prevent the problem, we have to leave the
    empty directory.
    2) When removing index files, we don't have to open index files
    with CREAT flag.
    
    Note: In the bug 463774, the server was fixed so that once a db
    backend is removed, the db instance directory is removed.  With
    this fix (597375), the backend removal leaves the empty db instance
    directory.  Plus, if backup is restored, even if the backup was
    made after the backend is deleted, the restore could create empty
    DB files in the deleted db instance directory if the transaction
    log files still contain the history of the deleted backend.