feat: Add FlushPicker to flush regions periodically (#1559)

* feat: Add FlushPicker

* feat(storage): Add close to StorageEngine

* style(storage): fix clippy

* feat(storage): Close regions in StorageEngine::close

* chore(storage): Clear requests on scheduler stop

* test(storage): Test flush picker

* feat(storage): Add metrics for auto flush

* feat(storage): Add flush reason and record it in metrics

* feat: Expose flush config

docs(config): Update config example

* refactor(storage): Run auto flush task in FlushScheduler

* refactor(storage): Add FlushItem trait to make FlushPicker easy to test
This commit is contained in:
Yingwen
2023-05-15 17:29:28 +08:00
committed by GitHub
parent 497b1f9dc9
commit 8d54d40b21
32 changed files with 606 additions and 66 deletions

View File

@@ -52,6 +52,15 @@ gc_duration = '30s'
# Whether to try creating a manifest checkpoint on region opening
checkpoint_on_startup = false
# Storage flush options
[storage.flush]
# Max inflight flush tasks.
max_flush_tasks = 8
# Default write buffer size for a region.
region_write_buffer_size = "32MB"
# Interval to auto flush a region if it has not flushed yet.
auto_flush_interval = "1h"
# Procedure storage options, see `standalone.example.toml`.
[procedure]
max_retry_times = 3

View File

@@ -117,6 +117,15 @@ gc_duration = '30s'
# Whether to try creating a manifest checkpoint on region opening
checkpoint_on_startup = false
# Storage flush options
[storage.flush]
# Max inflight flush tasks.
max_flush_tasks = 8
# Default write buffer size for a region.
region_write_buffer_size = "32MB"
# Interval to auto flush a region if it has not flushed yet.
auto_flush_interval = "1h"
# Procedure storage options.
[procedure]
# Procedure max retry time.