Files
seaweedfs/weed
chrislu 7149b723ec Phase 4: Implement consumer group protocol metadata parsing
Consumer Group Protocol Metadata completed:

## Core Enhancements
- **ClientHost extraction**: Real client IP/host instead of hardcoded 'unknown'
  - ExtractClientHost() extracts IP from connection context
  - Populates GroupMember.ClientHost with actual remote address
- **Enhanced protocol metadata parsing**: Robust parsing with error handling
  - ParseConsumerProtocolMetadata() with validation and graceful fallbacks
  - Handles malformed metadata, oversized fields, and edge cases
- **Improved assignment strategy selection**: Priority-based protocol selection
  - SelectBestProtocol() prefers sticky > roundrobin > range
  - Considers both client capabilities and existing group protocols

## Implementation Details
- **Connection Context**: Added ConnectionContext to Handler for client info
- **Metadata Analysis**: AnalyzeProtocolMetadata() for detailed debugging
- **Enhanced Subscription Extraction**: ExtractTopicsFromMetadata() with fallbacks
- **Validation**: SanitizeConsumerGroupID() prevents malformed group IDs
- **Graceful Error Handling**: Invalid metadata handled without failures

## New Files
- : Core metadata parsing and client context logic
- : Comprehensive test suite (17 test cases)

## Integration
- **JoinGroup enhancement**: Uses real client host and robust metadata parsing
- **Backward compatibility**: Legacy methods maintained for compatibility
- **Debug improvements**: Enhanced logging shows parsed protocol details

## Testing & Verification
- **17 comprehensive tests**: Protocol parsing, client host extraction, strategy selection
- **Edge case coverage**: Empty metadata, malformed data, oversized fields
- **E2E compatibility**: Sarama tests pass, no regressions
- **Performance validation**: Benchmark tests for parsing operations

Ready for Phase 5: Multi-batch Fetch concatenation support
2025-09-13 14:01:28 -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-09-11 00:18:50 -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-09-12 18:44:29 -07:00
2025-07-19 21:43:34 -07:00
2025-03-17 23:13:27 -07:00