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 Redis OBJECT command support #650

Closed
wants to merge 9 commits into from

Conversation

steamboatid
Copy link

Hi,
as requested at issue #649, I try to add support to OBJECT command and couple of debian-based packaging files.

@CLAassistant
Copy link

CLAassistant commented Aug 29, 2021

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@@ -141,6 +142,7 @@ typedef enum msg_parse_result {
ACTION( REQ_REDIS_RPUSH ) \
ACTION( REQ_REDIS_RPUSHX ) \
ACTION( REQ_REDIS_SADD ) /* redis requests - sets */ \
ACTION( REQ_REDIS_SADDINT ) \
Copy link
Collaborator

Choose a reason for hiding this comment

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

SADDINT isn't merged into redis, even in the unstable branch. I'm not sure what this command is meant to be, couldn't find it in a quick google search.

EDIT: Your KeyDB proposal hasn't been reviewed yet, and regardless, there aren't currently plans to support KeyDB due to full support for KeyDB being a potentially large project

Copy link
Author

Choose a reason for hiding this comment

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

you may visit the PR at keydb

@@ -971,6 +974,11 @@ redis_parse_req(struct msg *r)
break;
}

if (str6icmp(m, 'o', 'b', 'j', 'e', 'c', 't')) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just this change isn't enough to support OBJECT - twemproxy will treat the first string after the command name as the key (to shard on), but here, the subcommand is in that position, so it will go to the wrong server when there's more than one server. https://redis.io/commands/object

Copy link
Author

Choose a reason for hiding this comment

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

the main purpose for supporting OBJECT is to get the encoding sub-command. even on sharding scenario, why we can't assume that all object have same encoding?

client app must understand that the answer for other sub-command other than encoding (refcount, freq, idletime) may differ from one server to another.
even for that. why we can't support this OBJECT command?

@@ -70,7 +70,7 @@ The build steps are the same (`./configure; make; sudo make install`).
-D, --describe-stats : print stats description and exit
-v, --verbose=N : set logging level (default: 5, min: 0, max: 11)
-o, --output=S : set logging file (default: stderr)
-c, --conf-file=S : set configuration file (default: conf/nutcracker.yml)
-c, --conf-file=S : set configuration file (default: /etc/nutcracker/nutcracker.yml)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is backwards incompatible, only works on *nix-like systems, and is unrelated to new redis command support. Remove it.

Copy link
Author

Choose a reason for hiding this comment

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

noted, thanks. I will revert it.

src/nc.c Outdated
@@ -28,7 +28,7 @@
#include <nc_conf.h>
#include <nc_signal.h>

#define NC_CONF_PATH "conf/nutcracker.yml"
#define NC_CONF_PATH "/etc/nutcracker/nutcracker.yml"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is backwards incompatible, only works on *nix-like systems, and is unrelated to new redis command support. Remove it.

Copy link
Author

Choose a reason for hiding this comment

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

what about defining something based on OS info?

@@ -0,0 +1,30 @@
nutcracker (0.4.1+dfsg-1) unstable; urgency=medium
Copy link
Collaborator

Choose a reason for hiding this comment

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

Debian support is completely unrelated to new redis command support and should not be part of the same PR.

Additionally, I don't have any experience with debian packaging and wouldn't be able to review this, anyway - The debian package maintainers who originally wrote these files could continue to do so without these being checked in.

Copy link
Author

Choose a reason for hiding this comment

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

yes. you may ignore all the debian folder

@@ -0,0 +1,58 @@
Description: Use system libyaml
Author: Faidon Liambotis <paravoid@debian.org>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Separately from that: Though I don't work for twitter, this repo still requires the CLA for contributions, and these files are authored by someone else - https://cla-assistant.io/twitter/twemproxy

Though how that could be fixed is irrelevant since I don't plan on including the changes made for debian packagers in this repo itself for the previously stated reasons.

  1. You represent that each of Your Contributions is Your original creation (see section 7 for submissions on behalf of others). You represent that Your Contribution submissions include complete details of any third-party license or other restriction (including, but not limited to, related patents and trademarks) of which you are personally aware and which are associated with any part of Your Contributions.
  1. Should You wish to submit work that is not Your original creation, You may submit it to Twitter separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which you are personally aware, and conspicuously marking the work as "Not a Contribution. Third-party materials licensed pursuant to: [license name(s) here]" (substituting the bracketed text with the appropriate license name(s)).

AC_MSG_RESULT($disable_stats)

-# Untar the yaml-0.1.4 in contrib/ before config.status is rerun
-AC_CONFIG_COMMANDS_PRE([tar xvfz contrib/yaml-0.1.4.tar.gz -C contrib])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Unrelatedly, these patches are outdated - twemproxy 0.5.0 is using yaml-0.2.5

Though this is irrelevant since I don't plan on including the changes made for debian packagers in this repo itself for the previously stated reasons.

Copy link
Author

Choose a reason for hiding this comment

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

sure. will change that a.s.a.p.
thanks.

Copy link
Author

Choose a reason for hiding this comment

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

@TysonAndre
Copy link
Collaborator

Debian support is completely unrelated to new redis command support and should not be part of the same PR.

Additionally, I don't have any experience with debian packaging and wouldn't be able to review this, anyway - The debian package maintainers who originally wrote these files could continue to do so without these being checked in.

Separately from that: Though I don't work for twitter, this repo still requires the CLA for contributions, and these files are authored by someone else - https://cla-assistant.io/twitter/twemproxy

Though how that could be fixed is irrelevant since I don't plan on including the changes made for debian packagers in this repo itself for the previously stated reasons.

  1. You represent that each of Your Contributions is Your original creation (see section 7 for submissions on behalf of others). You represent that Your Contribution submissions include complete details of any third-party license or other restriction (including, but not limited to, related patents and trademarks) of which you are personally aware and which are associated with any part of Your Contributions.
  1. Should You wish to submit work that is not Your original creation, You may submit it to Twitter separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which you are personally aware, and conspicuously marking the work as "Not a Contribution. Third-party materials licensed pursuant to: [license name(s) here]" (substituting the bracketed text with the appropriate license name(s)).

I stated multiple times earlier in this review that I have no plans to add debian support to this repo.

@TysonAndre TysonAndre closed this Sep 13, 2021
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.

None yet

3 participants