Skip to content

Solr backups - #1418

Open
amywieliczka wants to merge 24 commits into
mainfrom
solr-backups
Open

amywieliczka wants to merge 24 commits into
mainfrom
solr-backups

Conversation

@amywieliczka

@amywieliczka amywieliczka commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

This is finally "ready for review" but we should be careful about actually merging this in. Rough order of operations - starting in on experimentation with cinco-stage cluster.

  1. once this all looks good (before merging here), run the git-filter-repo on this branch, push this branch up to cinco-solr and create a PR in that repository too, then merge here
  2. update the solr build spec to read from the cinco-solr repository
  3. build a new solr image from the cinco-solr repository (but don't deploy anywhere!)
  4. add security group permissions for the solr task role to talk to our s3 bucket
  5. backup the solr leader (this will, by default, backup to our EFS)
  6. manually install the AWS CLI on our running solr leader instances and copy the backup from EFS to S3
  7. start a new solr follower container using the new solr image (and added env vars), restore from the manual backup in s3
  8. initiate downtime on the solr leader
  9. start a new solr leader container using the new solr image (and added env vars)
  10. delete arclight/solr folder in this repo, update docker-compose-all to build an image from the cinco-solr repo

@amywieliczka
amywieliczka force-pushed the solr-backups branch 2 times, most recently from 60ec770 to 963f556 Compare September 23, 2026 18:41
Comment thread arclight/solr/solr.xml Outdated
Comment thread docker-compose-all.yaml Outdated
Comment thread docker-compose-all.yaml Outdated
Comment thread docker-compose-all.yaml
Comment thread arclight/solr/leader-backup Outdated

@barbarahui barbarahui left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README is great, very clear!

Phew, it took me a while to wrap my head around all of this. Your README answered all my "huh?" questions though.

Comment thread arclight/solr/README.md

1. Eventbridge Scheduler > Run Task > One-Off ECS Task with security group permissions allowing requests to http://solr-leader:8983/solr/arclight/replication?command=backup API endpoint. The ArcLight image already has this security group...we could add a leader-backup script to that image and override the entrypoint command? Seems odd that the ArcLight image would have the solr backup script, though. We could also put the solr backup script in the solr image and override the entrypoint on the solr image so that solr never starts, and use that container to query the Solr leader's replication API. There must already be a security group allowing arbitrary Solr containers to query the Solr leader's replication API (perhaps auto-magically already handled by the ECS App Mesh).
2. Cron sidecar container defined in the task definition with network permissions to hit http://solr-leader:8983/solr/arclight/replication? endpoint - in awsvpc mode (which we already use), there are no further special permissions necessary - all containers in a single task definition have the same `localhost` handled by ECS magic.
3. (Currently Implemented) Running cron on the Solr container itself. Involves some trickiness regarding starting the container as root so we can start cron as root and then dropping into the Solr user to run Solr. Also some trickiness regarding backup script output tailed into the solr logs themselves. But also this kind of seems like the right place for it? This was definitely the easiest to develop, since I can run this setup locally in docker with minio, and it doesn't depend on any AWS or ECS features. Typically, running cron on a container doesn't make sense, but in this specific case, since we only ever have a maximum of 1 leader and Solr's lockfile forces us to fully spin it down before starting up a new leader, it is also safe - there's no race cases between crons on different containers.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do like the fact that this doesn't depend on any AWS features. Especially since you've already worked out the tricky bits, this seems like a fine solution to me. Thanks for laying out the other options -- if we run into problems with this approach then we can always try another.

@amywieliczka
amywieliczka marked this pull request as ready for review October 6, 2026 19:14

@bibliotechy bibliotechy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. A few minor things to verify and maybe update, but overall, I'm excited to see this merged!

Comment thread arclight/solr/cinco-docker-entrypoint.sh Outdated
Comment thread arclight/solr/cinco-docker-entrypoint.sh Outdated
Comment thread arclight/solr/leader-backup.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants