fix: guard manual rewind application

This commit is contained in:
2026-05-29 12:05:33 +09:00
parent f8881f7289
commit cbb59a47d0
4 changed files with 154 additions and 25 deletions
+8 -1
View File
@@ -797,7 +797,7 @@ async fn controller_loop<C, St>(
target,
expected_head_entries,
} => match shared_state.get_status() {
PodStatus::Idle | PodStatus::Paused => {
PodStatus::Idle => {
if apply_rewind(&mut pod, &event_tx, target, expected_head_entries) {
shared_state.set_status(PodStatus::Idle);
let _ = event_tx.send(Event::Status {
@@ -805,6 +805,13 @@ async fn controller_loop<C, St>(
});
}
}
PodStatus::Paused => {
let _ = event_tx.send(Event::Error {
code: ErrorCode::InvalidRequest,
message: "Cannot apply rewind while the Pod is paused; resume or wait for idle first"
.into(),
});
}
PodStatus::Running => {
let _ = event_tx.send(Event::Error {
code: ErrorCode::AlreadyRunning,