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

KAFKA-8509; Add downgrade system test #7724

Merged
merged 9 commits into from
Nov 22, 2019
Merged

Conversation

hachikuji
Copy link
Contributor

@hachikuji hachikuji commented Nov 21, 2019

This patch adds a basic downgrade system test. It verifies that producing and consuming continues to work before and after the downgrade.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@hachikuji
Copy link
Contributor Author

@hachikuji
Copy link
Contributor Author

I'm changing this test case to use EndToEndTest instead of ProduceConsumeValidateTest. The advantage is that this allows me to assert committed offsets in the consumer, which makes the test case a stronger assertion about compatibility. I will push this change tomorrow.

Copy link
Member

@mumrah mumrah left a comment

Choose a reason for hiding this comment

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

Test looks good, few questions inline

@parametrize(kafka_version=str(LATEST_0_8_2), compression_types=["none"])
@parametrize(kafka_version=str(LATEST_0_8_2), compression_types=["snappy"])
def test_upgrade_and_downgrade(self, kafka_version, compression_types, security_protocol="PLAINTEXT"):
@parametrize(version=str(LATEST_2_3), compression_types=["none"])
Copy link
Member

Choose a reason for hiding this comment

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

Could some of these be replaced with @matrix?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Possibly. Let me consider it.

@parametrize(version=str(LATEST_0_10_1), compression_types=["gzip"])
@parametrize(version=str(LATEST_0_10_0), compression_types=["none"])
@parametrize(version=str(LATEST_0_10_0), compression_types=["lz4"])
@parametrize(version=str(LATEST_0_9), compression_types=["none"], security_protocol="SASL_SSL")
Copy link
Member

Choose a reason for hiding this comment

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

Why not PLAINTEXT here as well? Was there something specific to SASL_SSL for this version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Inherited from the upgrade test. It does seem useful to have some tests which validate the auth flows. For each version, I was considering doing one test with PLAINTEXT/no compression and one with SASL_SSL/some compression. How does that sound?

Copy link
Member

Choose a reason for hiding this comment

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

If it doesn't add too much to the runtime, I think it would be good to include some more cases like you suggest.

Copy link
Member

Choose a reason for hiding this comment

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

Do we want to support all these versions? I'd vote for only testing 1.0 and newer. 1.0 was released roughly 2 years ago.

Copy link
Member

Choose a reason for hiding this comment

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

Given that 1.0 was released 2 years ago, I'd even go with 1.1 as the minimum version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good to me.

@@ -103,13 +103,14 @@ def stop_producer_and_consumer(self):
self.producer.stop()
self.consumer.wait()

def run_produce_consume_validate(self, core_test_action=None, *args):
"""Top-level template for simple produce/consume/validate tests."""
def run_multistep_produce_consume_validate(self, core_test_actions, *args):
Copy link
Member

Choose a reason for hiding this comment

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

Are these changes still needed now that the downgrade test is extending EndToEndTest?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I'll revert these changes.

Copy link
Contributor

@soondenana soondenana left a comment

Choose a reason for hiding this comment

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

Thanks for adding these tests, super useful. Left one minor comment.

(self.reset_policy, self.group_id, self.topic, node.group_instance_id, self.kafka.bootstrap_servers(self.security_config.security_protocol),

if node.version >= V_2_3_0 and node.group_instance_id:
cmd += "--group-instance-id %s" % node.group_instance_id
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: may need to add space before --group-instance-id as previous if condition adds verbse w/o a trailing space.

def test_upgrade_and_downgrade(self, version, compression_types, security_protocol="PLAINTEXT"):
"""Test upgrade and downgrade of Kafka cluster from old versions to the current version

`version` is the Kafka version to upgrade from and dowrade back to
Copy link
Member

Choose a reason for hiding this comment

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

Nit: dowrade -> downgrade.

Copy link
Member

@ijuma ijuma left a comment

Choose a reason for hiding this comment

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

LGTM if we have verified that the system test passes after the latest update.

@hachikuji hachikuji merged commit 9d8ab3a into apache:trunk Nov 22, 2019
hachikuji added a commit that referenced this pull request Nov 23, 2019
The --enable-autocommit argument is a flag. It does not take a parameter. This was broken in #7724.

Reviewers: Ismael Juma <[email protected]>, Manikumar Reddy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants