Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
krudometkin opened this issue Oct 15, 2023 · 1 comment
Open

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

krudometkin opened this issue Oct 15, 2023 · 1 comment

Comments

@krudometkin
Copy link

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

@oalbrigt
Copy link
Contributor

That makes sense. I have no idea why it would need to be force-exported in the first place.

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

No branches or pull requests

2 participants