Skip to content

Commit

Permalink
DOCKER-442 upgrade solr backup and add verfication for index.properti…
Browse files Browse the repository at this point in the history
…es before startup restore
  • Loading branch information
hechmi-dammak-xenit committed Nov 28, 2023
1 parent 29850c1 commit a22c7d5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion xenit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ subprojects {
ext {
alfredTelemetryVersion = '0.10.1'
actuatorsVersion = '0.0.7'
solrBackupVersion = '0.0.8'
solrBackupVersion = '0.0.9'
composeDir = "${rootProject.projectDir}/src/integrationTest/resources";
// atm test without ssl enabled
tests_use_ssl = false
Expand Down
22 changes: 13 additions & 9 deletions xenit/solr6/local/93-restore-from-backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,22 @@ echo "Solr restore from backup start"
if [ -z "${RESTORE_FROM_BACKUP}" ]; then
echo "No index backup restore requested, exiting"
else
# Check if the directory exists
if [ -d "${SOLR_DATA_ROOT}/index/alfresco/index" ]; then
# Check if the directory size is greater than 100 kilobytes
if [ "$(du -s "${SOLR_DATA_ROOT}/index/alfresco/index" | cut -f 1)" -gt 100 ]; then
echo "Index folder exists and is sufficiently large, skipping backup restore"
# Check if the index properties file exists , it means previous restore already happened
if [ ! -e "${SOLR_DATA_ROOT}/index/alfresco/index.properties" ]; then
echo "index.properties file doesn't exists proceeding with further verification"
# Check if the directory exists
if [ -d "${SOLR_DATA_ROOT}/index/alfresco/index" ]; then
# Check if the directory size is greater than 100 kilobytes
if [ "$(du -s "${SOLR_DATA_ROOT}/index/alfresco/index" | cut -f 1)" -gt 100 ]; then
echo "Index folder exists and is sufficiently large, skipping backup restore"
else
startRestore
fi
else
# Directory does not exist
echo "Index folder does not exist, proceeding with backup restore"
startRestore
fi
else
# Directory does not exist
echo "Index folder does not exist, proceeding with backup restore"
startRestore
fi
fi

Expand Down
3 changes: 1 addition & 2 deletions xenit/solr6/local/solr.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<solr>
<str name="adminHandler">${adminHandler:org.alfresco.solr.AlfrescoCoreAdminHandler}</str>

<backup>
<repository name="s3" class="eu.xenit.solr.backup.s3.S3BackupRepository" default="false">
<str name="s3.bucket.name">${S3_BUCKET_NAME:test-bucket}</str>
Expand All @@ -11,7 +10,7 @@
<str name="s3.secret.key">${S3_SECRET_KEY:}</str>
<str name="s3.proxy.host">${S3_PROXY_HOST:}</str>
<int name="s3.proxy.port">${S3_PROXY_PORT:0}</int>
<bool name="s3.path.style.access.enabled">${S3_PATH_STYLE_ACCESS_ENABLED:false}</bool>
</repository>

</backup>
</solr>

0 comments on commit a22c7d5

Please sign in to comment.