-
Notifications
You must be signed in to change notification settings - Fork 307
Improve log messages for data stream support checks #1109
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
Improve log messages for data stream support checks #1109
Conversation
@@ -28,7 +28,6 @@ def self.included(base) | |||
base.extend(Validator) | |||
end | |||
|
|||
# @note assumes to be running AFTER {after_successful_connection} completed, due ES version checks |
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.
This comment looks to be true only for the assert_es_version_supports_data_streams method (which does the connected elastic search version validation).
Also, before this PR, there were no guarantees that this method would be invoked only AFTER the @after_successful_connection_thread was completed, the register
method was also invoking it, making it prone to race conditions.
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.
Nice refactoring.
I've left a doubt on the usage of #data_stream_config?
because on the method signature is explicitly cited that has to be used after #after_successful_connection
is invoked.
Left a couple of suggestions I would like to know your ideas
…lasticsearch into improve-data-stream-support-messages
Inverted the ECS check ifs to cut off the else and use the extracted methods.
e761370
to
96f5fc4
Compare
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.
LGTM
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.
Thanks for the changes here.
My major concern in this PR is the lack of testing for the new validation logic.
We should have a few tests describing the new permutations of settings and the validations being added here.
Hey @jsvd, thanks for reviewing! :) I'm probably missing something, but this PR should not be adding/changing any new validation logic. Could you please provide more details on that? |
Fair enough, I just happened to be playing around with the PR and removed the check for settings incompatible with explicitly enabling data streams (here), and didn't cause any tests to fail in the data_stream_support_spec.rb. That said I realize it's not an issue with your refactoring, it was a missing test case already. Overall, after some extra manual testing I'm good with merging. |
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.
LGTM
What this PR does?
debug
toinfo
. Those messages are helpful to users understanding the data stream auto-configuration mechanism/default and troubleshooting possibly incompatible settings.data_stream_config?
method, caused by the register function.Closes #1070