You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
chrislu
23316d4d13
fix: Correct Kafka error codes - UNKNOWN_SERVER_ERROR = -1, OFFSET_OUT_OF_RANGE = 1
Phase 13: CRITICAL BUG FIX - Error Code Mismatch
Problem:
Producer CreateTopic calls were failing with confusing error:
'kafka server: The requested offset is outside the range of offsets...'
But the real error was topic creation failure!
Root Cause:
SeaweedFS had WRONG error code mappings:
ErrorCodeUnknownServerError = 1 ← WRONG!
ErrorCodeOffsetOutOfRange = 2 ← WRONG!
Official Kafka protocol:
-1 = UNKNOWN_SERVER_ERROR
1 = OFFSET_OUT_OF_RANGE
When CreateTopics handler returned errCode=1 for topic creation failure,
Sarama client interpreted it as OFFSET_OUT_OF_RANGE, causing massive confusion!
The Flow:
1. Producer tries to create loadtest-topic-2
2. CreateTopics handler fails (schema fetch error), returns errCode=1
3. Sarama interprets errCode=1 as OFFSET_OUT_OF_RANGE (not UNKNOWN_SERVER_ERROR!)
4. Producer logs: 'The requested offset is outside the range...'
5. Producer continues anyway (only warns on non-TOPIC_ALREADY_EXISTS errors)
6. Consumer tries to consume from non-existent topic-2
7. Gets 'topic does not exist' → rebalances → starts from offset 0 → DUPLICATES!
Fix:
1. Corrected error code constants:
ErrorCodeUnknownServerError = -1 (was 1)
ErrorCodeOffsetOutOfRange = 1 (was 2)
2. Updated all error handlers to use 0xFFFF (uint16 representation of -1)
3. Now topic creation failures return proper UNKNOWN_SERVER_ERROR
Expected Result:
- CreateTopic failures will be properly reported
- Producers will see correct error messages
- No more confusing OFFSET_OUT_OF_RANGE errors during topic creation
- Should eliminate topic persistence race causing duplicates
|
2 months ago |
| .. |
|
batch_crc_compat_test.go
|
Add Kafka Gateway (#7231)
|
2 months ago |
|
consumer_coordination.go
|
fix Node ID Mismatch, and clean up log messages
|
2 months ago |
|
consumer_group_metadata.go
|
fix Node ID Mismatch, and clean up log messages
|
2 months ago |
|
describe_cluster.go
|
Add Kafka Gateway (#7231)
|
2 months ago |
|
errors.go
|
fix: Correct Kafka error codes - UNKNOWN_SERVER_ERROR = -1, OFFSET_OUT_OF_RANGE = 1
|
2 months ago |
|
fetch.go
|
fix: Don't report long-poll duration as throttle time
|
2 months ago |
|
fetch_multibatch.go
|
fix: Increase fetch batch sizes to utilize available maxBytes capacity
|
2 months ago |
|
fetch_partition_reader.go
|
feat: Add critical broker data retrieval bug detection logging
|
2 months ago |
|
find_coordinator.go
|
clean up
|
2 months ago |
|
flexible_versions.go
|
Add Kafka Gateway (#7231)
|
2 months ago |
|
group_introspection.go
|
Add Kafka Gateway (#7231)
|
2 months ago |
|
handler.go
|
fix: Correct Kafka error codes - UNKNOWN_SERVER_ERROR = -1, OFFSET_OUT_OF_RANGE = 1
|
2 months ago |
|
joingroup.go
|
fix Node ID Mismatch, and clean up log messages
|
2 months ago |
|
metadata_blocking_test.go
|
feat: add context timeout propagation to produce path
|
2 months ago |
|
metrics.go
|
Add Kafka Gateway (#7231)
|
2 months ago |
|
offset_fetch_pattern_test.go
|
fix: Add topic cache invalidation and auto-creation on metadata requests
|
2 months ago |
|
offset_management.go
|
debug: Add verbose offset management logging
|
2 months ago |
|
offset_storage_adapter.go
|
Add Kafka Gateway (#7231)
|
2 months ago |
|
produce.go
|
fix: Correct Kafka error codes - UNKNOWN_SERVER_ERROR = -1, OFFSET_OUT_OF_RANGE = 1
|
2 months ago |
|
record_batch_parser.go
|
Add Kafka Gateway (#7231)
|
2 months ago |
|
record_batch_parser_test.go
|
Add Kafka Gateway (#7231)
|
2 months ago |
|
record_extraction_test.go
|
Add Kafka Gateway (#7231)
|
2 months ago |
|
response_cache.go
|
Add Kafka Gateway (#7231)
|
2 months ago |
|
response_format_test.go
|
Add Kafka Gateway (#7231)
|
2 months ago |
|
response_validation_example_test.go
|
Add Kafka Gateway (#7231)
|
2 months ago |