|
Post by malbolge on Jun 5, 2023 14:52:24 GMT
This comes from RDE but ought to be 100% the same in Redfish. ETag operations, such as match/no-match, allow a Redfish request to be optionally supplied with an ETag. For example, a user may request Redfish/RDE to PATCH a Resource, but only if the ETag of this Resource still has the same value from when it was last read, indicating it didn't change since then. Redfish specification explicitly allows strong and weak ETags. The difference is that a strong ETag guarantees uniqueness (by using a change counter or similar), whereas a weak ETag is at risk of hash conflict. So far, so good. The rules on ETag comparisons are dictated by datatracker.ietf.org/doc/html/rfc7232RFC7232 has a section detailing the mechanism of ETag comparison. There's two methods: +--------+--------+-------------------+-----------------+ | ETag 1 | ETag 2 | Strong Comparison | Weak Comparison | +--------+--------+-------------------+-----------------+ | W/"1" | W/"1" | no match | match | | W/"1" | W/"2" | no match | no match | | W/"1" | "1" | no match | match | | "1" | "1" | match | match | +--------+--------+-------------------+-----------------+The Redfish specification doesn't say which comparison method to use. Practically speaking, devices that use Weak ETags must also use the Weak Comparison algorithm, otherwise it will never match. Devices that use Strong ETags can use the Strong comparison. Is the ETag comparison algorithm deliberately left undefined and up to the RDE/Redfish implementer?
|
|
|
Post by mraineri on Jun 5, 2023 15:02:26 GMT
Thanks for finding this. The general guidance I've given folks on the client-side of things is to use the ETag as-is that came back from the service, that way they're not performing any ETag parsing and treat the entire value as opaque. So, that would mean I would expect that the comparisons for the first and last entries to match, but the middle two to not match. So, based on this usage, it's almost as if we need to use weak comparisons if the underlying resource uses a weak ETag, and a strong comparison if the underlying resource uses a strong ETag. I think we certainly need to give some sort of guidance in the spec around this usage, but we'll need to discuss this with others to see if they agree with my thoughts.
|
|
|
Post by nschellenberger on Jun 7, 2023 17:20:20 GMT
FWIW OData 4.0 Errata 3 Part 1: Protocol 8.3.4 Header If-Match unconditionally requires the weak comparison for If-Match headers, RFC7232 notwithstanding This is one of the things that was further refined in OData 4.01 Part 1: Protocol 8.3.4 Header If-MatchI suspect (but may well be mistaken) that this is a consequence of OData wanting to allow weak validators to be used for optimistic concurrency control. It may also be a consequence of making some kinds of strong validators (which must be Content-Type and Content-Encoding neutral or aware for Range purposes) tricky to use since OData also requires them to be embedded in the payloads themselves as @odata.etag (unless @odata.metadata=none). (I realise that Redfish is only a distant cousin of OData, but it does technically call out the standard. I don't believe applying the newer RFC9110 would make any material difference to this question either, FWIW.)
|
|
|
Post by mraineri on Jun 8, 2023 12:52:52 GMT
Good data point... I'll bring this up when discussing it with others.
|
|
|
Post by AMI_Mani on Jul 5, 2023 2:40:41 GMT
Hi, As per redfish specification etag is recommended and not mandatory to implement
To reduce unnecessary RESTful accesses to resources, the Redfish service should support the
association of a separate entity tag (ETag) with each resource.
Is my understanding correct, But Redfish protocol Validator is throwing error as User Accounts shall support etags and atomic operations for OpenBMC Redfish service
Thanks, Mani
|
|
|
Post by mraineri on Jul 5, 2023 12:35:09 GMT
ETags are mandatory for ManagerAccount resources. In the same bulleted list in that clause, it stipulates:
> Implementations shall support the return of ETag headers for GET requests of ManagerAccount resources.
|
|
|
Post by AMI_Mani on Jul 7, 2023 8:56:35 GMT
ETags are mandatory for ManagerAccount resources. In the same bulleted list in that clause, it stipulates: > Implementations shall support the return of ETag headers for GET requests of ManagerAccount resources. Got it. Sorry I missed and we have to implement etag madatory for ManageAccount collection and ManagerAccount instance Thanks, Mani
|
|