Skip to content

Commit

Permalink
remove all $gc_tune default values
Browse files Browse the repository at this point in the history
Solr provides it's own default values in it's `bin/solr` startup
script. So instead of duplicating these default values, which may
or may not work depending on the Solr/Java version, we just rely
on the default values that are provided by Solr from now on.
  • Loading branch information
fraenki committed Apr 4, 2024
1 parent 13189f1 commit 6cae7f1
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Added
- Add new parameter `$jetty_host`

### Changed
- Remove all `$gc_tune` default values

## [4.0.0] - 2024-04-03

### Added
Expand Down
10 changes: 1 addition & 9 deletions data/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,7 @@ solr::extract_dir: '/opt'
solr::gc_log_opts:
- '-verbose:gc'
- '-Xlog:gc'
solr::gc_tune:
- '-XX:NewRatio=3'
- '-XX:SurvivorRatio=4'
- '-XX:TargetSurvivorRatio=90'
- '-XX:MaxTenuringThreshold=8'
- '-XX:ConcGCThreads=4'
- '-XX:ParallelGCThreads=4'
- '-XX:PretenureSizeThreshold=64m'
- '-XX:+ParallelRefProcEnabled'
solr::gc_tune: []
solr::java_home: ~
solr::java_mem: '-Xms512m -Xmx512m'
solr::jetty_host: ~
Expand Down
21 changes: 21 additions & 0 deletions spec/classes/solr_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,27 @@

it { is_expected.to contain_file('/var/solr/solr.in.sh').with_content(%r{SOLR_JETTY_HOST="10.1.2.3"}) }
end

context 'solr class when gc_tune is empty' do
let(:params) do
{
version: '9.4.1',
}
end

it { is_expected.to contain_file('/var/solr/solr.in.sh').without_content(%r{GC_TUNE=}) }
end

context 'solr class when gc_tune is not empty' do
let(:params) do
{
gc_tune: ['-XX:+UseG1GC'],
version: '9.4.1',
}
end

it { is_expected.to contain_file('/var/solr/solr.in.sh').with_content(%r{GC_TUNE="-XX:\+UseG1GC"}) }
end
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion templates/solr.in.sh.epp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ SOLR_JAVA_MEM="<%= $solr::java_mem %>"
GC_LOG_OPTS="<%= $solr::gc_log_opts.join(' ') %>"
<% } -%>

<% if $solr::gc_tune {-%>
<% if $solr::gc_tune and !empty($solr::gc_tune) {-%>
# Enable custom GC settings
GC_TUNE="<%= $solr::gc_tune.join(' ') %>"
<% } -%>
Expand Down

0 comments on commit 6cae7f1

Please sign in to comment.