Files
seaweedfs/weed
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
..
2025-08-09 21:47:29 -07:00
2025-07-19 23:56:17 -07:00
2025-08-30 11:15:48 -07:00
2025-08-31 23:31:28 -07:00
2025-08-22 01:15:42 -07:00
2025-09-10 11:04:42 -07:00
2025-08-30 11:15:48 -07:00
2024-06-25 09:18:11 -07:00
2025-08-30 11:15:48 -07:00
2024-02-14 08:26:38 -08:00
2025-07-19 21:43:34 -07:00
2025-03-17 23:13:27 -07:00