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

parsed unsupported command 'OBJECT' #649

Open
steamboatid opened this issue Aug 25, 2021 · 2 comments
Open

parsed unsupported command 'OBJECT' #649

steamboatid opened this issue Aug 25, 2021 · 2 comments

Comments

@steamboatid
Copy link

Describe the bug
I got these error message when execute $redis->object('encoding', $rkey) from php 8
nc_redis.c:1324 parsed unsupported command 'OBJECT'

To Reproduce

<?php
define('RED_HOST', '127.0.0.1');
define('RED_PORT', 27379); //keydb=7379, redis=6379, php-redis=17379, nutcracker=27379
define('RED_PIPE', true);

$redis = new \Redis();
$redis->connect(RED_HOST, RED_PORT);

$redis->sAddArray('aaa', range(1, 10));
$arr = $redis->sMembers('aaa');
$enc = $redis->object('encoding', 'aaa');

Expected behavior
$redis->object will return specified encoding from redis/keydb

Screenshots
image

image

Environment
OS: Debian 10.10
PHP: 8.0
Twemproxy: 0.5.0 (custom build on Debian)

Additional context
--none--

@TysonAndre
Copy link
Collaborator

The lack of support for OBJECT is documented at https://github.com/twitter/twemproxy/blob/master/notes/redis.md - I'm not sure what the original reason for it not being supported is (rarely used? inconsistency in having/not having a key?).

It's probably feasible to support it for only known commands with only one key - there's no fragmentation (multiple keys) to worry about it.

127.0.0.1:6379> object encoding value
(nil)
127.0.0.1:6379> object encoding key
"embstr"
127.0.0.1:6379> object encoding key key
(error) ERR Unknown subcommand or wrong number of arguments for 'encoding'. Try OBJECT HELP.

@steamboatid
Copy link
Author

steamboatid commented Aug 26, 2021

in practical use, KEYS OBJECT only support 3 arguments

OBJECT REFCOUNT <key>
OBJECT ENCODING <key>
OBJECT IDLETIME <key>
OBJECT FREQ <key>

so for the time being,
that's enough to support 3 arguments only

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

No branches or pull requests

2 participants