Bugzilla – Attachment 50004 Details for
Bug 15113
koha-rebuild-zebra should check USE_INDEXER_DAEMON and skip if enabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF]Bug 15113: koha-rebuild-zebra should check USE_INDEXER_DAEMON and skip if enabled
SIGNED-OFFBug-15113-koha-rebuild-zebra-should-chec.patch (text/plain), 6.22 KB, created by
Héctor Eduardo Castro Avalos
on 2016-04-06 19:59:08 UTC
(
hide
)
Description:
[SIGNED-OFF]Bug 15113: koha-rebuild-zebra should check USE_INDEXER_DAEMON and skip if enabled
Filename:
MIME Type:
Creator:
Héctor Eduardo Castro Avalos
Created:
2016-04-06 19:59:08 UTC
Size:
6.22 KB
patch
obsolete
>From 6e173d1ced0fcaa21ee649349c1b4d269e1fe638 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@unc.edu.ar> >Date: Fri, 1 Apr 2016 15:30:26 -0300 >Subject: [PATCH] [SIGNED-OFF]Bug 15113: koha-rebuild-zebra should check > USE_INDEXER_DAEMON and skip if enabled > >This patch changes the behaviour of the koha-rebuild-zebra script in the following way: > >USE_INDEXER_DAEMON=no >- Keeps the current behaviour > >USE_INDEXER_DAEMON=yes >- It skips incremental indexing to avoid races. > >Caveats: >- A --force option is introduced for useing in a specific situtation that might need it > (i.e. the administrator knows what he's doing). >- If --full is passed, the reindexing is not skipped. > >The documentation files and messages are adjusted accordingly. > >This patch should help users that want to use the indexing daemon, in which case they wouldn't need >to change their default 5 min cronjob (it will be just skipped). Ultimately, koha-common could have >USE_INDEXER_DAEMON = yes by default, but that's subject for another bug report. > >To test: >- Play with the different option switches and USE_INDEXER_DAEMON >- Things work as expected >- Sign off > >Regards > >Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> >Works as expected >--- > debian/docs/koha-rebuild-zebra.xml | 12 +++++++++--- > debian/scripts/koha-rebuild-zebra | 34 +++++++++++++++++++++++++--------- > 2 files changed, 34 insertions(+), 12 deletions(-) > >diff --git a/debian/docs/koha-rebuild-zebra.xml b/debian/docs/koha-rebuild-zebra.xml >index b742c26..099c045 100644 >--- a/debian/docs/koha-rebuild-zebra.xml >+++ b/debian/docs/koha-rebuild-zebra.xml >@@ -23,7 +23,7 @@ > > <refsynopsisdiv> > <cmdsynopsis> >- <command>koha-rebuild-zebra</command> <arg><option>-u</option>|<option>--usmarc</option></arg> <arg><option>-f</option>|<option>--full</option></arg> <arg><option>-a</option>|<option>--authorities</option></arg> <arg><option>-b</option>|<option>--biblios</option></arg> <arg><option>-q</option>|<option>--quiet</option></arg> <arg><option>-v</option>|<option>--verbose</option></arg> <arg><option>...</option></arg> <arg choice="req" rep="repeat"><replaceable>instancename</replaceable></arg> >+ <command>koha-rebuild-zebra</command> <arg><option>-u</option>|<option>--usmarc</option></arg> <arg><option>--force</option></arg> <arg><option>-f</option>|<option>--full</option></arg> <arg><option>-a</option>|<option>--authorities</option></arg> <arg><option>-b</option>|<option>--biblios</option></arg> <arg><option>-q</option>|<option>--quiet</option></arg> <arg><option>-v</option>|<option>--verbose</option></arg> <arg><option>...</option></arg> <arg choice="req" rep="repeat"><replaceable>instancename</replaceable></arg> > </cmdsynopsis> > </refsynopsisdiv> > >@@ -36,9 +36,15 @@ > </listitem> > </varlistentry> > <varlistentry> >+ <term><option>--force</option></term> >+ <listitem> >+ <para>Force incremental indexing when <option>USE_INDEXER_DAEMON=yes</option>.</para> >+ </listitem> >+ </varlistentry> >+ <varlistentry> > <term><option>-f, --full</option></term> > <listitem> >- <para>Does a reindex of the whole collection.</para> >+ <para>Does a reindex of the whole collection. Will run even if <option>USE_INDEXER_DAEMON=yes</option>.</para> > </listitem> > </varlistentry> > <varlistentry> >@@ -75,7 +81,7 @@ > </refsect1> > > <refsect1><title>Description</title> >- <para>Rebuild the Zebra database for Koha instances.</para> >+ <para>Rebuild the Zebra database for Koha instances. It will run incremental updates by default. It will be skipped if <option>USE_INDEXER_DAEMON=yes</option> in /etc/default/koha-common, unless <option>--force</option> or <option>--full</option> are used.</para> > </refsect1> > > <refsect1><title>See also</title> >diff --git a/debian/scripts/koha-rebuild-zebra b/debian/scripts/koha-rebuild-zebra >index f8267c5..0eb68d0 100755 >--- a/debian/scripts/koha-rebuild-zebra >+++ b/debian/scripts/koha-rebuild-zebra >@@ -19,6 +19,9 @@ > > set -e > >+# Read configuration variable file if it is present >+[ -r /etc/default/koha-common ] && . /etc/default/koha-common >+ > # include helper functions > if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then > . "/usr/share/koha/bin/koha-functions.sh" >@@ -49,15 +52,20 @@ run_rebuild_zebra() > { > local instancename=$1; shift > >- # TODO: This comment is here to remind us that we should make >- # rebuild_zebra.pl return error codes on failure >- if sudo -u "$instancename-koha" -H \ >- env PERL5LIB=/usr/share/koha/lib \ >- KOHA_CONF="/etc/koha/sites/$instancename/koha-conf.xml" \ >- /usr/share/koha/bin/migration_tools/rebuild_zebra.pl $@ ; then >- return 0 >- else >- return 1 >+ if [ "$USE_INDEXER_DAEMON" = "no" ] || >+ [ "${full_reindex}" = "yes" ] || >+ [ "${force}" = "yes" ] ; then >+ >+ # TODO: This comment is here to remind us that we should make >+ # rebuild_zebra.pl return error codes on failure >+ if sudo -u "$instancename-koha" -H \ >+ env PERL5LIB=/usr/share/koha/lib \ >+ KOHA_CONF="/etc/koha/sites/$instancename/koha-conf.xml" \ >+ /usr/share/koha/bin/migration_tools/rebuild_zebra.pl $@ ; then >+ return 0 >+ else >+ return 1 >+ fi > fi > } > >@@ -75,6 +83,7 @@ Options: > --authorities|-a Only run process for authorities. > --biblios|-b Only run process for biblios. > --full|-f Does a reindex of the whole collection. >+ --force Run incremental indexing even if USE_INDEXER_DAEMON="yes" > --quiet|-q Sometimes be a bit quieter for scripts/cronjobs. > --verbose|-v Be verbose. > --help|-h Print this help. >@@ -93,6 +102,9 @@ biblios_only="no" > authorities_only="no" > biblios="yes" > authorities="yes" >+force="no" >+full_reindex="no" >+ > # The '-q' option is intended to prevent the cronjob causing this to output > # help information if there are no instances defined. > quiet="no" >@@ -113,8 +125,12 @@ while [ -n "$*" ]; do > opt_xml="" > ;; > -f|--full) >+ full_reindex="yes" > opt_idx="-r" > ;; >+ --force) >+ force="yes" >+ ;; > -v|--verbose) > opt_verbose="-v" > ;; >-- >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 15113
:
49811
|
50004
|
50019