Bug 12120 - Add --tempdir arg to rebuild_zebra.pl
Summary: Add --tempdir arg to rebuild_zebra.pl
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Mason James
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-21 20:19 UTC by Mason James
Modified: 2016-02-11 05:33 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 12120: Add --tempdir arg to rebuild_zebra.pl (4.58 KB, patch)
2015-09-03 09:20 UTC, Mason James
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Mason James 2014-04-21 20:19:33 UTC
Sometimes zebra indexing will fail when the filesystem of the /tmp dir is too small for the indexing temp file

ie: a 20 gig temp file is needed, and /tmp is only 1 gig :(

...in this situation, it is necessary to tell rebuild_zebra.pl to use a different filesystem with the required space.


this patch aims to provide this functionality
Comment 1 Mason James 2015-09-03 09:20:54 UTC
Created attachment 42279 [details] [review]
Bug 12120: Add --tempdir arg to rebuild_zebra.pl

Sometimes zebra indexing will fail when the filesystem of the /tmp dir is too small for the indexing temp file
ie: a 20 gig temp file is needed, and /tmp is only 1 gig :(

in this situation, it is necessary to tell rebuild_zebra.pl to use a different filesystem with the required space.

Test plan...
run 3 zebra indexing tests, with different args

1/ test an index, with no args
 $ sudo koha-shell -c ' /home/mason/git/koha/master/misc/migration_tools/rebuild_zebra.pl -b -v -z'  koha1  |  grep 'export directory'
 the export directory /tmp/jp1d1RmCzL has been deleted.

2/ test an index, with a --tempdir arg
 $ sudo koha-shell -c ' /home/mason/git/koha/master/misc/migration_tools/rebuild_zebra.pl -b -v -z --tempdir /tmp1/aa1'  koha1 |  grep 'export directory'
 the export directory /tmp1/aa1/FEOKJIzPcA has been deleted.

3/ test an index, with both --tempdir and -d (directory) args
 $ sudo koha-shell -c ' /home/mason/git/koha/master/misc/migration_tools/rebuild_zebra.pl -b -v -z --tempdir /tmp1/aa1 -d  bb1' koha1 | grep 'export directory'
 the export directory /tmp1/aa1/bb1 has been deleted.

Note that the 'export directory' path is as expected, for each test run
Comment 2 Mark Tompsett 2016-02-11 05:33:08 UTC
mtompset@debian:~/kohaclone$ git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
mtompset@debian:~/kohaclone$ git branch -D bug_12120
Deleted branch bug_12120 (was 134a7f2).
mtompset@debian:~/kohaclone$ git checkout -b bug_12120 origin/master
Branch bug_12120 set up to track remote branch master from origin.
Switched to a new branch 'bug_12120'
mtompset@debian:~/kohaclone$ git bz apply 12120
Bug 12120 - Add --tempdir arg to rebuild_zebra.pl

42279 - Bug 12120: Add --tempdir arg to rebuild_zebra.pl

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 12120: Add --tempdir arg to rebuild_zebra.pl
mtompset@debian:~/kohaclone$ ./misc/migration_tools/rebuild_zebra.pl -b -a -r -v --tempdir /tmp/a/b/c/d/e/f/g
Error in tempdir() using /tmp/a/b/c/d/e/f/g/XXXXXXXXXX: Parent directory (/tmp/a/b/c/d/e/f/g) does not exist at ./misc/migration_tools/rebuild_zebra.pl line 160.
mtompset@debian:~/kohaclone$