nvmeof: Move listener discovery from CreateVolume to ControllerPublishVolume - #6483
nvmeof: Move listener discovery from CreateVolume to ControllerPublishVolume#6483gadididi wants to merge 7 commits into
Conversation
nixpanic
left a comment
There was a problem hiding this comment.
please add a note to PendingReleaseNotes.md and update the documentation/examples, mentioning that the listeners in the StorageClass is optional.
efc2b0b to
f92a7e1
Compare
d0cbbff to
08b1451
Compare
|
some nit, @nixpanic in |
| "port": "4420", | ||
| "hostname": "cephnvme-vm9" | ||
| }] | ||
| # Listener discovery: specify EITHER listeners OR networkMask (XOR),not both. |
There was a problem hiding this comment.
can we have check to ensure if both are set we are rejecting the request in CreateVolume?
There was a problem hiding this comment.
I already have it here:
ceph-csi/internal/nvmeof/controller/controllerserver.go
Lines 532 to 556 in f4ce351
| return nil, fmt.Errorf("failed to list auto-created listeners: %w", err) | ||
| } | ||
| currentListeners := nvmeof.ConvertListenersFromProto(autoListeners.GetListeners()) | ||
| log.DebugLog(ctx, "Retrieved %d auto-created listeners", len(currentListeners)) |
There was a problem hiding this comment.
we are already logging this in line 1042, can we remove this debug log?
08b1451 to
419aaf1
Compare
419aaf1 to
d1b922a
Compare
|
@mergify rebase |
🛑 The pull request rule doesn't match anymoreDetailsThis action has been cancelled. |
d1b922a to
4caecb6
Compare
|
Use the |
|
/test ci/centos/mini-e2e/k8s-1.35 |
|
/test ci/centos/mini-e2e/k8s-1.37/nvmeof |
|
/test ci/centos/mini-e2e/k8s-1.35 |
|
@mergify rebase |
🛑 The pull request rule doesn't match anymoreDetailsThis action has been cancelled. |
b014111 to
c39c863
Compare
|
/test ci/centos/mini-e2e/k8s-1.37/nvmeof |
|
@nixpanic @Madhu-1 I think it is ready for rereview.
thanks both for your help 🙂 |
|
@mergify rebase |
🛑 The pull request rule doesn't match anymoreDetailsThis action has been cancelled. |
c39c863 to
92c1a7e
Compare
|
@mergify rebase |
🛑 The pull request rule doesn't match anymoreDetailsThis action has been cancelled. |
92c1a7e to
e0ff853
Compare
| - name: CEPH_ARGS | ||
| value: --mon-host $(CEPH_MON_HOST) --keyring /etc/ceph/keyring | ||
| image: quay.io/ceph/nvmeof:1.5 | ||
| image: quay.io/ceph/nvmeof:1.6 |
There was a problem hiding this comment.
"tentacle 9.1+" and "9.0" are not upstream Ceph versions, please correct the commit message.
network mask feature was added in nvmeof gw version 1.6+. 1.5 does not include it. Signed-off-by: gadi-didi <gadi.didi@ibm.com>
e0ff853 to
9550aa8
Compare
|
@mergify rebase |
❌ This pull request comes from a fork and cannot be rebasedDetailsGitHub refuses an OAuth token on its rebase API for a fork, so rebasing one means impersonating a GitHub user to force-push the contributor's branch. Mergify does not do that. Use the |
|
@mergify rebase |
❌ This pull request comes from a fork and cannot be rebasedDetailsGitHub refuses an OAuth token on its rebase API for a fork, so rebasing one means impersonating a GitHub user to force-push the contributor's branch. Mergify does not do that. Use the |
|
@Mergifyio update |
❌ Pull request can't be updated with latest base branch changesDetailsThis pull request seems to come from a fork, and Mergify needs the author's permission to update its branch. |
| nmParams := map[string]string{"pool": nvmeofPool} | ||
| nmPolicy := v1.PersistentVolumeReclaimDelete | ||
| createNVMeoFStorageClass(f, nmSCName, nmOptions, nmParams, nmPolicy, true) | ||
| ginkgo.DeferCleanup(deleteNVMeofStorageClass, f, nmSCName) |
There was a problem hiding this comment.
should we use ginkgo.DeferCleanup() in more places instead of just defer?
Listeners are now fetched at
ControllerPublishVolumetime instead of atCreateVolumetime.Previously, auto-created listeners were queried once in
createNVMeoFResources(duringCreateVolume) and stored involumeContext. SincevolumeContextis immutable for the life of the volume, this list could go stale if gateways are scale down\up after provisioning..The query itself (list listener) was racing the gateway's beacon sync on first creation (it comes from the monitor client).
There was first approach to fix it with retry- #6038 - but that PR was not merged, because it was just workaround.
This moves the query to
ControllerPublishVolume, via a newreconcileListenersfunction, so listeners are fetched fresh on every publish/attach rather than once at creation.publishResourcesnow returns bothHostNQNandListeners(via a newPublishResultstruct), andpopulatePublishContextwrites the reconciled listeners intopublishContextinstead of leaving them involumeContext.The node plugin (
getNvmeConnection) now reads listeners frompublishContextinstead ofvolumeContextto match.If the fresh listener query fails during publish,
publishResourcesfalls back to the listeners stored involumeContextat creation time rather than failing the call outright.Depends-on: #6483