Skip to content

Device failover support - #49

Merged
yusufozturk merged 2 commits into
mainfrom
dev-failover-support
Jul 22, 2026
Merged

Device failover support#49
yusufozturk merged 2 commits into
mainfrom
dev-failover-support

Conversation

@yusufozturk

@yusufozturk yusufozturk commented Jul 21, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Bug Fixes
    • Updated cluster configuration validation to recognize cluster.action: device_failover as a supported value.
    • Improved director-cluster correctness handling for device failover, including stronger checks that the device is reassigned and collected by a different node after disruption.
    • Added verification that cluster leadership remains available, with the disrupted node restored afterward.
  • Tests
    • Expanded correctness tests to cover device-level failover behavior and cross-node collection/continuity expectations.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 933757ef-f98d-458f-b2ae-197e29382233

📥 Commits

Reviewing files that changed from the base of the PR and between 85dbfa1 and 2b76b3b.

📒 Files selected for processing (2)
  • internal/config/case.go
  • internal/runner/runner.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • internal/config/case.go
  • internal/runner/runner.go

Walkthrough

Adds device_failover validation and runner support. The flow detects device ownership, verifies baseline collection, stops the owner, confirms reassignment and leadership, restores the node, and records receiver delivery as a soft signal.

Changes

Device failover correctness

Layer / File(s) Summary
Device failover contract and detection
internal/config/case.go, internal/runner/runner.go
Accepts device_failover and adds polling helpers for device ownership and collection-start markers.
Device failover baseline
internal/runner/runner.go
Selects the device-failover path and verifies initial placement and collection while treating receiver delivery as non-gating.
Failover disruption and post-checks
internal/runner/runner.go
Stops and restores the owning node, verifies reassignment and leader presence, and logs receiver-side results as soft signals.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Poem

I’m a rabbit watching devices roam,
A leader keeps the cluster home.
One node rests, another takes flight,
Collection hops to keep things right.
Soft receiver notes trail in the snow—
Failover verified; off we go!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding device failover support.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev-failover-support

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/config/case.go`:
- Line 1251: Update the ClusterConfig.Action contract documentation to include
device_failover, describing its behavior and prerequisites alongside
agentless_failover, while preserving the existing known-action handling in the
case list.

In `@internal/runner/runner.go`:
- Around line 3520-3525: Update the branch contract comment near the generalized
placement-device failover to state that the baseline already sets owner and
receiver delivery is soft, with passed determined by baselineOK and actionOK
rather than delivery; remove the claim that delivery is asserted HARD or that
the branch uses a reliable direct path versus agentless storage.
- Around line 3009-3021: Update waitDeviceCollecting and its baseline/post-stop
callers to bind collection proof to the failed-over placement device. Resolve
the current owner for that specific device, then inspect only that owner’s
container logs and require the device-specific post-disruption collection
marker; do not accept a generic “Starting event collection of” message from
another device. Preserve the existing timeout and cancellation behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6fd61dff-88e4-417c-9bf5-2f95f1d2f15f

📥 Commits

Reviewing files that changed from the base of the PR and between 24f8a59 and 85dbfa1.

📒 Files selected for processing (2)
  • internal/config/case.go
  • internal/runner/runner.go

Comment thread internal/config/case.go
Comment thread internal/runner/runner.go
Comment thread internal/runner/runner.go Outdated
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 22, 2026

Copy link
Copy Markdown

Deploying pipebench with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2b76b3b
Status: ✅  Deploy successful!
Preview URL: https://8cee576f.pipebench.pages.dev
Branch Preview URL: https://dev-failover-support.pipebench.pages.dev

View logs

@yusufozturk
yusufozturk merged commit d57256e into main Jul 22, 2026
5 checks passed
@yusufozturk
yusufozturk deleted the dev-failover-support branch July 22, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant