Skip to content

[KIP-848] Added online upgrade and downgrade test #2012

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pranavrth
Copy link
Member

No description provided.

@Copilot Copilot AI review requested due to automatic review settings July 17, 2025 07:11
@pranavrth pranavrth requested review from MSeal and a team as code owners July 17, 2025 07:11
@confluent-cla-assistant
Copy link

🎉 All Contributor License Agreements have been signed. Ready to merge.
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

@pranavrth pranavrth changed the title Added online upgrade and downgrade test [KIP-848] Added online upgrade and downgrade test Jul 17, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds comprehensive integration tests for Kafka consumer upgrade and downgrade scenarios, specifically testing the transition between classic and consumer group protocols. The tests verify that consumers can successfully upgrade from classic protocol to consumer protocol and downgrade back, while maintaining proper partition assignment and message consumption throughout the process.

Key changes:

  • Added new integration test file with upgrade/downgrade test logic for multiple partition assignment strategies
  • Enhanced cluster fixture with topic deletion capability and improved message seeding
  • Refactored common utility functions for better group protocol configuration handling

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
tests/integration/consumer/test_consumer_upgrade_downgrade.py New test file implementing consumer protocol upgrade/downgrade tests with partition assignment validation
tests/integration/cluster_fixture.py Added delete_topic method and improved seed_topic to generate proper test keys
tests/common/init.py Refactored group protocol configuration utilities with new helper method and improved conditional logic

# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limit
Copy link
Preview

Copilot AI Jul 17, 2025

Choose a reason for hiding this comment

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

The comment appears to be truncated. It should likely read '# limitations under the License.' to complete the Apache License header.

Suggested change
# limit
# limitations under the License.

Copilot uses AI. Check for mistakes.

Comment on lines +56 to +62
# def produce_messages(producer, topic, partitions, num_messages):
# for i in range(num_messages):
# key = "key-{}".format(i)
# value = "value-{}".format(i)
# partition = i % partitions
# producer.produce(topic, key=key, value=value, partition=partition)
# producer.flush()
Copy link
Preview

Copilot AI Jul 17, 2025

Choose a reason for hiding this comment

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

This commented-out function should be removed as it's not being used and adds clutter to the codebase.

Suggested change
# def produce_messages(producer, topic, partitions, num_messages):
# for i in range(num_messages):
# key = "key-{}".format(i)
# value = "value-{}".format(i)
# partition = i % partitions
# producer.produce(topic, key=key, value=value, partition=partition)
# producer.flush()
# Removed the commented-out `produce_messages` function to reduce clutter.

Copilot uses AI. Check for mistakes.

"""
Test consumer upgrade and downgrade.
"""
topic = kafka_cluster.create_topic_and_wait_propogation(topic_prefix,
Copy link
Preview

Copilot AI Jul 17, 2025

Choose a reason for hiding this comment

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

The method name contains a typo: 'propogation' should be 'propagation'.

Suggested change
topic = kafka_cluster.create_topic_and_wait_propogation(topic_prefix,
topic = kafka_cluster.create_topic_and_wait_propagation(topic_prefix,

Copilot uses AI. Check for mistakes.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@sonarqube-confluent
Copy link

Passed

Analysis Details

4 Issues

  • Bug 0 Bugs
  • Vulnerability 0 Vulnerabilities
  • Code Smell 4 Code Smells

Coverage and Duplications

  • Coverage No coverage information (66.00% Estimated after merge)
  • Duplications No duplication information (5.20% Estimated after merge)

Project ID: confluent-kafka-python

View in SonarQube

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.

1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy