https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43469

            Bug ID: 43469
           Summary: Duplicate records in biblio and deletedbiblio tables
                    if deleting records metadata fails
   Initiative type: ---
        Sponsorship ---
            status:
           Product: Koha
           Version: Main
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Cataloging
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
                CC: [email protected]
  Target Milestone: ---

A while ago we faced a deadlock problem with our biblio_metadata table. This
led to our biblio record deletion background jobs to fail, leaving duplicate
records in biblio and deletedbiblio tables, moving biblioitems row to
deletedbiblioitems and leaving metadata to biblio_metadata table. While this
really is an edge case and happened because our own scripts were interfering
delete process of metadata, I suggest that we add rollback to addbiblio.pl in
case something goes wrong with delete. Also we should handle FIXME in line 867
and move error message to template alert.

This is tricky to reproduce and only way I could think of is to break code in
sub _koha_delete_biblio_metadata directly.

To reproduce:
1. Create a biblio record.
2. Find sub _koha_delete_biblio_metadata from Biblio.pm and break it e.g.
remove one column from SQL query.
3. Attempt to delete biblio. 
=> Error "ERROR when DELETING BIBLIO x : Exception raised - DBI Exception:
DBD::mysql::db do failed..." is raised but not as standard template error as in
other error cases.
4. Search your biblio from database.
=> Note that biblio is in both biblio and deletedbiblio table.
=> Note that biblio has been inserted to deletedbiblioitems table and deleted
from biblioitems table.
=> Note that biblios metadata is still in biblio_metadata table but not in
deletedbiblio_metadata table.

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to