Skip to content

resource-agents/heartbeat/ZFS - '-f' to option #1894

Open
@krudometkin

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions