Skip to content

Commit

Permalink
correct segment count check for catalog solr
Browse files Browse the repository at this point in the history
  • Loading branch information
rrotter committed Feb 27, 2024
1 parent 0de0935 commit 5ad7895
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions spec/classes/profile/hathitrust/solr6/catalog_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
.with_content(%r|curl -A SOLR -s --retry 5 --fail https://babel.hathitrust.org/flags/web/catalog-release-|)
.with_content(%r{babel.hathitrust.org:443:6.5.4.3})
.with_content(%r|SEGMENTS=`ls \${BASE}/cores/\${s}/\${SNAP}/data/index/|)
.with_content(%r|if \[ \${SEGMENTS} -eq 0 \];|)
.without_content(%r(if \[ \${SEGMENTS} -lt 1 \] \|\| \[ \${SEGMENTS} -gt 2 \];))
.with_content(%r|rm -f \${SYMLINKBASE}/\${s} && ln -s \${BASE}/cores/\${s}/\${SNAP} \${SYMLINKBASE}/\${s}$|)
.with_content(/^# run the first query to initialize catalog solr$/)
.with_content(/^## run the first query to initialize lss solr$/)
Expand Down
2 changes: 2 additions & 0 deletions spec/classes/profile/hathitrust/solr6/lss_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
.with_content(%r|curl -A SOLR -s --retry 5 --fail https://babel.hathitrust.org/flags/web/lss-release-|)
.with_content(%r{babel.hathitrust.org:443:5.4.3.2})
.with_content(%r|SEGMENTS=`ls \${BASE}/cores/\${s}/\${SNAP}/core-\${s}x/data/index/|)
.without_content(%r|if \[ \${SEGMENTS} -eq 0 \];|)
.with_content(%r(if \[ \${SEGMENTS} -lt 1 \] \|\| \[ \${SEGMENTS} -gt 2 \];))
.with_content(%r|rm -f \${SYMLINKBASE}/lss-\${s} && ln -s \${BASE}/cores/\${s}/\${SNAP} \${SYMLINKBASE}/lss-\${s}$|)
.with_content(/^## run the first query to initialize catalog solr$/)
.with_content(/^# run the first query to initialize lss solr$/)
Expand Down
3 changes: 2 additions & 1 deletion templates/profile/hathitrust/solr6/index-release.sh.erb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ fi

for s in $CORES; do
SEGMENTS=`ls ${BASE}/cores/${s}/${SNAP}/<%= @core_data_dir_template %>/index/*.fdt | wc -l`
if [ ${SEGMENTS} -lt 1 ] || [ ${SEGMENTS} -gt 2 ]; then
<% if @is_catalog %>if [ ${SEGMENTS} -eq 0 ]; then<% end %>
<% if @is_lss %>if [ ${SEGMENTS} -lt 1 ] || [ ${SEGMENTS} -gt 2 ]; then<% end %>
/bin/echo "at least one core served by `hostname -s` has an improper number of segments...aborting release"
exit 1
fi
Expand Down

0 comments on commit 5ad7895

Please sign in to comment.