xiaomi / pegasus-python-client Goto Github PK
View Code? Open in Web Editor NEWHas been migrated to https://github.com/apache/incubator-pegasus/tree/master/python-client
License: Apache License 2.0
Has been migrated to https://github.com/apache/incubator-pegasus/tree/master/python-client
License: Apache License 2.0
test_integration
TestIntegration
test_0_replica_scan_exception ... [OK]
test_1of3_replica_restart ... [ERROR]
test_1of5_replica_restart ... [ERROR]
test_1of5_replica_stop ... [ERROR]
test_1of5_replica_stop_and_start ... [ERROR]
test_1of5_replica_stop_and_start_with_meta_stop_and_start ... [ERROR]
test_2of5_replica_stop ... [ERROR]
test_3of3_replica_restart ... [ERROR]
test_5of5_replica_restart ... [ERROR]
test_can_not_connect ... [OK]
===============================================================================
[ERROR]
Traceback (most recent call last):
File "/home/hw/.local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
File "/home/hw/.local/lib/python2.7/site-packages/twisted/python/failure.py", line 408, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
File "tests/test_integration.py", line 140, in test_1of3_replica_restart
yield self.check_data()
File "/home/hw/.local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
File "/home/hw/.local/lib/python2.7/site-packages/twisted/python/failure.py", line 408, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
File "tests/test_integration.py", line 116, in check_data
ret = yield self.loop_op()
File "/home/hw/.local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1386, in _inlineCallbacks
result = g.send(result)
File "tests/test_integration.py", line 107, in loop_op
ret = yield self.c.get(self.TEST_HKEY + str(i), self.TEST_SKEY, 200)
File "pypegasus/pgclient.py", line 719, in get
return session.operate(op, timeout)
File "pypegasus/pgclient.py", line 90, in operate
self._reqs[seqid] = dr
exceptions.AttributeError: 'ReplicaSession' object has no attribute '_reqs'
test_integration.TestIntegration.test_1of3_replica_restart
所有ERROR均为exceptions.AttributeError: 'ReplicaSession' object has no attribute '_reqs'
打印当前模块的属性列表,写法示例:
logger.info('%s', dir(self))
if not hasattr(self, '_reqs'):
logger.error('no attr _reqs, %s', dir(self))
测试发现,一开始属性列表正常,在某一次get时该实例真的没有_reqs属性了,其余属性均存在。
Thrift header has a reserved filed called 'partition_hash' , default value is 0, server doesn't use this filed currently. However, it will be used in server supporting partition split, so we should fill in correct value of it.
partition_hash
value in thrift_headerneed_check_hash
filed in get_scanner_request
In order to get partition index, we need to calculate partition_hash by hash_key or blob_key(hash_key and sort_key). However, client partition_hash is not equal to the partition_hash calculated by server.
The wrong hash_value does not lead to write data to incorrect partition, but server will check equality between client partition_hash and the value calculated by itself if client partition_hash is not zero.
As a result, we should fix this bug
tools.py
line 31
error_types.ERR_OBJECT_NOT_FOUND 没这个 ERR_OK 属性
这里写错了,多写了一段 ERR_OBJECT_NOT_FOUND
return error_types.ERR_OK.value
解决
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.