TP4129 KATO correctoins and clarification
Hi,
The KATO handling in the spec got updated via the TP4129. In short it mandatas that failing requests should be delayed by some value before retried on a different path.
We had some discussion in the past about how to handle failing requests due to timeout or connectivity loss and couldn't really agree on how to handle them. Hopefully, the spec has clarified this topic and I'd like to discusson it and figure out how to implement it. I know Christoph is not particular happy with the TP but maybe there is still something we could do?
Mohamed is working on a patchset and I am also trying to come up with something useful (*). I think we both should be able to post some patches for discussion before the event. Anyway, I think it would be a great opertunity to discuss this topic.
Thanks,
Daniel
(*) Initially I wanted to have something ready for this topic proposal but it's not there yet.
Quoted 5 lines · Daniel Wagner
Hi,
The KATO handling in the spec got updated via the TP4129. In short it mandatas that failing requests should be delayed by some value before retried on a different path.
TP4129 is broken and the TWG has been told that. There is absolutely no point in either implementing it or rehashing the discussion over and over again. Concentrate on making 8028 useful instead. And if you want a discussion, "why do people people push stupid things though the NVMe TWG and then comaplain later about the lack of implementations" might be more useful.
Quoted 7 lines · Christoph Hellwig
Quoted 5 lines · Daniel Wagner
Hi,
The KATO handling in the spec got updated via the TP4129. In short it mandatas that failing requests should be delayed by some value before retried on a different path.
Quoted 6 lines
TP4129 is broken and the TWG has been told that. There is absolutely no point in either implementing it or rehashing the discussion over and over again. Concentrate on making 8028 useful instead. And if you want a discussion, "why do people people push stupid things though the NVMe TWG and then comaplain later about the lack of implementations" might be more useful.
Okay, let's rephrase that to 'Improve NVMe-oF error handling'. We are trying to get TP8028 out into the open until LSF, then we can discuss that and also how to fold in the 'command cancel' patchset into the overall picture.
Cheers,
Hannes
Signature · 4 lines
Dr. Hannes Reinecke Kernel Storage Architect [email protected] +49 911 74053 688 SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
Quoted 15 lines · Hannes Reinecke
Quoted 7 lines · Christoph Hellwig
Quoted 5 lines · Daniel Wagner
Hi,
The KATO handling in the spec got updated via the TP4129. In short it mandatas that failing requests should be delayed by some value before retried on a different path.
Quoted 6 lines
TP4129 is broken and the TWG has been told that. There is absolutely no point in either implementing it or rehashing the discussion over and over again. Concentrate on making 8028 useful instead. And if you want a discussion, "why do people people push stupid things though the NVMe TWG and then comaplain later about the lack of implementations" might be more useful.
Quoted 4 lines
Okay, let's rephrase that to 'Improve NVMe-oF error handling'. We are trying to get TP8028 out into the open until LSF, then we can discuss that and also how to fold in the 'command cancel' patchset into the overall picture.
Yes, that basically was the idea for this proposal. I should have called it differently. 'Improve NVMe-oF error handling' sounds about right.
If there are specific aspects of TP4129 that are broken, I would be interested in learning more about them and how they are broken. If this topic were to be discussed at LSF, that could be part of the conversation. What parts are broken (or cause concern), what the issues are, are there any ideas on how they could be fixed?
Curtis Ballard
Strategist, Storage Technology
Hewlett Packard Enterprise
-----Original Message-----
From: Linux-nvme <[email protected]> On Behalf Of Daniel Wagner
Sent: Friday, January 31, 2025 9:20 AM
To: Hannes Reinecke <[email protected]>
Cc: Christoph Hellwig <[email protected]>; [email protected]; Mohamed Khalfella <[email protected]>; Sagi Grimberg <[email protected]>; John Meneghini <[email protected]>; Randy Jennings <[email protected]>; Keith Busch <[email protected]>; [email protected]
Subject: Re: [LSF/MM/BPF TOPIC] TP4129 KATO correctoins and clarification
Quoted 15 lines · Hannes Reinecke
Quoted 7 lines · Christoph Hellwig
Quoted 5 lines · Daniel Wagner
Hi,
The KATO handling in the spec got updated via the TP4129. In short it mandatas that failing requests should be delayed by some value before retried on a different path.
Quoted 6 lines
TP4129 is broken and the TWG has been told that. There is absolutely no point in either implementing it or rehashing the discussion over and over again. Concentrate on making 8028 useful instead. And if you want a discussion, "why do people people push stupid things though the NVMe TWG and then comaplain later about the lack of implementations" might be more useful.
Quoted 4 lines
Okay, let's rephrase that to 'Improve NVMe-oF error handling'. We are trying to get TP8028 out into the open until LSF, then we can discuss that and also how to fold in the 'command cancel' patchset into the overall picture.
Yes, that basically was the idea for this proposal. I should have called it differently. 'Improve NVMe-oF error handling' sounds about right.
Quoted 1 line · Curtis C (HPE Storage)
If there are specific aspects of TP4129 that are broken, I would be interested in learning more about them and how they are broken.
Serious Curtis, we've been through this a dozen times in the TWG. It just adds another best effort timer that is not better than the one that already is there. But you guys insist on papering over it, an there is no real reason for Linux to adopt that. (despite the pages long John rant).
Quoted 9 lines
Quoted 2 lines · Curtis C (HPE Storage)
If there are specific aspects of TP4129 that are broken, I would be interested in learning more about them and how they are broken.
Serious Curtis, we've been through this a dozen times in the TWG. It just adds another best effort timer that is not better than the one that already is there. But you guys insist on papering over it, an there is no real reason for Linux to adopt that. (despite the pages long John rant).
Thanks for that response Christoph. It is really helpful to understand that the concern is around the timer and the "best effort" aspects. I was aware that concerns had been expressed on whether the timer was reliable and the TWG took those seriously.
Reading between the lines on the term "best effort" I think that the concern is that the timers don't provide a reliable technique to prevent the ghost write data corruption issue that was discussed at LSF last year.
There was quite a bit of work to go through scenarios, and timer processing, to address the concerns that the timer was a "best effort" (to reuse the term) rather than a reliable method. I'm not aware of a scenario where applying the timers, with the process described in TP4129, fails to provide a reliable assurance that it is safe to retry write commands. While it is slower than any of us would like, having a method to prevent the possibility of data corruption seems like a worthy effort.
If there is a scenario where the timer management model described in TP4129 isn't a reliable method of determining that it is safe to retry write commands then we need to do some investigation to see if we can resolve that issue.
I appreciate the comments on TP8028. I don't like how slow the timer method is and really hope that we can continue to work on methods of making NVMe-oF error detection and recovery faster, while maintaining data integrity. The TP8028 effort is what we have in development and I'm optimistic that we'll be able to discuss that model at LSF.
Curtis Ballard
Hewlett Packard Enterprise
Sagi Grimberg
maintainerQuoted 17 lines · Curtis C (HPE Storage)
Quoted 8 lines
Quoted 2 lines · Curtis C (HPE Storage)
If there are specific aspects of TP4129 that are broken, I would be interested in learning more about them and how they are broken.
Serious Curtis, we've been through this a dozen times in the TWG. It just adds another best effort timer that is not better than the one that already is there. But you guys insist on papering over it, an there is no real reason for Linux to adopt that. (despite the pages long John rant).
Thanks for that response Christoph. It is really helpful to understand that the concern is around the timer and the "best effort" aspects. I was aware that concerns had been expressed on whether the timer was reliable and the TWG took those seriously.
Reading between the lines on the term "best effort" I think that the concern is that the timers don't provide a reliable technique to prevent the ghost write data corruption issue that was discussed at LSF last year.
Quoted 5 lines
There was quite a bit of work to go through scenarios, and timer processing, to address the concerns that the timer was a "best effort" (to reuse the term) rather than a reliable method. I'm not aware of a scenario where applying the timers, with the process described in TP4129, fails to provide a reliable assurance that it is safe to retry write commands.
Unless the controller is able to reliably upper bound its abort operation of all inflight commands I can't see how this is 100% reliable. Which will likely mean that a healthy margin is taken such that it will not break in practice.
Quoted 8 lines
While it is slower than
any of us would like, having a method to prevent the possibility of data corruption seems like a worthy effort.If there is a scenario where the timer management model described in TP4129 isn't a reliable method of determining that it is safe to retry write commands then we need to do some investigation to see if we can resolve that issue.
Quoted 5 lines
I appreciate the comments on TP8028. I don't like how slow the timer method is and really hope that we can continue to work on methods of making NVMe-oF error detection and recovery faster, while maintaining data integrity. The TP8028 effort is what we have in development and I'm optimistic that we'll be able to discuss that model at LSF.
I think its reasonable for a subsystem to report the host a failover delay. While it is indeed a "best effort", its most likely sufficient for implementers to never see where it breaks... I just had an issue with prior attempts to make it behavior universal.
I also agree that making quiesce in failover explicit is the best solution. But I don't think we should reject any attempt of making the host respect the controller CQT.
Quoted 8 lines · Sagi Grimberg
Quoted 4 lines
Reading between the lines on the term "best effort" I think that the concern is that the timers don't provide a reliable technique to prevent the ghost write data corruption issue that was discussed at LSF last year.
Unless the controller is able to reliably upper bound its abort operation of all inflight commands I can't see how this is 100% reliable. Which will likely mean that a healthy margin is taken such that it will not break in practice.
Thanks Sagi - I get this view. If an NVM Subsystem takes that approach then the timers will be best effort; though that approach isn't technically spec compliant.
The implementation of CQT could be an area where there is a difference in what is specified and what is implemented (or implementable). The requirement is that the controller "shall" stop command processing and clean up within the time reported as CQT but I know of systems that have corner cases where stopping processing, and cleaning, up can take a very long time. In those cases the storage system vendor ideally would implement some sort of processing barrier but even that can be hard. Some vendors may choose to do exactly what you say and pick a healthy margin such that it is highly unlikely to break in practice.
Vendors will always have the option to implement a design that they feel is "close enough". Sometimes I forget that, even though I've done that myself. Thanks for the reminder.
Curtis
Quoted 9 lines · Sagi Grimberg
Quoted 5 lines
There was quite a bit of work to go through scenarios, and timer processing, to address the concerns that the timer was a "best effort" (to reuse the term) rather than a reliable method. I'm not aware of a scenario where applying the timers, with the process described in TP4129, fails to provide a reliable assurance that it is safe to retry write commands.
Unless the controller is able to reliably upper bound its abort operation of all inflight commands I can't see how this is 100% reliable. Which will likely mean that a healthy margin is taken such that it will not break in practice.
Who said the controller is not able to reliably abort the operations of all inflight commands?
TP4129 doesn't say this.
The whole point of TP4129 is that it provides something that is missing from the KATO protocol. What's missing is exactly what you are asking about: "what's the amount of time the controller needs to reliably abort all inflight commands"?
KATO is a heart beat. It is an error detection mechanism. KATO defines how long the controller needs to wait before making the decision to BEGIN the process of internally aborting all inflight IO. The problem is, the current KATO protocol does not define how long the controller takes to FINISH the process of internally aborting all inflight IO. This is something that is controller specific and this is what CQT was designed to communicate.
The current KATO protocol is broken because is confuses the error detection time with the error recovery time. The idea that a controller "should" have run down all inflight IO by the time KATO is detected is a completely arbitrary assumption. It is an assumption in the KATO specification and it is broken. TP4129 addresses this assumption. It improves and corrects the KATO protocol by providing a mechanism for the controller to communicate to the host what the controller specific error recovery time is through the CQT.
As to whether or not the CQT is reliable... that's not our concern. We have this same issue in other parts of the protocol. For example, the ANA ATT. The ANA Transition Time communicates a Service Level Agreement to the host, and if the the host sees that the ANA state does not finish transitioning within the ATT, the results can be catastrophic. But in that case, the problem is in the controller, not the host.
The same thing is true for the CQT. CQT is a service level agreement. So, if the host replays an IO after CQT, and the controller screws up and corrupts data... not the Host's fault. The problem is the controller. But with out CQT we can't say this. The host will always be suspect. Without a clear protocol that provides a clear SLA, we can't hold things together.
Right now we have NVMe/TCP controllers out there that experience data corruption during their cable pull tests because of this problem. These are shipping products that are supported by VmWare and Microsoft, etc., however, they are not supported by Linux. This problem was root caused and fixed by patches[1] that Hannes proposed back in 2023.
[1] https://lore.kernel.org/linux-nvme/[email protected]/
Sagi, you NAKed these patches. At that time both Hannes and I talked with you about this and we agreed that we would wait for TP4129 to address this problem.
Since that time some ditros have actually shipped these patches, out of tree, and I am told by my storage partners that these patches fixed their data corruption problem. In fact, Red Hat has been asked several times to include these patches in RHEL, but we've been pushing back on our storage partners and telling them to wait for TP4129.
So to be told now that TP4129 is bogus and won't be implemented is more than a little madding.
At the end of the day, I don't care about TP4129. Linux needs to fix the problem. Red Hat is seeing NVMe/TCP adoption begin to pick up. More and more of our customers are trying NVMe/TCP and using NVMe/TCP. If we want NVMe/TCP adoption to continue, we need this data corruption problem to be fixed upstream. If you don't like TP4129, then ACK Hannes's patches.
/John
Quoted 7 lines · Sagi Grimberg
Quoted 6 lines
I appreciate the comments on TP8028. I don't like how slow the timer method is and really hope that we can continue to work on methods of making NVMe-oF error detection and recovery faster, while maintaining data integrity. The TP8028 effort is what we have in development and I'm optimistic that we'll be able to discuss that model at LSF.
Quoted 6 lines
I think its reasonable for a subsystem to report the host a failover delay. While it is indeed a "best effort", its most likely sufficient for implementers to never see where it breaks... I just had an issue with prior attempts to make it behavior universal.
I also agree that making quiesce in failover explicit is the best solution. But I don't think we should reject any attempt of making the host respect the controller CQT.
Good to hear Sagi. Sorry for my rant. I should have read your email to the end before send my response.
/John
Quoted 9 lines · Christoph Hellwig
Quoted 5 lines · Daniel Wagner
Hi,
The KATO handling in the spec got updated via the TP4129. In short it mandatas that failing requests should be delayed by some value before retried on a different path.
TP4129 is broken and the TWG has been told that. There is absolutely no point in either implementing it or rehashing the discussion over and
If by saying "TP4129 is broken" you mean that it is a another timer based mechanism, I think you need to get over it. We are talking about a fabric. And in any fabric the error recovery mechanism of last resort will ALWAYS be a timeout.
And if by saying "the TWG has been told that" you mean that you've expressed YOUR opinion that TP8028 is a better solution than TP4129 because it involves no additional timer, I think you need to get over it again. We all get your opinion but that opinion can't dictate the volition of the industry. TP4129 exists because there is code running out there in controllers that fails to interoperate with Linux. This TP is not some new feature like NVMe/TLS or FDP. TP4129 is a repair to a broken protocol, the KATO protocol.
Quoted 4 lines
over again. Concentrate on making 8028 useful instead. And if you want a discussion, "why do people people push stupid things though the NVMe TWG and then comaplain later about the lack of implementations" might be more useful.
I'm sorry but you are going to have to give us a little more than insults and name calling to convince me that TP4129 is a piece of crap and not worth implementing.
How is it, exactly, that TP4129 is broken?
Before TP4129 the spec said nothing about controller requirements following a timeout and the linux host code assumed it was safe to replay IOs immediately after a keep alive timeout period. This problem is exasperated by the fact that KATO is a negotiable parameter that can be changed by the the user, on the command line, with out regard to any requirement of the controller.
For example, from the v 2.0b spec:
If a Keep Alive Timer expires:
a) the controller shall:
* record an Error Information Log Entry with the status code Keep Alive Timeout Expired,
* stop processing commands;
* set the Controller Fatal Status (CSTS.CFS) bit to ‘1’; and
for message-based NVMe Transports:
- terminate the NVMe Transport connection; and
- break the host to controller association;
and
b) the host assumes all outstanding commands are not completed and re-issues commands as appropriate.
This is one place where the current KATO spec is inadequate. Unlike the FCP standard or FC-NVMe specification the NVMe 2.0 spec. provides no guidance, whatsoever, about how or when commands should be replayed following a keep alive timeout. This was a major defect in the NVMe specification that led to assumptions in both the host and controller implementations we have out there. Those assumptions led to running code in shipping products that fails to interoperate and this is is addressed by TP4129.
For the uninitiated, simply put, TP4129 expands point b) above by providing an optional controller based Command Quiesce Time (CQT) which advises the host how long to wait before replaying any command assumed to be completed following a KATO.
This timer is needed because different storage arrays require a different additional timeout or delay period to abort commands that are internally in-flight following a keep alive timeout. At Red Hat multiple storage array vendors have reported that, while testing the keep alive timeout mechanism, they are experiencing data corruption. These data corruption issues have been tracked down and root caused by more than one distribution to be related to ghost writes inside the storage array following a command that was replayed by the host during a KATO event.
This has been discussed multiple times in the past on the email list. For example here:
https://lore.kernel.org/linux-nvme/[email protected]/
And in many conversations about this on the email list and at LSF/MM in the past it was agreed that we would solve this problem by modifying the NVMe Specification. This is what TP4129 is. We wrote TP4129 specifically to address this ghost write problem and we did so by adding this optional CQT timer mechanism. This optional CQT timer was designed to have the lowest possible impact on the existing KATO mechanism. Only storage arrays which need the addition time following a time out would need to fill in the CQT (which is a new field in the Identify Controller Data Structure). This would allow the host to support both storage arrays that don't need the additional timer, with no impact, and solve the problem of storage arrays that are currently broken because they do need an additional timer. That is what TP4129 did.
As for TP8028, this undisclosed technical proposal will not replace TP4129. Everyone involved in the development of these technical proposals at NVMexpress.org/FMDS has agreed that TP8028 will be an enhancement of TP4129 and that many storage array vendors may not implement it.
Red Hat is currently involved in implementing and testing changes to support TP4129 in collaboration with those vendors. If it can be proven that those changes don't work, or that the CQT timer is not needed, I can agree with Christoph that support for TP4129 may not be needed in the upstream Linux host. However, in the absence of any kind of empirical data that says a CQT timer is not needed, I can't support any arbitrary decision that says we are not going to implement TP4129 or even talk about it. I plan to attend LSF/MM this year and one of my proposed topics is this one. Too many people have been working on this for too long to say that we are not going to talk about it.
Right now the Linux KATO implementation is suffering from all kinds of problems. It needs to be improved and repaired. I see no reason why, as a part of that process, support for a CQT timer can not or should not be implemented and tested in the Linux host. Any way we do this the NVMe keep alive timeout mechanism needs to be there and it remains as the error recovery mechanism of last resort. We need to continue to test and improve the KATO mechanism whether TP4129 is implemented or not.
/John