Bibliographic record merging should update the MARC leader when deleting a record

Bug #1387722 reported by Kathy Lussier on 2014-10-30
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Evergreen
Medium
Rogan Hamby

Bug Description

Evergreen version: 2.6

When merging bib records, in the Leader, position 05 - Record Status of the deleted record, the code is not changed to "d," for deleted, as it is when a record is simply deleted within the client.

Sharon Douglas (onefish7) wrote :

version 2.10.6 experiencing the exact situation

Changed in evergreen:
status: New → Confirmed
Mike Rylander (mrylander) wrote :

I think this should be handled by a database trigger, setting the leader 05 to 'd' on delete and, most likely, 'n' on "undelete". Question: should the field be check and set to 'n' (or other) if it is being inserted for the first time and is currently set to 'd'?

Rogan Hamby (rogan-hamby) wrote :

Just to expand it even more should we mark it 'c' when it's edited since presumably it has been revised?

Christine Morgan (cmorgan-z) wrote :

Mike and Rogan, I would say yes to both questions since you might want the record status to reflect it's life in your database.

Garry Collum (gcollum) wrote :

This may be a separate bug, but it is closely related. The edit_date column in biblio.record_entry for the deleted record is also not updated after the merge. I think it should be for query purposes.

I've done some work on this but it needs some more testing on my end. I'll
try to get around to working on it more soon. Should an update to
edit_date on delete be on this or a separate bug ticket? I think of it as
a separate thing but I'll defer to a wider opinion.

On Mon, Sep 25, 2017 at 3:46 PM, Garry Collum <email address hidden>
wrote:

> This may be a separate bug, but it is closely related. The edit_date
> column in biblio.record_entry for the deleted record is also not updated
> after the merge. I think it should be for query purposes.
>
> --
> You received this bug notification because you are subscribed to
> Evergreen.
> Matching subscriptions: evergreenbugs
> https://bugs.launchpad.net/bugs/1387722
>
> Title:
> Bibliographic record merging should update the MARC leader when
> deleting a record
>
> Status in Evergreen:
> Confirmed
>
> Bug description:
> Evergreen version: 2.6
>
> When merging bib records, in the Leader, position 05 - Record Status
> of the deleted record, the code is not changed to "d," for deleted, as
> it is when a record is simply deleted within the client.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/evergreen/+bug/1387722/+subscriptions
>

Kathy Lussier (klussier) wrote :

I agree it's a separate bug.

Rogan Hamby (rogan-hamby) wrote :

I've pushed a working branch for this to: user/rogan/lp1387722_set_leader_delete_status

Following Mike's advice I did it as a database trigger on the biblio.record_entry row. I've tested it under current master and it works cleanly.

On insert it sets it to 'n', on update and delete flag is false (including undelete) it sets to 'c' and on update with delete set to true it sets it to 'd'.

tags: added: pullrequest
Jane Sandberg (sandbej) wrote :

Rogan, since this introduces some new behavior, could you please include a short release note in your branch?

tags: added: needsreleasenote
Rogan Hamby (rogan-hamby) wrote :

Will do.

Changed in evergreen:
assignee: nobody → Rogan Hamby (rogan-hamby)
Rogan Hamby (rogan-hamby) wrote :

Jane,

here it is: user/rogan/lp1387722_record_leader_updates_release_note

tags: removed: needsreleasenote
Kathy Lussier (klussier) on 2018-01-17
Changed in evergreen:
assignee: Rogan Hamby (rogan-hamby) → nobody
Rogan Hamby (rogan-hamby) wrote :

upgrade script added to tip of user/rogan/lp1387722_set_leader_delete_status

Jane Sandberg (sandbej) wrote :

Thanks for your work on this, Rogan. I wonder if a PGTap test to test your sweet new biblio.set_record_status_in_leader() function might also be helpful. Thoughts?

Rogan Hamby (rogan-hamby) wrote :

Looking at it I decided to make a tweak so in the progress I squashed everything into a new branch: patch, upgrade script, release notes and pgtap test:

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=commit;h=af50a59b300a2218d08e4b22cc95dfa7c806b428

user/rogan/lp1387722_record_leader_updates_squashed

Jane Sandberg (sandbej) wrote :

That looks great, Rogan!

Ben Shum (bshum) wrote :

Fixed up the commit to add details and pushed to master for future releases.

Changed in evergreen:
milestone: none → 3.2-beta
status: Confirmed → Fix Committed
Ben Shum (bshum) on 2018-05-02
Changed in evergreen:
status: Fix Committed → Incomplete
milestone: 3.2-beta → none
tags: added: needsrepatch
removed: pullrequest
Ben Shum (bshum) wrote :

Okay, I reverted this change because it was causing unexpected problems elsewhere with the perl livetests.

Apparently, the URI triggers are seemingly being run twice. This led to concerto dataset getting busted with extra rows for call numbers, which shifted all the copies, making all the live tests unhappy. I don't think we want the database to be churning extra runs of the asset.uri creation/deletion, so let's look at this more closely.

Removing pullrequest and adding repatch note.

Rogan Hamby (rogan-hamby) wrote :

Interesting. I’ll take another look at this with 856s.

On Wed, May 2, 2018 at 01:17 Ben Shum <email address hidden> wrote:

> Okay, I reverted this change because it was causing unexpected problems
> elsewhere with the perl livetests.
>
> Apparently, the URI triggers are seemingly being run twice. This led to
> concerto dataset getting busted with extra rows for call numbers, which
> shifted all the copies, making all the live tests unhappy. I don't
> think we want the database to be churning extra runs of the asset.uri
> creation/deletion, so let's look at this more closely.
>
> Removing pullrequest and adding repatch note.
>
> --
> You received this bug notification because you are subscribed to
> Evergreen.
> Matching subscriptions: evergreenbugs
> https://bugs.launchpad.net/bugs/1387722
>
> Title:
> Bibliographic record merging should update the MARC leader when
> deleting a record
>
> Status in Evergreen:
> Incomplete
>
> Bug description:
> Evergreen version: 2.6
>
> When merging bib records, in the Leader, position 05 - Record Status
> of the deleted record, the code is not changed to "d," for deleted, as
> it is when a record is simply deleted within the client.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/evergreen/+bug/1387722/+subscriptions
>

Changed in evergreen:
assignee: nobody → Rogan Hamby (rogan-hamby)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers