Bugzilla – Attachment 50161 Details for
Bug 16248
ModZebra doesn't update zebraqueue if ES is enabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16248: ModZebra doesn't update zebraqueue if ES is enabled
Bug-16248-ModZebra-doesnt-update-zebraqueue-if-ES-.patch (text/plain), 3.29 KB, created by
Chris Cormack
on 2016-04-12 21:19:06 UTC
(
hide
)
Description:
Bug 16248: ModZebra doesn't update zebraqueue if ES is enabled
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2016-04-12 21:19:06 UTC
Size:
3.29 KB
patch
obsolete
>From 73031f12e16a693dad6d8318655482a7d402ec66 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@unc.edu.ar> >Date: Tue, 12 Apr 2016 15:33:25 -0300 >Subject: [PATCH] Bug 16248: ModZebra doesn't update zebraqueue if ES is > enabled > >The zebraqueue table should still be populated with updates if ES is enabled, so >the Zebra indexer keeps the Z39.50/SRU indexes up to date. > >To test: >- Set SearchEngine = Elasticsearch >- Watch for zebraqueue changes > $ watch -n 0.5 'echo "SELECT COUNT(*) FROM zebraqueue WHERE done=0" | sudo koha-mysql kohadev' >- Call touch_all_biblios.pl to simulate record changes > $ sudo koha-shell kohadev ; cd kohaclone > $ perl misc/maintenance/touch_all_biblios.pl -v >=> FAIL: Notice the watch is not changing the number of records to be indexed. >- Apply the patch >- Call touch_all_biblios.pl to simulate record changes > $ sudo koha-shell kohadev ; cd kohaclone > $ perl misc/maintenance/touch_all_biblios.pl -v >=> SUCCESS: The count raises (more than 0) and the zebra indexer picks the updates. >- Sign off > >Signed-off-by: Chris <chrisc@catalyst.net.nz> >--- > C4/Biblio.pm | 42 +++++++++++++++++++++--------------------- > 1 file changed, 21 insertions(+), 21 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index 0a57b5d..bd9c4ab 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -2930,27 +2930,27 @@ sub ModZebra { > else { > croak "ModZebra called with unknown operation: $op"; > } >- } else { >- my $dbh = C4::Context->dbh; >- >- # true ModZebra commented until indexdata fixes zebraDB crashes (it seems they occur on multiple updates >- # at the same time >- # replaced by a zebraqueue table, that is filled with ModZebra to run. >- # the table is emptied by rebuild_zebra.pl script (using the -z switch) >- my $check_sql = "SELECT COUNT(*) FROM zebraqueue >- WHERE server = ? >- AND biblio_auth_number = ? >- AND operation = ? >- AND done = 0"; >- my $check_sth = $dbh->prepare_cached($check_sql); >- $check_sth->execute( $server, $biblionumber, $op ); >- my ($count) = $check_sth->fetchrow_array; >- $check_sth->finish(); >- if ( $count == 0 ) { >- my $sth = $dbh->prepare("INSERT INTO zebraqueue (biblio_auth_number,server,operation) VALUES(?,?,?)"); >- $sth->execute( $biblionumber, $server, $op ); >- $sth->finish; >- } >+ } >+ >+ my $dbh = C4::Context->dbh; >+ >+ # true ModZebra commented until indexdata fixes zebraDB crashes (it seems they occur on multiple updates >+ # at the same time >+ # replaced by a zebraqueue table, that is filled with ModZebra to run. >+ # the table is emptied by rebuild_zebra.pl script (using the -z switch) >+ my $check_sql = "SELECT COUNT(*) FROM zebraqueue >+ WHERE server = ? >+ AND biblio_auth_number = ? >+ AND operation = ? >+ AND done = 0"; >+ my $check_sth = $dbh->prepare_cached($check_sql); >+ $check_sth->execute( $server, $biblionumber, $op ); >+ my ($count) = $check_sth->fetchrow_array; >+ $check_sth->finish(); >+ if ( $count == 0 ) { >+ my $sth = $dbh->prepare("INSERT INTO zebraqueue (biblio_auth_number,server,operation) VALUES(?,?,?)"); >+ $sth->execute( $biblionumber, $server, $op ); >+ $sth->finish; > } > } > >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16248
:
50158
|
50161
|
50549