[Koha-bugs] [Bug 22690] Merging records with many items too slow (Elasticsearch)

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Mar 15 12:45:04 CET 2021


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

--- Comment #107 from Ere Maijala <ere.maijala at helsinki.fi> ---
(In reply to Martin Renvoize from comment #98)
> Comment on attachment 113967 [details] [review]
> Bug 22690: Refactor merging of records to improve performance (Elasticsearch)
> 
> Review of attachment 113967 [details] [review]:
> -----------------------------------------------------------------
> 
> ::: Koha/Item.pm
> @@ +1064,5 @@
> > +sub item_orders {
> > +    my ( $self ) = @_;
> > +
> > +    my $orders = $self->_result->item_orders;
> > +    return Koha::Acquisition::Orders->_new_from_dbic($orders);
> 
> In it's current form, this can result in failure..  I'm not seeing any
> handling for that...
> 
> i.e. if an item is deleted it gets moved to deleted_items but the itemnumber
> remains in the aqorder_items table as there is no foreign key constraint..
> have you tested this case?

(See also comment #101) The only case I can see this one fail is if the item
for which this is being called  Well, there's the possibility that the item
gets deleted in the meantime, so (In reply to Martin Renvoize from comment #98)
> Comment on attachment 113967 [details] [review]
> Bug 22690: Refactor merging of records to improve performance (Elasticsearch)
> 
> Review of attachment 113967 [details] [review]:
> -----------------------------------------------------------------
> 
> ::: Koha/Item.pm
> @@ +1064,5 @@
> > +sub item_orders {
> > +    my ( $self ) = @_;
> > +
> > +    my $orders = $self->_result->item_orders;
> > +    return Koha::Acquisition::Orders->_new_from_dbic($orders);
> 
> In it's current form, this can result in failure..  I'm not seeing any
> handling for that...
> 
> i.e. if an item is deleted it gets moved to deleted_items but the itemnumber
> remains in the aqorder_items table as there is no foreign key constraint..
> have you tested this case?

Error checking added. Not tested, however, since this should be extremely rare.
I can't see this happening unelss the underlying item record for the Item
instance here gets deleted while item move is being processed.

There are a lot of similar accessor with the same issue.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list