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-helm/k8s-1.35 |
|
/test ci/centos/mini-e2e/k8s-1.35 |
|
/test ci/centos/mini-e2e/k8s-1.37/nvmeof |
Pull request has been modified.
|
/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. |
replace the print debug about adding listeners into `ensureSubsystem()`. and print only if they were created now. Signed-off-by: gadi-didi <gadi.didi@ibm.com>
The idea is moving that quey from `CreateVolume` to `PublishVolume` when the test-pod is applied, because GWs can scale down\up during their lifetime. So if we rely on list listener from volume context, it will not be up yo date. list listener query until now was running only in case of `networkMask` was provided in the StorageClass. now we run list listener everytime in `PublishVolume`, even if listeners list was provided in the StorageClass. after this change, the nodeserver will search in publish context the listeners list (as he searches for hostnqn) I changed it, because SC is immutable. we dont want deal with remove\recreate it. After this, the best way to define storage class will be just with networkmask (which defines for the nvmeof csi to create that subsystem with auto listeners- means the nvmeof GWs scan that network and look for avilable GWs(=listeners) in that subnet. Signed-off-by: gadi-didi <gadi.didi@ibm.com>
now , listeners will be located in `publishContext`. Signed-off-by: gadi-didi <gadi.didi@ibm.com>
Document the cahnge with `listlistener` query in the pending release notes for v3.18. Signed-off-by: gadi-didi <gadi.didi@ibm.com>
add add networkMask param in nvmeof StorageClass, and mark listener list as an optional param. User can use either `networkMask` xor `listeners` Signed-off-by: gadi-didi <gadi.didi@ibm.com>
Add a useNetworkMask flag to createNVMeoFStorageClass so the first test exercises the networkMask path (auto-discovered listeners via subnet scan) instead of an explicit listener list. The network mask is derived at runtime from the pod-network CIDR of the node hosting the gateway Pod. All other tests continue using the explicit listeners path. The storageclass.yaml template already carries networkMask, so the listeners path now explicitly deletes that key to satisfy the controller's XOR validation. Signed-off-by: gadi-didi <gadi.didi@ibm.com>
network mask feature was added in tentacle 9.1+. 9.0 does not include it. Signed-off-by: gadi-didi <gadi.didi@ibm.com>
c39c863 to
92c1a7e
Compare
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