-
Notifications
You must be signed in to change notification settings - Fork 755
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
Change default syslog-ident from redis to valkey #390
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## unstable #390 +/- ##
============================================
+ Coverage 68.35% 68.43% +0.07%
============================================
Files 108 108
Lines 61563 61569 +6
============================================
+ Hits 42084 42134 +50
+ Misses 19479 19435 -44
|
I am aligned with this change. The only question I have is whether we should gate it behind the compat switch introduced in #306. @zuiderkwast wdyt? |
@PingXie Yes please do, without it being behind a flag it could break the drop-in nature of deploying valkey for some. There is a substantial possibility for impact of downstream systems that ingest the logs for further processing as the Identity is typically the first in a series of filters or pivots. This would help ensure it remains a drop-in replacement and not a migration. |
Make sense. Thanks for the feedback @McFacePunch |
Thanks @PingXie @McFacePunch for the comments. Please see the latest commit. I have no idea why that test-sanitizer fails. |
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.
I think we need some tests. The defaults can be tested in the existing test for the compat config. Custom value may need a new test case.
We should add a test with a user-configured value.
Note that syslog-ident is an immutable config while the redis-compat is a mutable config. Changing it in runtime will not affect the syslog-ident. Is that expected or confusing?
src/config.c
Outdated
@@ -628,6 +628,9 @@ void loadServerConfigFromString(char *config) { | |||
if (server.config_hz < CONFIG_MIN_HZ) server.config_hz = CONFIG_MIN_HZ; | |||
if (server.config_hz > CONFIG_MAX_HZ) server.config_hz = CONFIG_MAX_HZ; | |||
|
|||
/* For backward compatibility with the Redis OSS */ | |||
server.syslog_ident = server.extended_redis_compat ? "redis" : SERVER_NAME; |
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 looks like it's overriding any value configured by the user.
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.
Yes, you are right. It is little bit tricky to gate behind the redis-compat config than I thought before :)
Anyway, I will fix this problem.
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.
An idea: Maybe we can set the default value at createStringConfig("syslog-ident", ...)
to NULL. Then, here, we can set it to "redis" or SERVER_NAME if it still has no value. I didn't try. It's just an idea.
server.syslog_ident = server.extended_redis_compat ? "redis" : SERVER_NAME; | |
if (server.syslog_ident == NULL) | |
server.syslog_ident = server.extended_redis_compat ? "redis" : SERVER_NAME; |
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.
I think adding server.extended_redis_compat condition here makes thing complicated.
In other places, by adding server.extended_redis_compat, the idea is to makes output log compatible with Redis version. However, considering the redis case here: the only values for syslog-ident are redis and other value; and for valkey case: the only values for syslog-ident are valkey and other value.
And we can also find the config syslog-ident is IMMUTABLE, thus I think we do not need to touch other files, only update the default value to "valkey" in config.c is enough.
If the client wants to use "syslog-ident redis", the only thing to change is to add one line in the conf file "syslog-ident".
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.
@hwware Of course, you're right! A user can just set syslog-ident to "redis".
By brain was overcomplicating it.
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.
An idea: Maybe we can set the default value at
createStringConfig("syslog-ident", ...)
to NULL.
Thanks for the suggestion @zuiderkwast. if we need to set it to NULL, then I realized that we also need to change the ALLOW_EMPTY_STRING
to EMPTY_STRING_IS_NULL
. But, then it will change the existing behavior where user provided empty-string for the syslog-ident can also be changed to "redis" or "valkey" depending on the extended compatibility config.
Therefore, I have pushed another solution which can work with the extended compatibility config. Also, added unit tests to cover this change.
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.
@karthyuom Thanks for solving this fancy logic, but I actually think the simple solution suggested by @hwware is better. What matters is that it's possible to configure it to be redis compatible.
We don't want to add unnecessary complexity for this temporary compatibility-config that we will remove in a few versions anyway.
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.
@zuiderkwast Yes I agree. Then I can revert back to the original commit where user can even configure "redis" for backward compatibility. Thanks @hwware for bringing this up.
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.
Yes just use SERVER_NAME for the default value.
Sure, I will add tests to cover this new change.
is there any reason why
|
I didn't think about mutable or immutable for this config before. :) I think mutable can be useful. If users find that there is some compatibility problem with a client or another tool, they can enable it in runtime to fix the problem. We can do like this: |
@karthyuom When you compile valkey, try to run make SANITIZER=address, and run the test in your local to see if there are some memory leak. It is better run on Ubuntu 22, because Github CI run this on Ubuntu 22. Thanks |
Signed-off-by: Karthick Ariyaratnam <[email protected]>
Signed-off-by: Karthick Ariyaratnam <[email protected]>
…sts. Signed-off-by: Karthick Ariyaratnam <[email protected]>
Signed-off-by: Karthick Ariyaratnam <[email protected]>
Default value for the "syslog-ident" config changed from "redis" to "valkey".
Fixes #301.