Skip to content

Commit 7ab7813

Browse files
committed
docs/oasis-node/cli: Document compact command
1 parent 8ff9ead commit 7ab7813

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

docs/oasis-node/cli.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,3 +331,28 @@ response:
331331
```
332332
oasis1qqncl383h8458mr9cytatygctzwsx02n4c5f8ed7
333333
```
334+
335+
## storage
336+
337+
### compact-experimental
338+
339+
Run
340+
341+
```sh
342+
oasis-node storage compact-experimental --config /path/to/config/file
343+
```
344+
345+
to trigger manual compaction of consensus database instances:
346+
347+
```sh
348+
{"caller":"storage.go:310","level":"info","module":"cmd/storage","msg":"Starting database compactions. This may take a while...","ts":"2025-10-08T09:18:22.185451554Z"}
349+
```
350+
351+
If pruning was not enabled from the start or was recently increased, then even after successful pruning, the disk usage may stay the same.
352+
353+
This is due to the LSM-tree storage design that BadgerDB uses. Concretely, deleting a key only marks it as ready to be deleted (a tombstone entry). The actual removal of the stale data happens later during the compaction.
354+
355+
During normal operation, compaction happens in the background. However, BadgerDB
356+
is intentionally lazy, trading write throughput for disk space among other things. Therefore it is expected that in case of late pruning, the disk space may stay constant or not be reclaimed for a very long time.
357+
358+
This command gives operators manual control to release disk space during maintenance periods.

0 commit comments

Comments
 (0)