diff --git a/src/ra.hrl b/src/ra.hrl index 8c85f849..9f106c08 100644 --- a/src/ra.hrl +++ b/src/ra.hrl @@ -189,6 +189,7 @@ %% WAL defaults -define(WAL_DEFAULT_MAX_SIZE_BYTES, 256 * 1000 * 1000). +-define(WAL_DEFAULT_MAX_ENTRIES, 1_000_000). -define(WAL_DEFAULT_MAX_BATCH_SIZE, 8192). -define(MIN_BIN_VHEAP_SIZE, 46422). %% define a minimum allowable wal size. If anyone tries to set a really small diff --git a/src/ra_system.erl b/src/ra_system.erl index 73154b51..4ed31064 100644 --- a/src/ra_system.erl +++ b/src/ra_system.erl @@ -88,7 +88,8 @@ default_config() -> WalComputeChecksums = application:get_env(ra, wal_compute_checksums, true), WalMaxBatchSize = application:get_env(ra, wal_max_batch_size, ?WAL_DEFAULT_MAX_BATCH_SIZE), - WalMaxEntries = application:get_env(ra, wal_max_entries, undefined), + WalMaxEntries = application:get_env(ra, wal_max_entries, + ?WAL_DEFAULT_MAX_ENTRIES), WalWriteStrategy = application:get_env(ra, wal_write_strategy, default), WalSyncMethod = application:get_env(ra, wal_sync_method, datasync), DataDir = ra_env:data_dir(), @@ -113,13 +114,14 @@ default_config() -> ?FLUSH_COMMANDS_SIZE), LowPriorityInMemSize = application:get_env(ra, low_priority_commands_in_memory_size, ?FLUSH_COMMANDS_SIZE), + #{name => default, data_dir => DataDir, wal_data_dir => WalDataDir, wal_max_size_bytes => WalMaxSizeBytes, + wal_max_entries => WalMaxEntries, wal_compute_checksums => WalComputeChecksums, wal_max_batch_size => WalMaxBatchSize, - wal_max_entries => WalMaxEntries, wal_write_strategy => WalWriteStrategy, wal_garbage_collect => WalGarbageCollect, wal_pre_allocate => WalPreAllocate,