mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-05 16:10:43 +00:00
## Summary Design at: #11532 Closes [#11532](https://github.com/openobserve/openobserve/issues/11532). Adds a new reset component so operators can re-run compaction over a stream's historical file_list: ``` ./openobserve reset -c file-list-jobs [-t <microseconds>] ``` The command performs three things: 1. **Safety check** — calls `infra::cluster::list_nodes()` and aborts with an error if any dedicated compactor node is online (the operator must stop them first). If a `single_node` (Role::All) node is online, prints a warning that it must be restarted after the reset so its in-memory compact state is cleared. 2. **Reset compact offsets** — `db::compact::files::reset_offset(time)` lists every `/compact/files/` key in meta and rewrites its value to `time` (defaulting to `0`), then clears the in-process offset cache. 3. **Re-queue jobs** — calls `infra_file_list::set_job_pending(&[])`, which now treats an empty ids slice as "reset all rows", flipping every `file_list_jobs` row back to `Pending` and clearing `node`, `started_at`, `updated_at`. `set_job_pending` previously returned `Result<()>`; it now returns `Result<u64>` so callers (and the new CLI output) can report rows affected. The existing call site in `service/compact/mod.rs` is unaffected because it ignores the Ok value. ## Test plan - [x] `./openobserve reset -c file-list-jobs` against a stack with no compactor running — verify offsets are 0 and all jobs are Pending - [x] `./openobserve reset -c file-list-jobs -t 1700000000000000` — verify offsets are written as the supplied microsecond timestamp - [x] Run while a compactor is online — verify the command errors with the offending node name - [x] Run on a single_node deployment — verify the warning is shown and operation still completes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>