ClusterLabs / ClusterLabs/resource-agents
resource-agents/heartbeat/ZFS - '-f' to option
- Dominant language
- Shell
- Stars
- 519
- Forks
- 608
- Avg merge
- 6d 1h
- Merged PRs (30d)
- 7
Description
Hello,
I think it's a good idea to create an additional option for "-f" flag in zpool_export method, because "This may lead to potential data corruption.". Not all cases require force the export of ZFS pools.
```
zpool_export () {
if zpool_is_imported; then
ocf_log debug "${OCF_RESKEY_pool}:starting export"
# -f : force the export, even if we have mounted filesystems
# Please note that this may fail with a "busy" error if there are
# other kernel subsystems accessing the pool (e.g. SCSI targets).
# Always make sure the pool export is last in your failover logic.
if zpool export -f "$OCF_RESKEY_pool" ; then
ocf_log debug "${OCF_RESKEY_pool}:export successful"
return $OCF_SUCCESS
else
ocf_log debug "${OCF_RESKEY_pool}:export failed"
return $OCF_ERR_GENERIC
fi
fi
}
```
Regards, Konstantin
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the resource agent that defines the shown zpool_export() function and read its existing option handling. Determine how an option should control the -f flag, including the intended default behavior, then check whether the repository has relevant resource-agent tests. Done means force export behavior is configurable without changing unrelated pool handling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- infrastructure
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100