diff --git a/spec/classes/redis_spec.rb b/spec/classes/redis_spec.rb index ff204c0a..2af9acca 100644 --- a/spec/classes/redis_spec.rb +++ b/spec/classes/redis_spec.rb @@ -1680,7 +1680,7 @@ class { 'redis': } end - describe 'test rdb-save-incremental-fsync for redis6' do + describe 'test rdb-save-incremental-fsync enabled' do let(:params) do { rdb_save_incremental_fsync: true, @@ -1690,6 +1690,16 @@ class { 'redis': it { is_expected.to contain_file(config_file_orig).with('content' => %r{^rdb-save-incremental-fsync yes$}) } end + describe 'test rdb-save-incremental-fsync disabled' do + let(:params) do + { + rdb_save_incremental_fsync: false, + } + end + + it { is_expected.to contain_file(config_file_orig).with('content' => %r{^rdb-save-incremental-fsync no$}) } + end + describe 'test systemd service timeouts' do let(:params) do { diff --git a/templates/redis.conf.epp b/templates/redis.conf.epp index dd9223d4..3a7b81c2 100644 --- a/templates/redis.conf.epp +++ b/templates/redis.conf.epp @@ -1030,7 +1030,12 @@ aof-rewrite-incremental-fsync <%= bool2str($aof_rewrite_incremental_fsync, 'yes' # the file will be fsync-ed every 32 MB of data generated. This is useful # in order to commit the file to the disk more incrementally and avoid # big latency spikes. -<% if $rdb_save_incremental_fsync { -%>rdb-save-incremental-fsync <%= $rdb_save_incremental_fsync ? {true => 'yes', default => 'no'} %><% } -%> + +<% if $rdb_save_incremental_fsync == undef { %> +#rdb-save-incremental-fsync yes +<% } else { %> +rdb-save-incremental-fsync <%= bool2str($rdb_save_incremental_fsync, 'yes', 'no') %> +<% } %> # Redis Cluster Settings <% if $cluster_enabled { -%>