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

python客户端pipeline问题 #184

Closed
Kegann opened this issue Sep 6, 2017 · 11 comments
Closed

python客户端pipeline问题 #184

Kegann opened this issue Sep 6, 2017 · 11 comments

Comments

@Kegann
Copy link

Kegann commented Sep 6, 2017

问题描述:
使用python客户端pipeline入库时报错,但数据却入进去了.

python程序:
import redis
r=redis.StrictRedis(host='10.40.0.70',port='9221')
pr=redis.pipeline()
pr.set('t1',1)
pr.set('t2',2)
pr.execute()

Traceback (most recent call last):
File "q5.py", line 7, in
pr.execute()
File "/usr/lib/python2.7/site-packages/redis/client.py", line 2879, in execute
return execute(conn, stack, raise_on_error)
File "/usr/lib/python2.7/site-packages/redis/client.py", line 2772, in execute_transaction
response = self.parse_response(connection, '
')
File "/usr/lib/python2.7/site-packages/redis/client.py", line 2838, in parse_response
self, connection, command_name, **options)
File "/usr/lib/python2.7/site-packages/redis/client.py", line 680, in parse_response
response = connection.read_response()
File "/usr/lib/python2.7/site-packages/redis/connection.py", line 629, in read_response
raise response
redis.exceptions.ResponseError: Err unknown or unsupported command 'exec'

查看数据库,数据却入进去了.
10.40.0.70:9221> keys *

  1. "t1"
  2. "t2"

补充说明:
redis-py版本:2.10.5
测试了将
r=redis.StrictRedis(host='10.40.0.70',port='9221') 的ip 端口改成本地redis的ip 端口就不会报错,因此推断客户端没有问题,想请问是不是pika不支持python客户端的批量?

@ghost
Copy link

ghost commented Sep 6, 2017

+1

node-redis客户端,ReplyError: Err unknown or unsupported command 'exec'

@baotiao
Copy link
Contributor

baotiao commented Sep 6, 2017

目前暂时不支持 exec 命令

@fancy-rabbit
Copy link
Collaborator

pipeline 的时候不要用 transaction(就是不要用 multi/exec),python 客户端有选项的,仔细看一下

@chenyingjie2012
Copy link

raise response
redis.exceptions.ResponseError: wrong number of arguments or unsupported command

我的也出现了这个问题,这个问题你是怎么解决的呢?

@Leviathan1995
Copy link
Contributor

Leviathan1995 commented Nov 17, 2017

@chenyingjie2012 应该是执行了pika目前还不支持的redis命令

pika目前支持的接口

@chenyingjie2012
Copy link

好像跟我遇到问题不是一个东西,举个例子啊
import redis
r=redis.StrictRedis(host='10.40.0.70',port='9221')
r.hset(name='search', key='google', value='second')
r.hset(name='search', key='baidu', value='top1@china')
pipeline = r.pipeline()
pipeline.hmget(name='search', key=['google', 'baidu']) #有大量这种查询,所以为了减少网络延迟,想用redis提供的pipeline功能
pipeline.execute()
就开始报错了,那个pika 查了一下不是我用的这个redis的python客户端,各位,这种问题用redis pipeline怎么搞定

@chenyingjie2012
Copy link

@Leviathan1995 忘了at了……

@Leviathan1995
Copy link
Contributor

和上面一个问题啊

@chenyingjie2012
Copy link

@Leviathan1995 请教一下,pika是什么东西呀,不懂这个呀,去好好看看你分想的那个链接先

@Leviathan1995
Copy link
Contributor

@chenyingjie2012 看一下wiki 有详细的介绍

@ZoroSunCT
Copy link

初始化pipeline时,把transaction设为False,
pipeline = self._connection.pipeline(transaction=False)

luky116 pushed a commit to luky116/pika that referenced this issue Jul 14, 2023
AlexStocks pushed a commit that referenced this issue Jul 26, 2023
…ess (#1805)

* define rsync related header file and proto

* feat:add throttle (#167)

* add_throttle

* feat: implement rsync network tansform (#169)

implement rsync network transfer

Co-authored-by: wangshaoyi <[email protected]>

* fix action (#171)

* fix action

* fix

* feat: add load local meta file (#175)

* add load meta file

* [feat] add rsync client/server code (#177)

* implement rsync network transfer

* add rsyncclient to syncslaveslot (#182)

add rsyncclient to syncslaveslot

* feat: add read meta file and data (#179)

* add read meta file and data

* fix compile error (#183)

* fix bug

* add rsyncclient to syncslaveslot

* fix compile error

* fix compile error

---------

Co-authored-by: wangshaoyi <[email protected]>

* fix compile error (#184)

* fix bug

* optimize: add_throttle (#189)

optimize throttle

* rsyncclient periodically flush meta table (#192)

rsyncclient periodically flush meta table

* change rsync response (#190)

* change rsync response

* add debug log for test

* fix rsync client/server bugs

* fix bugs

* add debug log for test

* fix bugs

* fix bugs

* fix bugs

* rix rsync bugs (#194)

* fix pika rsync bug

* fix bugs

* fix bugs

* fix bugs 1

* fix bugs

* fix rsync bugs (#195)

* add debug log for test

* fix rsync client/server bugs

* fix bugs

* add debug log for test

* fix bugs

* fix bugs

* fix bugs

* fix bugs

* fix bugs

* fix bugs 1

* fix bugs

---------

Co-authored-by: wangshaoyi <[email protected]>

* remove unused code

* remove unused code

* remove unused code

* remove unused code

* add copyright

* fix by review comments (#213)

Co-authored-by: wangshaoyi <[email protected]>

* fix by review comments (#214)

* fix by review comments
Co-authored-by: wangshaoyi <[email protected]>

* fix by review comments (#216)

* fix by review comments
---------

Co-authored-by: wangshaoyi <[email protected]>

* Optimize rsync wangsy (#217)

* fix by review comments

Co-authored-by: wangshaoyi <[email protected]>

* fix by review comments (#218)

* fix by review comments
---------

Co-authored-by: wangshaoyi <[email protected]>

---------

Co-authored-by: wangshaoyi <[email protected]>
Co-authored-by: Yuecai Liu <[email protected]>
Co-authored-by: chejinge <[email protected]>
Co-authored-by: luky116 <[email protected]>
bigdaronlee163 pushed a commit to bigdaronlee163/pika that referenced this issue Jun 8, 2024
…ess (OpenAtomFoundation#1805)

* define rsync related header file and proto

* feat:add throttle (OpenAtomFoundation#167)

* add_throttle

* feat: implement rsync network tansform (OpenAtomFoundation#169)

implement rsync network transfer

Co-authored-by: wangshaoyi <[email protected]>

* fix action (OpenAtomFoundation#171)

* fix action

* fix

* feat: add load local meta file (OpenAtomFoundation#175)

* add load meta file

* [feat] add rsync client/server code (OpenAtomFoundation#177)

* implement rsync network transfer

* add rsyncclient to syncslaveslot (OpenAtomFoundation#182)

add rsyncclient to syncslaveslot

* feat: add read meta file and data (OpenAtomFoundation#179)

* add read meta file and data

* fix compile error (OpenAtomFoundation#183)

* fix bug

* add rsyncclient to syncslaveslot

* fix compile error

* fix compile error

---------

Co-authored-by: wangshaoyi <[email protected]>

* fix compile error (OpenAtomFoundation#184)

* fix bug

* optimize: add_throttle (OpenAtomFoundation#189)

optimize throttle

* rsyncclient periodically flush meta table (OpenAtomFoundation#192)

rsyncclient periodically flush meta table

* change rsync response (OpenAtomFoundation#190)

* change rsync response

* add debug log for test

* fix rsync client/server bugs

* fix bugs

* add debug log for test

* fix bugs

* fix bugs

* fix bugs

* rix rsync bugs (OpenAtomFoundation#194)

* fix pika rsync bug

* fix bugs

* fix bugs

* fix bugs 1

* fix bugs

* fix rsync bugs (OpenAtomFoundation#195)

* add debug log for test

* fix rsync client/server bugs

* fix bugs

* add debug log for test

* fix bugs

* fix bugs

* fix bugs

* fix bugs

* fix bugs

* fix bugs 1

* fix bugs

---------

Co-authored-by: wangshaoyi <[email protected]>

* remove unused code

* remove unused code

* remove unused code

* remove unused code

* add copyright

* fix by review comments (OpenAtomFoundation#213)

Co-authored-by: wangshaoyi <[email protected]>

* fix by review comments (OpenAtomFoundation#214)

* fix by review comments
Co-authored-by: wangshaoyi <[email protected]>

* fix by review comments (OpenAtomFoundation#216)

* fix by review comments
---------

Co-authored-by: wangshaoyi <[email protected]>

* Optimize rsync wangsy (OpenAtomFoundation#217)

* fix by review comments

Co-authored-by: wangshaoyi <[email protected]>

* fix by review comments (OpenAtomFoundation#218)

* fix by review comments
---------

Co-authored-by: wangshaoyi <[email protected]>

---------

Co-authored-by: wangshaoyi <[email protected]>
Co-authored-by: Yuecai Liu <[email protected]>
Co-authored-by: chejinge <[email protected]>
Co-authored-by: luky116 <[email protected]>
cheniujh pushed a commit to cheniujh/pika that referenced this issue Sep 24, 2024
…ess (OpenAtomFoundation#1805)

* define rsync related header file and proto

* feat:add throttle (OpenAtomFoundation#167)

* add_throttle

* feat: implement rsync network tansform (OpenAtomFoundation#169)

implement rsync network transfer

Co-authored-by: wangshaoyi <[email protected]>

* fix action (OpenAtomFoundation#171)

* fix action

* fix

* feat: add load local meta file (OpenAtomFoundation#175)

* add load meta file

* [feat] add rsync client/server code (OpenAtomFoundation#177)

* implement rsync network transfer

* add rsyncclient to syncslaveslot (OpenAtomFoundation#182)

add rsyncclient to syncslaveslot

* feat: add read meta file and data (OpenAtomFoundation#179)

* add read meta file and data

* fix compile error (OpenAtomFoundation#183)

* fix bug

* add rsyncclient to syncslaveslot

* fix compile error

* fix compile error

---------

Co-authored-by: wangshaoyi <[email protected]>

* fix compile error (OpenAtomFoundation#184)

* fix bug

* optimize: add_throttle (OpenAtomFoundation#189)

optimize throttle

* rsyncclient periodically flush meta table (OpenAtomFoundation#192)

rsyncclient periodically flush meta table

* change rsync response (OpenAtomFoundation#190)

* change rsync response

* add debug log for test

* fix rsync client/server bugs

* fix bugs

* add debug log for test

* fix bugs

* fix bugs

* fix bugs

* rix rsync bugs (OpenAtomFoundation#194)

* fix pika rsync bug

* fix bugs

* fix bugs

* fix bugs 1

* fix bugs

* fix rsync bugs (OpenAtomFoundation#195)

* add debug log for test

* fix rsync client/server bugs

* fix bugs

* add debug log for test

* fix bugs

* fix bugs

* fix bugs

* fix bugs

* fix bugs

* fix bugs 1

* fix bugs

---------

Co-authored-by: wangshaoyi <[email protected]>

* remove unused code

* remove unused code

* remove unused code

* remove unused code

* add copyright

* fix by review comments (OpenAtomFoundation#213)

Co-authored-by: wangshaoyi <[email protected]>

* fix by review comments (OpenAtomFoundation#214)

* fix by review comments
Co-authored-by: wangshaoyi <[email protected]>

* fix by review comments (OpenAtomFoundation#216)

* fix by review comments
---------

Co-authored-by: wangshaoyi <[email protected]>

* Optimize rsync wangsy (OpenAtomFoundation#217)

* fix by review comments

Co-authored-by: wangshaoyi <[email protected]>

* fix by review comments (OpenAtomFoundation#218)

* fix by review comments
---------

Co-authored-by: wangshaoyi <[email protected]>

---------

Co-authored-by: wangshaoyi <[email protected]>
Co-authored-by: Yuecai Liu <[email protected]>
Co-authored-by: chejinge <[email protected]>
Co-authored-by: luky116 <[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

No branches or pull requests

7 participants