Skip to content

Commit

Permalink
Default enable log recycling (#265)
Browse files Browse the repository at this point in the history
* Default enable log recycling.

Signed-off-by: Lucasliang <[email protected]>

* Update changelogs.

Signed-off-by: Lucasliang <[email protected]>

* Tidy the style of changelogs

Signed-off-by: Lucasliang <[email protected]>

* Update changelogs on Behaviors Change part.

Signed-off-by: Lucasliang <[email protected]>

Signed-off-by: Lucasliang <[email protected]>
  • Loading branch information
LykxSassinator authored Aug 31, 2022
1 parent 62a69a8 commit 9751c6d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
* Add `Engine::scan_messages` and `Engine::scan_raw_messages` for iterating over written key-values.
* Add `Engine::get` for getting raw value.

### Behavior Changes

* Change format version to 2 from 1 by default.
* Enable log recycling by default.

## [0.2.0] - 2022-05-25

### Bug Fixes
Expand Down
8 changes: 4 additions & 4 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub struct Config {

/// Version of the log file.
///
/// Default: 1
/// Default: 2
pub format_version: Version,

/// Target file size for rotating log files.
Expand Down Expand Up @@ -88,7 +88,7 @@ pub struct Config {
/// If `true`, logically purged log files will be reserved for recycling.
/// Only available for `format_version` 2 and above.
///
/// Default: false
/// Default: true
pub enable_log_recycle: bool,
}

Expand All @@ -102,13 +102,13 @@ impl Default for Config {
recovery_threads: 4,
batch_compression_threshold: ReadableSize::kb(8),
bytes_per_sync: ReadableSize::mb(4),
format_version: Version::V1,
format_version: Version::V2,
target_file_size: ReadableSize::mb(128),
purge_threshold: ReadableSize::gb(10),
purge_rewrite_threshold: None,
purge_rewrite_garbage_ratio: 0.6,
memory_limit: None,
enable_log_recycle: false,
enable_log_recycle: true,
};
// Test-specific configurations.
#[cfg(test)]
Expand Down
1 change: 1 addition & 0 deletions tests/failpoints/test_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,7 @@ fn test_recycle_with_stale_logbatch_at_tail() {
target_file_size: ReadableSize::kb(2),
purge_threshold: ReadableSize::kb(4),
enable_log_recycle: true,
format_version: Version::V1,
..Default::default()
};
// Force open Engine with `enable_log_recycle == true` and
Expand Down

0 comments on commit 9751c6d

Please sign in to comment.