Repository navigation
Conversation
Send a generated O token on non-quiet ms/ma requests (set, add, replace, append, prepend, incr, decr, and the writes made by fetch/cas/cas!) and verify the echoed token before reading anything else from the reply. Rejected replies return false (nil for incr/decr) and close the connection after the request without retrying or down-marking, with the same log and trace diagnostics as reads. Write spans now carry the request opaque and correlation failure attributes. Deletes, quiet/multi blocks, and multi-key writes are unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extend the opt-in
correlate_with_opaquesresponse validation from single-key reads (#79, #84) to single-key writes. A correlated write sends a generatedOtoken and checks the echoed token before reading anything else from the reply. Gating is the same as for reads: the client-level option,opaque_correlation_request_only, and per-requestcorrelate_with_opaques.Intended behaviour:
set/set_cas,add,replace/replace_cas,append,prepend,incr,decr, and the writes made byfetch(add) andcas/cas!(set/add).meta_flags, so there is no caller opaque to prefer.HD/NS/EX/NFforms,VA/NF/NS/EXforma) returns the operation's existing failure value (false, ornilforincr/decr). The connection is closed after the request, without retrying or down-marking. A rejectedVAleaves its counter line unread. Other protocol errors are unchanged.falsehere does not mean "not stored".delete,delete_cas,delete_multi), writes insidequiet/multiblocks (memcached suppresses their success replies, so there is nothing to check), and multi-key writes (set_multi).request_opaqueand thecorrelation_*failure attributes, kept out of the tags and attributes shared with other middleware, matching read spans.Testing
HD,NS,NF,EX,VA) echoes the token and keeps the connection open, and deletes, quiet blocks, and multi-key writes stay uncorrelated.test_rack_session.rb, which does not load on Ruby 4.0 with or without this change (rack 2.2 requires the removedcgi/cookie).