feat(docker): tunable Solr heap via SOLR_HEAP (jcu, 9.3)#1347
Conversation
DSpace 9.x launches Solr with `runuser -u solr -- solr-foreground` and no `-m` flag, so the heap was pinned to the image default (512m) with no runtime knob. Forward SOLR_HEAP through runuser so the solr user's environment carries it into solr-foreground, which honours it natively. Default is 4g when SOLR_HEAP is unset, aligning 9.x with the 7.x fleet and source PR #1309. Deliberate default change on 9.x (512m -> 4g). Set SOLR_HEAP in .env to override (e.g. SOLR_HEAP=1g). New feature carved out of the 9.x N/A branches in dataquest-dev/dspace-customers#746. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds a configurable JVM heap setting for the Solr container in the REST Docker Compose stack, allowing operators to tune Solr memory without modifying tracked compose files (defaulting to 4g when unset).
Changes:
- Updates the Solr entrypoint command to explicitly forward
SOLR_HEAPthroughrunuserviaenv. - Introduces a default heap value of
4gwhenSOLR_HEAPis not provided (intentional behavior change vs image default).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Problem
On DSpace 9.x (
customer/jcu, 9.3) the Solr container has no heap knob. It launches viarunuser -u solr -- solr-foregroundwith no-mflag, so Solr falls back to the image defaultheap (512m) and operators can't tune it without editing this tracked compose file. The whole
7.x customer fleet runs 4g (source PR #1309); 9.x had no equivalent.
Carved out of dataquest-dev/dspace-customers#746, which marked the 9.x branches N/A for the
-m 4gbackport (no anchor to translate) and flagged a tunable heap as a separate feature.Root cause
The 9.x Solr entrypoint never passed a heap argument, and
solr-foregroundruns under arunuseruser switch, so no
SOLR_HEAPreached Solr's start scripts.Change set
One line in
docker/docker-compose-rest.yml, the Solr entrypoint's final command:env SOLR_HEAP=…forwards the value explicitly throughrunuserinto thesolruser'senvironment, where
solr-foregroundhonours it natively — no dependence on runuser env passing.${SOLR_HEAP:-4g}from the host/.envat parse time; quoted to surviveword-splitting.
deliberate behavior change on 9.x (image default 512m → 4g). Override with
SOLR_HEAP=1gin
.env. No other line changed.Test evidence
docker compose configrenders the interpolated entrypoint correctly:Risk & rollback
Low. Infra-only, single line. Default heap rises 512m → 4g on 9.x (intended; matches fleet). If a
host lacks 4g, set
SOLR_HEAPlower in.env. Rollback = revert this commit.Notes / assumptions
customer/mendelu(9.1).Make Solr heap tunable via SOLR_HEAP (default 4g, no behavior change) #1309 + dataquest-dev/dspace-customers#746.