Skip to content

Commit

Permalink
rpc: reset transport version on connect
Browse files Browse the repository at this point in the history
This is needed for the case in which a peer on the other end of a
reconnect_transport is downgraded. unless we reset the version on
reconnect then we'll get a policy violation if the peer responds
with a lower version than the transport had been upgraded to.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
  • Loading branch information
dotnwat committed Jul 19, 2022
1 parent f13f120 commit 0c0d66b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/v/rpc/transport.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ void transport::reset_state() {
_correlation_idx = 0;
_last_seq = sequence_t{0};
_seq = sequence_t{0};
_version = transport_version::v1;
}

ss::future<>
Expand Down
2 changes: 2 additions & 0 deletions src/v/rpc/transport.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ class transport final : public net::base_transport {
* version level used when dispatching requests. this value may change
* during the lifetime of the transport. for example the version may be
* upgraded if it is discovered that a server supports a newer version.
*
* reset to v1 in reset_state() to support reconnect_transport.
*/
transport_version _version{transport_version::v1};

Expand Down

0 comments on commit 0c0d66b

Please sign in to comment.