Files
seaweedfs/test
chrislu 5eca636c5e mq(kafka): Add comprehensive API version validation with Metadata v1 foundation
🎯 MAJOR ARCHITECTURE ENHANCEMENT - Complete Version Validation System

 CORE ACHIEVEMENTS:
- Comprehensive API version validation for all 13 supported APIs 
- Version-aware request routing with proper error responses 
- Graceful handling of unsupported versions (UNSUPPORTED_VERSION error) 
- Metadata v0 remains fully functional with kafka-go 

🛠️ VERSION VALIDATION SYSTEM:
- validateAPIVersion(): Maps API keys to supported version ranges
- buildUnsupportedVersionResponse(): Returns proper Kafka error code 35
- Version-aware handlers: handleMetadata() routes to v0/v1 implementations
- Structured version matrix for future expansion

📊 CURRENT VERSION SUPPORT:
- ApiVersions: v0-v3 
- Metadata: v0 (stable), v1 (implemented but has format issue)
- Produce: v0-v1 
- Fetch: v0-v1 
- All other APIs: version ranges defined for future implementation

🔍 METADATA v1 STATUS:
- Implementation complete with v1-specific fields (cluster_id, controller_id, is_internal)
- Format issue identified: kafka-go rejects v1 response with 'Unknown Topic Or Partition'
- Temporarily disabled until format issue resolved
- TODO: Debug v1 field ordering/encoding vs Kafka protocol specification

🎉 EVIDENCE OF SUCCESS:
- 'DEBUG: API 3 (Metadata) v0' (correct version negotiation)
- 'WriteMessages succeeded!' (end-to-end produce works)
- No UNSUPPORTED_VERSION errors in logs
- Clean error handling for invalid API versions

IMPACT:
This establishes a production-ready foundation for protocol compatibility.
Different Kafka clients can negotiate appropriate API versions, and our
gateway gracefully handles version mismatches instead of crashing.

Next: Debug Metadata v1 format issue and expand version support for other APIs.
2025-09-10 16:19:50 -07:00
..
2023-11-13 08:23:53 -08:00
2025-08-30 11:15:48 -07:00