-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: remove logging for every pull query MINOR #3736
Conversation
@confluentinc It looks like @vpapavas just signed our Contributor License Agreement. 👍 Always at your service, clabot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
won't this affect all queries, not just pull query logging? I feel like this log is useful at some level to know what we've been receiving.
Even for pull queries, I think we should be logging this (perhaps on a different logger). For previous projects*, we'd log all requests including a traceID, the time, the duration, the issuer etc... to help not only debug bad queries, but identify classes of queries that were problematic. I think we should consider doing something like that for pull queries (and it doubles as a primitive audit log). cc @vinothchandar
* the project was a search system handling hundreds of QPS, and the logs would roll on an hourly basis and be cleaned up after 7 days
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guess it's subjective. I prefer not to log every request unless 'interesting' things (errors, asserts failing) happen on them. +1 on having a separate log though, it will flood the ksql-server log completely otherwise.
That said, may be we can file a separate issue for that? For now, we probably just want to avoid logging per request.
@@ -195,7 +195,6 @@ public Response handleKsqlStatements( | |||
@Context final ServiceContext serviceContext, | |||
final KsqlRequest request | |||
) { | |||
LOG.info("Received: " + request); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we introduce a log statement somewhere (say where we check for isStatic
) that logs the sql statement? That way for non pull queries you still have similar log statement (which i guess would be useful)
+1 I'll file a ticket for that EDIT: #3741 - I assigned it to @vinothchandar, but feel free to hot potato it. |
@@ -108,6 +109,11 @@ public int validate( | |||
final ConfiguredStatement<?> configured = ConfiguredStatement.of( | |||
prepared, scopedPropertyOverrides, ksqlConfig); | |||
|
|||
final Class<? extends Statement> statementClass = prepared.getStatement().getClass(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will #3742 solve the need for this PR? after looking at this patch, it seems very out of place to have this in the validator!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we still have to discuss that and I expect we will hash it out over the next week or so. So may not have time to land before the release cut. In this scenario, its better to have some fix landed first and then iterate? We should make a note and undo these bandaids +1 on that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we removing the log msg altogether? We could just as well of at a more verbose level. If the cost of generating the message is a concern, we can log using the format string interfaces to avoid toString on every call. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving to unblock the release, please get one more +1 since this is semi-controversial despite being such a small change 😂 - make sure to rebase this on 5.4.x, and also please add a ticket to move this back after #3742
@rodesai - I think the concern is not performance but spamming the log. I wanted to have the log at INFO level even for normal operation for persistent queries, it's pretty useful to debug things, but it makes sense to have it at DEBUG for pull queries.
The root issue is introducing this statement in the hot path for pull queries. We can also simply remove this for now and think about it in #3741 .. @big-andy-coates can you please chime in here? Are you okay with not having this log statement for now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switching the pull queries over to the /query
end point will fix this issue. We shouldn't commit this change.
@big-andy-coates its not clear to me yet, if the switch to |
@big-andy-coates any updates? I am leaning towards simplifying this PR to just remove/change level for the log statement and merge, while we figure out the timelines for moving to |
I think at this point, we should not be moving functionality to the
@vchandar @vicky please feel free to merge your PR and get unblocked. Let’s not pursue any parallel tracks of work to move pull query functionality into the /query endpoint right now. We can think of a redesign of the API to account for the new query types as a separate track of work afterwards. We know we are going to make a bunch of breaking changes, and this can be part of the batch. |
Closing this PR since pull queries moved to the |
Description
Fixes #3672
Remove logging at info level for every pull query. It floods the server.
Logging is done for errors already so that can be used for debugging.
Testing done
Describe the testing strategy. Unit and integration tests are expected for any behavior changes.
Reviewer checklist