From c9f749c7693f6d8d339854e4913d34815f28869a Mon Sep 17 00:00:00 2001 From: absurdfarce Date: Tue, 25 Jun 2024 00:02:03 -0500 Subject: [PATCH] Drive-by fix while working on this issue. Noted there wasn't really a clear way to tell from logs whether a given query was handled by the proxy or passed on to upstream servers. Added some minimal logging to provide some additional info on this point. --- proxy/proxy.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/proxy/proxy.go b/proxy/proxy.go index 4837beb..74ec296 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -672,6 +672,7 @@ func (c *client) handleQuery(raw *frame.RawFrame, msg *partialQuery, customPaylo handled, stmt, err := parser.IsQueryHandled(parser.IdentifierFromString(c.keyspace), msg.query) if handled { + c.proxy.logger.Debug("Query is handled") if err != nil { c.proxy.logger.Error("error parsing query to see if it's handled", zap.Error(err)) c.send(raw.Header, &message.Invalid{ErrorMessage: err.Error()}) @@ -679,6 +680,7 @@ func (c *client) handleQuery(raw *frame.RawFrame, msg *partialQuery, customPaylo c.interceptSystemQuery(raw.Header, stmt) } } else { + c.proxy.logger.Debug("Query is not handled") c.execute(raw, c.getDefaultIdempotency(customPayload), c.keyspace, msg) } }