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

fence_scsi: fix registration handling if ISID conflicts #529

Merged
merged 1 commit into from
Feb 23, 2023

Conversation

smohanan20
Copy link
Contributor

Problem:

ISID (Initiator Session ID) which belongs to I_T Nexus, changes for RHEL based on the session ID that's used for iSCSI connections. This means that the connection to the same device can be set up with different ISID on reconnects.

If an iSCSI client establishes a connection with a device using an ISID (say X) and registers/reserves with the device using a key, the key is associated with the I_T nexus (with ISID X). Now if a device reconnects for some reason (like client reboots), it establishes a new iSCSI connection (with ISID Y) and fence agent tries to register again. However fence_scsi looks up the reservation key for the device, sees that it matches with the key and skips sending a new registration command assuming that the key belongs to it (ignoring the ISID).

Impact:

This can cause the iSCSI initiator to have no access to the device since it is not registered.

Proposed Fix:

To fix this, the agent needs to clear the old registration and register with the device based on what the active state of the registration/reservation is.

  1. If the client holds a reservation, the agent issues a PREEMPT request with the same key. The iSCSI target will replace the old entry with the new entry.
  2. If the client does not hold the reservation, the agent issues a PREEMPT request with the same key to remove the old registration. The agent sends another REGISTER command to register with the new ISID.

Both (1) and (2) are done in accordance with SCSI spec SPC3 - (1) Section 5.6.10.4.3 "Preempting persistent reservations and registration handling" Section and (2) Section 5.6.10.4.4 "Removing registrations".

If the ISID does not change across reboots, the fix has no impact since the preempt will insert a new entry anyway.

ISID (Initiator Session ID) belonging to I_T Nexus changes for
RHEL based on the session ID. This means that the connection to
the device can be set up with different ISID on reconnects.

fence_scsi treats same key as a tip to ignore issuing registration
to the device but if the device was registered using a different
ISID, the key would be the same but the I_T Nexus (new ISID) would
not have access to the device.

Fixing this by preempting the old key and replacing with the current
one.
@knet-ci-bot
Copy link

Can one of the admins verify this patch?

@oalbrigt
Copy link
Collaborator

ok to test

@oalbrigt oalbrigt merged commit bf55c67 into ClusterLabs:main Feb 23, 2023
@oalbrigt
Copy link
Collaborator

Thanks.

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.

None yet

3 participants