You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/users/reference/env_variables.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,7 @@ process.
48
48
|`FOREST_STATE_MIGRATION_DB_WRITE_BUFFER`| non-negative integer | 10000 | 100000 | The size of db write buffer for state migration (`~10MB` RAM per `10k` buffer) |
49
49
|`FOREST_SNAPSHOT_GC_INTERVAL_EPOCHS`| non-negative integer | 20160 | 8000 | The interval in epochs for scheduling snapshot GC |
50
50
|`FOREST_SNAPSHOT_GC_CHECK_INTERVAL_SECONDS`| non-negative integer | 300 | 60 | The interval in seconds for checking if snapshot GC should run |
51
+
|`FOREST_SNAPSHOT_GC_KEEP_STATE_TREE_EPOCHS`| non-negative integer | 2000 | 20160 | The number of most recent epochs of state trees to keep after GC |
51
52
|`FOREST_DISABLE_BAD_BLOCK_CACHE`| 1 or true | empty | 1 | Whether or not to disable bad block cache |
52
53
|`FOREST_ZSTD_FRAME_CACHE_DEFAULT_MAX_SIZE`| positive integer | 268435456 | 536870912 | The default zstd frame cache max size in bytes |
53
54
|`FOREST_JWT_DISABLE_EXP_VALIDATION`| 1 or true | empty | 1 | Whether or not to disable JWT expiration validation |
Copy file name to clipboardExpand all lines: src/db/gc/snapshot.rs
+14-1Lines changed: 14 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -100,7 +100,20 @@ where
100
100
let chain_data_path = chain_path(config);
101
101
let db_root_dir = db_root(&chain_data_path)?;
102
102
let car_db_dir = db_root_dir.join(CAR_DB_DIR_NAME);
103
-
let recent_state_roots = config.sync.recent_state_roots;
103
+
let recent_state_roots = std::env::var("FOREST_SNAPSHOT_GC_KEEP_STATE_TREE_EPOCHS")
104
+
.ok()
105
+
.and_then(|i| {
106
+
i.parse().ok().and_then(|i| {
107
+
if i >= config.sync.recent_state_roots{
108
+
tracing::info!("Snapshot GC is set to keep {i} epochs of state trees");
109
+
Some(i)
110
+
}else{
111
+
tracing::warn!("Snapshot GC cannot to be set to keep {i} epochs of state trees, at least {} is required for snapshot export", config.sync.recent_state_roots);
0 commit comments