Repository navigation
Conversation
failed_and_migrated says a device's data was moved elsewhere and its place in the cluster given up; a replacement enters as a new record (new_device_from_failed). Nothing enforced that. device_set_state treated only "failed" as a state with restricted exits, and the node monitor's re-admit of a recovered node's devices skipped the online, removed and failed ones and set every other device ONLINE. On the lab a node was marked unreachable for a moment while a peer restarted, and was cleared back to ONLINE. The monitor set the three devices of that node that had been migrated out ONLINE again. SPDK could open none of them, each was walked through unavailable to removed, and with the peer still restarting the cluster was suspended and client IO failed. device_set_state now refuses every transition out of failed_and_migrated, whatever the cause, and the re-admit names the states it leaves alone, failed_and_migrated and new (a device that is not part of the cluster yet) among them. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
failed_and_migratedmeans a device's data was moved elsewhere and its place in the cluster given up. A replacement enters as a new device record (new_device_from_failed); the old record is not meant to come back. Nothing enforced that:device_set_staterestricted the exits offailedonly.storage_node_monitor.readmit_devices_after_node_online, which runs when a node is cleared from UNREACHABLE/DOWN back to ONLINE, skipped devices that wereonline,removedorfailedand set every other device ONLINE, includingfailed_and_migratedandnewones.What happened on the lab
3 nodes, 1+1, fio running. Several devices had been failed and migrated out earlier. While one node was restarting, another was marked unreachable for a moment and then cleared back to ONLINE:
The drives were not there, SPDK could open none of them, and with the peer still restarting the cluster was suspended and fio failed.
Fix
device_set_staterefuses every transition out offailed_and_migrated, whatever the cause. The record also no longer walks toremovedwhen a removal event arrives for it._NOT_READMITTED):online,removed,failed,failed_and_migratedandnew. Anewdevice is not part of the cluster yet and has no place in the cluster map to be re-admitted to.Tests
tests/integration/test_failed_and_migrated_is_final.py, against the real database: the re-admit touches only the device the outage made unavailable; no state and no cause takes a device out offailed_and_migrated;failedstill reachesfailed_and_migrated; a forced remove leaves the record as it is.Unit tier locally: no new failures against
main. The integration tier needs Docker and was not run locally; CI runs it.Systemic cause
Device states are guarded by per-state
ifblocks indevice_set_stateand by exclusion lists at the callers. A state nobody listed is writable from everywhere, and a caller that lists what to skip silently includes every state added later. A durable fix is one table of allowed transitions (from, to, cause) thatdevice_set_stateconsults, with callers stating which states they act on instead of which they skip. Not done here.🤖 Generated with Claude Code