feat(docker): tunable Solr heap via SOLR_HEAP (mendelu, 9.1)#1346
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
This PR makes the Solr JVM heap size configurable in the 9.x docker-compose-rest.yml stack by explicitly forwarding SOLR_HEAP through runuser into solr-foreground, with a default of 4g when unset. This aligns the 9.x Solr heap default with the existing 7.x fleet behavior referenced in #1309, while still allowing operators to override it via .env.
Changes:
- Update the Solr container startup command to run
solr-foregroundwithSOLR_HEAP="${SOLR_HEAP:-4g}"passed viaenvunderrunuser. - Establish an explicit default heap of
4gfor 9.x whenSOLR_HEAPis not provided.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Problem
On DSpace 9.x (
customer/mendelu, 9.1) 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/jcu(9.3).Make Solr heap tunable via SOLR_HEAP (default 4g, no behavior change) #1309 + dataquest-dev/dspace-customers#746.