Skip to content

Commit

Permalink
Drive-by fix while working on this issue. Noted there wasn't really a…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
absurdfarce committed Jun 25, 2024
1 parent 20f0008 commit c9f749c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -672,13 +672,15 @@ 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()})
} else {
c.interceptSystemQuery(raw.Header, stmt)
}
} else {
c.proxy.logger.Debug("Query is not handled")
c.execute(raw, c.getDefaultIdempotency(customPayload), c.keyspace, msg)
}
}
Expand Down

0 comments on commit c9f749c

Please sign in to comment.