-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add CONFIG REWRITE
and CONFIG RESETSTAT
.
#95
Add CONFIG REWRITE
and CONFIG RESETSTAT
.
#95
Conversation
|
||
/** {@inheritDoc} The command will be routed automatically to all nodes. */ | ||
@Override | ||
public CompletableFuture<String> configRewrite() { |
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.
Doesn't ClusterClient extend baseClient why do you need to call it like this? We don't have the other commands such as incr etc...
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 do it to redefine (extend) the javadoc. The function signature (= API) is the same.
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 is confusing. I would strongly suggest that we only extend one interface with the signature, otherwise it's confusing to developers which documentation applies here.
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.
reverted
|
||
// verify | ||
assertEquals(testResponse, response); | ||
assertEquals(OK, payload); |
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.
Info and ping return strings rather than OK, but this is a minor detail and maybe not worth worrying about if we're able to remove some code duplication here like you've shown
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 reverted this and added new tests
java/client/src/test/java/glide/api/models/TransactionTests.java
Outdated
Show resolved
Hide resolved
assertAll( | ||
() -> assertTrue(exception.getCause() instanceof RequestException), | ||
() -> | ||
assertTrue( |
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.
Shoham asked me to remove the error message checks in my PR, although they check the error message in the other clients
valkey-io#974 (comment)
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.
Since IT runs cluster without a config file, this command always fails in IT.
Thus, this test is the only test which I can do for that command.
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.
Docs https://redis.io/commands/config-rewrite/ say
However if the server was started without a configuration file at all, the CONFIG REWRITE will just return an error.
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.
Remove it.
We're running against multiple version so Redis, and we don't want to check for version-specific error messages when they update Redis.
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.
Removed in 29cdfa4
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.
https://github.com/aws/glide-for-redis/blob/main/python/python/tests/test_async_client.py#L831 all their tests check for error messages. This includes Node and Py maybe she is mistaken?
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.
IMO we should keep the test. In case if CI get a newer redis version with another error message, we will fix the test.
Meanwhile I do contains
check, not equals
|
||
/** {@inheritDoc} The command will be routed automatically to all nodes. */ | ||
@Override | ||
public CompletableFuture<String> configRewrite() { |
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 is confusing. I would strongly suggest that we only extend one interface with the signature, otherwise it's confusing to developers which documentation applies here.
@@ -70,4 +70,32 @@ public interface ServerManagementClusterCommands { | |||
* value is the information of the sections requested for the node. | |||
*/ | |||
CompletableFuture<ClusterValue<String>> info(InfoOptions options, Route route); | |||
|
|||
/** {@inheritDoc} The command will be routed automatically to all nodes. */ | |||
CompletableFuture<String> configRewrite(); |
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.
you are only saving lines of documentation by extending the base commands, which adds complexity to the code. I don't recommend doing this.
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.
reverted
java/client/src/main/java/glide/api/models/BaseTransaction.java
Outdated
Show resolved
Hide resolved
java/client/src/main/java/glide/api/models/BaseTransaction.java
Outdated
Show resolved
Hide resolved
@SneakyThrows | ||
@ParameterizedTest | ||
@MethodSource("getClients") | ||
public void config_reset_stat(BaseClient client) { |
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 don't see any tests on the python client for configResetStat
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.
Feel free to add new 😉
Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
08a22eb
to
97bb467
Compare
Signed-off-by: Yury-Fridlyand <[email protected]>
288590e
into
java/integ_yuryf_config_rewrite_reset
* Add `CONFIG REWRITE` and `CONFIG RESETSTAT`. Signed-off-by: Yury-Fridlyand <[email protected]>
* Add `CONFIG REWRITE` and `CONFIG RESETSTAT`. Signed-off-by: Yury-Fridlyand <[email protected]>
* Add `CONFIG REWRITE` and `CONFIG RESETSTAT`. (#95) --------- Signed-off-by: Yury-Fridlyand <[email protected]> Co-authored-by: SanHalacogluImproving <[email protected]>
* Add `CONFIG REWRITE` and `CONFIG RESETSTAT`. (#95) --------- Signed-off-by: Yury-Fridlyand <[email protected]> Co-authored-by: SanHalacogluImproving <[email protected]>
Features:
CONFIG REWRITE
https://redis.io/commands/config-rewrite/CONFIG RESETSTAT
https://redis.io/commands/config-resetstat/CONFIG REWRITE
, because redis in IT runs without config file