ryerraguntla opened a new pull request, #4400:
URL: https://github.com/apache/iggy/pull/4400

   ## Which issue does this PR address?
   
   Relates to #3546
   
   ## Rationale
   
   Kafka clients remove a topic with DeleteTopics (API key 20). Issue #3546 
asks the gateway to delete the Iggy stream and the Iggy topic. Unmapped Kafka 
topics share one default stream, and a mapping override can put two Kafka 
topics in the same stream, so deleting that stream would remove topics the 
caller did not name. This change deletes only the Iggy topic the Kafka name 
resolves to, and leaves the stream in place even when the delete leaves it 
empty. DescribeConfigs and AlterConfigs are not part of this change.
   
   ## What changed?
   
   DeleteTopics was outside the scoped API set, so the gateway closed the 
connection. A reading of #3546 that also deletes the Iggy stream would drop 
other Kafka topics that still share that stream.
   
   Versions 1 through 5 are now advertised (version 6, the topic-id shape, is 
not). With the bridge on, each name deletes only the mapped Iggy topic. Success 
is error code 0. A missing topic returns UNKNOWN_TOPIC_OR_PARTITION (3); on 
version 5, where `error_message` is encoded, that result's text is the fixed 
string "internal error deleting this topic". A name that is empty, has leading 
or trailing whitespace, is longer than 249 bytes, is "." or "..", or contains a 
character outside letters, digits, ".", "_", and "-" returns 
INVALID_TOPIC_EXCEPTION and is not sent to Iggy. The validation reason is 
included as `error_message` on version 5. Versions 1 through 4 encode the error 
code only.
   
   With the bridge off, the request is still validated and every named topic is 
answered NOT_CONTROLLER (41), so the client does not treat the delete as done. 
More than 100 topic names in one request, duplicates included, returns 
POLICY_VIOLATION (44) for every name and deletes nothing. One missing or 
invalid name does not stop another name in the same request from being deleted. 
A name repeated in one request is removed on the first occurrence, and the 
later occurrence returns UNKNOWN_TOPIC_OR_PARTITION because the topic is 
already gone.
   
   ## Local Execution
   
   - Passed : Yes
   - Pre-commit hooks ran : The following prehooks ran
   
    Ran the following tests and are passed :
   
   - `clamp_request_timeout_rejects_a_zero_or_negative_value_up_to_the_floor`
   - `clamp_request_timeout_caps_an_oversized_value_at_the_ceiling`
   - `clamp_request_timeout_passes_through_a_reasonable_value_unchanged`
   - `delete_topics_v5_huge_topic_names_count_rejected`
   - `delete_topics_v5_desync_varint_poc_rejected`
   - `delete_topics_v1_truncated_legacy_topic_name_rejected`
   - `delete_topics_deletes_a_real_iggy_topic`
   - `delete_topics_never_deletes_the_backing_stream_even_when_it_becomes_empty`
   - `delete_topics_on_a_nonexistent_topic_returns_unknown_topic_or_partition`
   - 
`delete_topics_second_occurrence_of_a_duplicate_name_is_unknown_topic_or_partition`
   - `delete_topics_deletes_existing_topics_alongside_a_missing_one`
   - `delete_topics_rejects_more_than_the_topic_cap`
   - `delete_topics_over_cap_error_message_names_the_limit`
   - 
`given_kafka_topics_sh_when_creating_then_deleting_a_topic_should_round_trip_through_the_bridge`
 (`kafka-topics.sh` create, list, delete, list)
   - `supported_ranges_table_has_thirteen_entries`
   - `golden_apiversions_v3_flexible_response_fixture`
   - `golden_apiversions_v1_response_fixture`
   
   ```bash
   cargo test -p iggy-gateway-kafka --lib delete_topics::tests
   cargo test -p iggy-gateway-kafka --lib delete_topics_v5_
   cargo test -p iggy-gateway-kafka --lib 
delete_topics_v1_truncated_legacy_topic_name_rejected
   cargo test -p iggy-gateway-kafka --test delete_topics_real_bridge_tests
   cargo test -p iggy-gateway-kafka --test kafka_client_e2e_tests 
given_kafka_topics_sh_when_creating_then_deleting_a_topic_should_round_trip_through_the_bridge
   cargo test -p iggy-gateway-kafka --test version_firewall_tests 
supported_ranges_table_has_thirteen_entries
   cargo test -p iggy-gateway-kafka --test golden_wire_fixtures_tests 
golden_apiversions_
   ```
   
   ## AI Usage
   
   1. Which tools? Claude
   2. Scope of usage? Implementation, Review
   3. How did you verify the generated code works correctly? Code walkthrough 
and manual testing
   4. Can you explain every line of the code if asked? Yes


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to