Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpc/raft/cluster: start removing ADL encoding for RPCs #9121

Merged
merged 11 commits into from
Mar 10, 2023

Conversation

jcsp
Copy link
Contributor

@jcsp jcsp commented Feb 26, 2023

Since Redpanda 23.1, ADL encoded RPCs are no longer used. We no longer need to carry these deprecated serialization paths to enable rolling upgrades.

This PR doesn't remove all cases, but targets major ones + those that I have other PRs touching (disk usage in health messages for #6549 and raft messages for #6365), so that I can remove any ADL parts of those PRs.

Backports Required

  • none - not a bug fix
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v22.3.x
  • v22.2.x
  • v22.1.x

UX Changes

None

Release Notes

  • none

@emaxerrno
Copy link
Contributor

this is neat. it lasted a good while.

@jcsp jcsp force-pushed the goodbye-adl-rpc branch 2 times, most recently from 31400dc to 35f4cb8 Compare February 27, 2023 13:31
@jcsp jcsp changed the title Goodbye adl rpc rpc/raft/cluster: start removing ADL encoding for RPCs Feb 27, 2023
@jcsp
Copy link
Contributor Author

jcsp commented Feb 28, 2023

This needs 23.1 to be released, so that upgrade tests that target the previous feature release will pick up 23.1 instead of 22.3

@jcsp jcsp requested a review from mmaslankaprv February 28, 2023 13:41
@jcsp jcsp force-pushed the goodbye-adl-rpc branch from 35f4cb8 to 47d97ae Compare March 8, 2023 10:24
@jcsp jcsp force-pushed the goodbye-adl-rpc branch from 47d97ae to 2fe9b19 Compare March 8, 2023 10:29
@jcsp jcsp marked this pull request as ready for review March 8, 2023 10:29
@jcsp jcsp force-pushed the goodbye-adl-rpc branch from b7d2b59 to 5c8ea2a Compare March 9, 2023 09:06
@jcsp
Copy link
Contributor Author

jcsp commented Mar 9, 2023

Saw failures in https://buildkite.com/redpanda/redpanda/builds/24695#0186c5d2-5cfc-4092-bf76-a0e67a1fece9:

@jcsp
Copy link
Contributor Author

jcsp commented Mar 9, 2023

/ci-repeat 4

@jcsp
Copy link
Contributor Author

jcsp commented Mar 9, 2023

On the repeats:

@jcsp jcsp requested a review from dotnwat March 9, 2023 19:10
Copy link
Member

@dotnwat dotnwat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, that's awesome!

Comment on lines 347 to +349
transport_version effective_version) mutable {
/*
* enforce the rule that a transport configured as v0 behaves like
* a v0 client transport and sends v0 messages.
*/
vassert(
version != transport_version::v0
|| effective_version == transport_version::v0,
version >= transport_version::min_supported,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the version and effective_version should now be the same, right? i'm also thinking that change may be coming up in a later commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That will become true when we strip out the adl-only RPCs, so that encode_for_version is never returning v0. Those are just the lingering coproc RPCs -- I think we can do that in a later PR.

vassert(version >= transport_version::v2, "Can't encode serde <= v2");
return ss::do_with(std::move(msg), [&out, version](T& msg) {
return serde::write_async(out, std::move(msg)).then([version] {
return version;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah i think this is it here where the caller gets effective version to input version

auto d = serialize_roundtrip_rpc(std::move(metadata));
auto d = serialize_roundtrip_rpc_adl(std::move(metadata));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this an example of one of the rpc messages that remain as adl (only?) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The snapshot_metadata is used in the on-disk format. I'll check if I'm using this method anywhere else and if not take the misleading 'rpc' out of the name

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh right yeh that makes sense


return versions

def upgrade_through_versions(self, versions):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice change promoting this up to generic test infra

jcsp added 10 commits March 10, 2023 10:23
Since Redpanda 23.2, all RPCs are serde encoded, and
all versions we may upgrade from also speak serde.
All the versions we may do a rolling upgrade from
now support v2, and as of Redpanda 23.1 they will
also speak v2 by default on all new connections, so
there are no circumstances where we need to speak
RPC v1 during a rolling upgrade.
Tests that relate to version upgrade are removed, as
we no longer support a range of versions.

Tests that used ADL now use serde.  The mock request/response
classes that specified a particular encoding are gone in favor
of using serde everywhere.

The encode_for_version method now needs to pass through
versions for v2 transports because we have to use a v2
transport for testing what happens when a client uses
a too-new version.
This test covers the hop from 22.2 to 22.3 specifically: we
do not need to carry the test indefinitely.

We could retain this test by updating it to step through all
intermediate versions, but it's not worth it: when we upgrade
to latest redpanda, the system will have passed through the
already-tested 22.3 code that handles the upgrade.
This <= should have been <, to avoid skipping through
versions to quickly.
There is more than one test that should be stepping
through all verisons in a series.
...to not skip straight from 22.2.x to HEAD, which will fail
now that HEAD is truly incompatible with such old versions, without
ADL RPC.

The test now does 22.2.8->23.1.x, then downgrades, then goes all
the way to HEAD via all intervening feature versions.
...to not try and skip straight from 22.1.x to HEAD.
...it is no longer used for any cases involving RPC,
just structures that we serialize to disk.
@jcsp jcsp force-pushed the goodbye-adl-rpc branch from 5c8ea2a to f8b8e1f Compare March 10, 2023 10:23
@jcsp
Copy link
Contributor Author

jcsp commented Mar 10, 2023

Failures are all CloudStorageUsageTest -- this PR should be good to go.

@jcsp jcsp requested a review from dotnwat March 10, 2023 14:56
@NyaliaLui
Copy link
Contributor

Do these changes need backport into v23.1.x?
@jcsp

@jcsp
Copy link
Contributor Author

jcsp commented Mar 29, 2023

Do these changes need backport into v23.1.x?

Definitely not, 23.1.x needs to remain ADL compatible to upgrade cleanly from 22.3.x

@jcsp jcsp deleted the goodbye-adl-rpc branch March 29, 2023 17:56
@dotnwat
Copy link
Member

dotnwat commented Mar 29, 2023

Since Redpanda 23.1, ADL encoded RPCs are no longer used

I did a double take on this from the cover letter too.

dotnwat added a commit to dotnwat/redpanda that referenced this pull request Aug 11, 2023
redpanda-data#9121

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
dotnwat added a commit to dotnwat/redpanda that referenced this pull request Aug 11, 2023
Seems to have been partially cleaned up in
redpanda-data#9121.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
dotnwat added a commit to dotnwat/redpanda that referenced this pull request Aug 14, 2023
Seems to have been partially cleaned up in
redpanda-data#9121.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
ztlpn pushed a commit to ztlpn/redpanda that referenced this pull request Sep 28, 2023
Seems to have been partially cleaned up in
redpanda-data#9121.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
(cherry picked from commit cfd6325)
ztlpn pushed a commit to ztlpn/redpanda that referenced this pull request Sep 29, 2023
Seems to have been partially cleaned up in
redpanda-data#9121.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
(cherry picked from commit cfd6325)
ztlpn pushed a commit to ztlpn/redpanda that referenced this pull request Sep 29, 2023
Seems to have been partially cleaned up in
redpanda-data#9121.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
(cherry picked from commit cfd6325)
ztlpn pushed a commit to ztlpn/redpanda that referenced this pull request Sep 29, 2023
Seems to have been partially cleaned up in
redpanda-data#9121.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
(cherry picked from commit cfd6325)
ztlpn pushed a commit to ztlpn/redpanda that referenced this pull request Sep 29, 2023
Seems to have been partially cleaned up in
redpanda-data#9121.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
(cherry picked from commit cfd6325)
ztlpn pushed a commit to ztlpn/redpanda that referenced this pull request Sep 29, 2023
Seems to have been partially cleaned up in
redpanda-data#9121.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
(cherry picked from commit cfd6325)
ztlpn pushed a commit to ztlpn/redpanda that referenced this pull request Sep 29, 2023
Seems to have been partially cleaned up in
redpanda-data#9121.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
(cherry picked from commit cfd6325)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants