feat: add LanceDB version snapshot auto-cleanup#793
Conversation
- Add storageMaintenance.autoCleanup config: - enabled: bool (default false) - intervalHours: int (default 24) - retentionDays: int (default 1) - Add MemoryStore.runMaintenance() to call table.optimize() - Add non-blocking setInterval timer for periodic cleanup - Add JSON schema for new config in openclaw.plugin.json - Closes CortexReach#792
|
Review findings: P1:
P1: accidental The auto-recall path now does a synchronous append to P1: lock
|
Summary
LanceDB stores a new version snapshot on every write operation but never cleans them up. After a few days the database directory grows to 300+ MB despite only ~5-30 MB of actual data.
This PR adds a
storageMaintenance.autoCleanupconfig block that periodically callsTable.optimize()to remove old version snapshots.Config
{ "storageMaintenance": { "autoCleanup": { "enabled": true, "intervalHours": 24, "retentionDays": 1 } } }Changes
storageMaintenance.autoCleanupto plugin config schema (enabled,intervalHours,retentionDays)MemoryStore.runMaintenance(retentionDays)→ callstable.optimize({ cleanupOlderThan })setIntervaltimer inregisterService.start(fires 5 min after startup, then everyintervalHours)Closes #792