Skip to content
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

Conversation

Yury-Fridlyand
Copy link

@Yury-Fridlyand Yury-Fridlyand commented Feb 14, 2024

Features:

@Yury-Fridlyand Yury-Fridlyand changed the base branch from main to java/integ_yuryf_config_rewrite_reset February 14, 2024 23:57

/** {@inheritDoc} The command will be routed automatically to all nodes. */
@Override
public CompletableFuture<String> configRewrite() {

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...

Copy link
Author

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.

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.

Copy link
Author

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);

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

Copy link
Author

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

assertAll(
() -> assertTrue(exception.getCause() instanceof RequestException),
() ->
assertTrue(

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)

Copy link
Author

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.

Copy link
Author

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.

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 29cdfa4

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?

Copy link
Author

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() {

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();

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted

@SneakyThrows
@ParameterizedTest
@MethodSource("getClients")
public void config_reset_stat(BaseClient client) {

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

Copy link
Author

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 😉

@Yury-Fridlyand Yury-Fridlyand force-pushed the java/dev_yuryf_config_rewrite_reset branch from 08a22eb to 97bb467 Compare February 21, 2024 01:29
Signed-off-by: Yury-Fridlyand <[email protected]>
@Yury-Fridlyand Yury-Fridlyand merged commit 288590e into java/integ_yuryf_config_rewrite_reset Feb 21, 2024
10 checks passed
@Yury-Fridlyand Yury-Fridlyand deleted the java/dev_yuryf_config_rewrite_reset branch February 21, 2024 19:51
SanHalacogluImproving pushed a commit that referenced this pull request Feb 27, 2024
* Add `CONFIG REWRITE` and `CONFIG RESETSTAT`.

Signed-off-by: Yury-Fridlyand <[email protected]>
SanHalacogluImproving pushed a commit that referenced this pull request Mar 5, 2024
* Add `CONFIG REWRITE` and `CONFIG RESETSTAT`.

Signed-off-by: Yury-Fridlyand <[email protected]>
Yury-Fridlyand added a commit that referenced this pull request Mar 6, 2024
* Add `CONFIG REWRITE` and `CONFIG RESETSTAT`. (#95)

---------

Signed-off-by: Yury-Fridlyand <[email protected]>
Co-authored-by: SanHalacogluImproving <[email protected]>
cyip10 pushed a commit that referenced this pull request Jun 24, 2024
* Add `CONFIG REWRITE` and `CONFIG RESETSTAT`. (#95)

---------

Signed-off-by: Yury-Fridlyand <[email protected]>
Co-authored-by: SanHalacogluImproving <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants