From 94f3232e78da48732e467748a654eb5a975f90b3 Mon Sep 17 00:00:00 2001 From: chrislu Date: Thu, 16 Oct 2025 16:48:09 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20CRITICAL=20BREAKTHROUGH:=20Switc?= =?UTF-8?q?h=20case=20for=20ListOffsets=20NEVER=20MATCHED!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## The Smoking Gun Switch statement logging shows: - 316 times: case APIKeyMetadata ✅ - 0 times: case APIKeyListOffsets (apiKey=2) ❌❌❌ - 6+ times: case APIKeyApiVersions ✅ ## What This Means The case label for APIKeyListOffsets is NEVER executed, meaning: 1. ✅ TCP receives requests with apiKey=2 2. ✅ REQUEST_LOOP parses and logs them as apiKey=2 3. ✅ Requests are queued to channel 4. ❌ processRequestSync receives a DIFFERENT apiKey value than 2! OR The apiKey=2 requests are being ROUTED ELSEWHERE before reaching processRequestSync switch statement! ## Root Cause The apiKey value is being MODIFIED or CORRUPTED between: - HTTP-level request parsing (REQUEST_LOOP logs show 2) - Request queuing - processRequestSync switch statement execution OR the requests are being routed to a different channel (data plane vs control plane) and never reaching the Sync handler! ## Next: Check request routing logic to see if apiKey=2 is being sent to wrong channel --- weed/mq/kafka/protocol/handler.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/weed/mq/kafka/protocol/handler.go b/weed/mq/kafka/protocol/handler.go index a9048b8e1..dc75e0829 100644 --- a/weed/mq/kafka/protocol/handler.go +++ b/weed/mq/kafka/protocol/handler.go @@ -1112,12 +1112,15 @@ func (h *Handler) processRequestSync(req *kafkaRequest) ([]byte, error) { switch APIKey(req.apiKey) { case APIKeyApiVersions: + glog.Warningf("🔥 SWITCH MATCHED: APIKeyApiVersions") response, err = h.handleApiVersions(req.correlationID, req.apiVersion) case APIKeyMetadata: + glog.Warningf("🔥 SWITCH MATCHED: APIKeyMetadata") response, err = h.handleMetadata(req.correlationID, req.apiVersion, req.requestBody) case APIKeyListOffsets: + glog.Warningf("🔥🔥🔥 SWITCH MATCHED: APIKeyListOffsets (apiKey=2)!!!") glog.Warningf("🟡 processRequestSync: Handling ListOffsets (apiKey=2) - about to call handleListOffsets") response, err = h.handleListOffsets(req.correlationID, req.apiVersion, req.requestBody)