|
We have checked this bug at MongoDB 2.6.
Bug still exist 
Test script use partial bit.
We expect, that Mongos MUST return Data (Partial=True). But in fact, no Data returned.
1. All mongo replica-sets available for Mongos.
All ok, we got 1000000 records.
%%
$ time ./test.py
Collection(Database(Connection('jkp-mrs03', 27017), u'test'), u'test_collection')
1000000
real 0m9.977s
user 0m7.032s
sys 0m0.136s
%%
2. Master of 1st replica-set not available from Mongos (iptables -j DROP)
1st request - no answer during 2 minutes
2nd request - no data returned
1st request:
%%
$ time ./test.py
Collection(Database(Connection('jkp-mrs03', 27017), u'test'), u'test_collection')
^CTraceback (most recent call last):
File "./test.py", line 12, in <module>
for user in coll.find({},partial=True):
File "/usr/lib/python2.7/dist-packages/pymongo/cursor.py", line 904, in next
if len(self.__data) or self._refresh():
File "/usr/lib/python2.7/dist-packages/pymongo/cursor.py", line 848, in _refresh
self.__uuid_subtype))
File "/usr/lib/python2.7/dist-packages/pymongo/cursor.py", line 782, in __send_message
res = client._send_message_with_response(message, **kwargs)
File "/usr/lib/python2.7/dist-packages/pymongo/mongo_client.py", line 1042, in _send_message_with_response
response = self.__send_and_receive(message, sock_info)
File "/usr/lib/python2.7/dist-packages/pymongo/mongo_client.py", line 1020, in __send_and_receive
return self.__receive_message_on_socket(1, request_id, sock_info)
File "/usr/lib/python2.7/dist-packages/pymongo/mongo_client.py", line 1003, in __receive_message_on_socket
header = self.__receive_data_on_socket(16, sock_info)
File "/usr/lib/python2.7/dist-packages/pymongo/mongo_client.py", line 991, in __receive_data_on_socket
chunk = sock_info.sock.recv(length)
KeyboardInterrupt
real 2m10.274s
user 0m0.044s
sys 0m0.028s
%%
2nd request:
%%
$ time ./test.py
Collection(Database(Connection('jkp-mrs03', 27017), u'test'), u'test_collection')
Traceback (most recent call last):
File "./test.py", line 12, in <module>
for user in coll.find({},partial=True):
File "/usr/lib/python2.7/dist-packages/pymongo/cursor.py", line 904, in next
if len(self.__data) or self._refresh():
File "/usr/lib/python2.7/dist-packages/pymongo/cursor.py", line 848, in _refresh
self.__uuid_subtype))
File "/usr/lib/python2.7/dist-packages/pymongo/cursor.py", line 800, in __send_message
self.__uuid_subtype)
File "/usr/lib/python2.7/dist-packages/pymongo/helpers.py", line 100, in _unpack_response
error_object["$err"])
pymongo.errors.OperationFailure: database error: ReplicaSetMonitor no master found for set: jkp_db_mongo-testing-default-1
real 0m0.130s
user 0m0.060s
sys 0m0.008s
%%
3. Master of 1st replica-set not available from Mongos (iptables -j DROP)
Master of 2nd replica-set not available from Mongos (iptables -j DROP)
No data returned.
%%
$ time ./test.py
Collection(Database(Connection('jkp-mrs03', 27017), u'test'), u'test_collection')
Traceback (most recent call last):
File "./test.py", line 12, in <module>
for user in coll.find({},partial=True):
File "/usr/lib/python2.7/dist-packages/pymongo/cursor.py", line 904, in next
if len(self.__data) or self._refresh():
File "/usr/lib/python2.7/dist-packages/pymongo/cursor.py", line 848, in _refresh
self.__uuid_subtype))
File "/usr/lib/python2.7/dist-packages/pymongo/cursor.py", line 800, in __send_message
self.__uuid_subtype)
File "/usr/lib/python2.7/dist-packages/pymongo/helpers.py", line 100, in _unpack_response
error_object["$err"])
pymongo.errors.OperationFailure: database error: ReplicaSetMonitor no master found for set: jkp_db_mongo-testing-default-2
real 0m4.107s
user 0m0.048s
sys 0m0.016s
%%
|
|
Hi Tomas,
We use mongos, because backend work with sharded cluster mongodb
mongo01b.vd:27017 - mongos.
mongo01b.vd:27018 - mongodb node replica set.
mongos logs during problem attached to this task .
To reproduce the problem, while working through mongos can perform on Primary node replicaset:
iptables -A INPUT -s mongo01b.vd -p tcp-m tcp - dport 27018 -j REJECT -reject-with icmp-port-unreachable
|
Full sh.status() when all the PRIMARY available
mongos> sh.status()
|
--- Sharding Status ---
|
sharding version: {
|
"_id" : 1,
|
"version" : 3,
|
"minCompatibleVersion" : 3,
|
"currentVersion" : 4,
|
"clusterId" : ObjectId("515045432ceb043cdbb2184d")
|
}
|
shards:
|
{ "_id" : "video-test-mongodb-1", "host" : "video-test-mongodb-1/mongo01a.vd.yandex.net:27018,mongo01b.vd.yandex.net:27018,mongo01c.vd.yandex.net:27018" }
|
{ "_id" : "video-test-mongodb-2", "host" : "video-test-mongodb-2/mongo02a.vd.yandex.net:27018,mongo02b.vd.yandex.net:27018,mongo02c.vd.yandex.net:27018" }
|
databases:
|
{ "_id" : "admin", "partitioned" : false, "primary" : "config" }
|
{ "_id" : "video_meta", "partitioned" : true, "primary" : "video-test-mongodb-1" }
|
video_meta.users
|
shard key: { "_id" : 1 }
|
chunks:
|
video-test-mongodb-2 1
|
video-test-mongodb-1 1
|
{ "_id" : { "$minKey" : 1 } } -->> { "_id" : NumberLong(134685) } on : video-test-mongodb-2 Timestamp(2, 0)
|
{ "_id" : NumberLong(134685) } -->> { "_id" : { "$maxKey" : 1 } } on : video-test-mongodb-1 Timestamp(2, 1)
|
{ "_id" : "video_live_apps", "partitioned" : false, "primary" : "video-test-mongodb-1" }
|
{ "_id" : "test", "partitioned" : false, "primary" : "video-test-mongodb-2" }
|
{ "_id" : "users", "partitioned" : false, "primary" : "video-test-mongodb-2" }
|
{ "_id" : "video_bazinga", "partitioned" : false, "primary" : "video-test-mongodb-2" }
|
{ "_id" : "condig", "partitioned" : false, "primary" : "video-test-mongodb-2" }
|
{ "_id" : "video_misc", "partitioned" : false, "primary" : "video-test-mongodb-2" }
|
{ "_id" : "video_moderator", "partitioned" : false, "primary" : "video-test-mongodb-1" }
|
{ "_id" : "video_fod", "partitioned" : false, "primary" : "video-test-mongodb-1" }
|
{ "_id" : "video_user_data", "partitioned" : true, "primary" : "video-test-mongodb-1" }
|
video_user_data.album_films
|
shard key: { "_id" : 1 }
|
chunks:
|
video-test-mongodb-2 1
|
video-test-mongodb-1 1
|
{ "_id" : { "$minKey" : 1 } } -->> {
|
"_id" : {
|
"u" : NumberLong(92860164),
|
"n" : 100000002,
|
"fu" : NumberLong(92860164),
|
"fn" : 1
|
}
|
} on : video-test-mongodb-2 Timestamp(2, 0)
|
{
|
"_id" : {
|
"u" : NumberLong(92860164),
|
"n" : 100000002,
|
"fu" : NumberLong(92860164),
|
"fn" : 1
|
}
|
} -->> { "_id" : { "$maxKey" : 1 } } on : video-test-mongodb-1 Timestamp(2, 1)
|
video_user_data.albums
|
shard key: { "_id" : 1 }
|
chunks:
|
video-test-mongodb-2 1
|
video-test-mongodb-1 2
|
{ "_id" : { "$minKey" : 1 } } -->> { "_id" : { "u" : NumberLong(134685), "n" : 100000001 } } on : video-test-mongodb-2 Timestamp(2, 0)
|
{ "_id" : { "u" : NumberLong(134685), "n" : 100000001 } } -->> { "_id" : { "u" : NumberLong("1130000000614322"), "n" : 100000001 } } on : video-test-mongodb-1 Timestamp(2, 2)
|
{ "_id" : { "u" : NumberLong("1130000000614322"), "n" : 100000001 } } -->> { "_id" : { "$maxKey" : 1 } } on : video-test-mongodb-1 Timestamp(2, 3)
|
video_user_data.film_albums
|
shard key: { "_id" : 1 }
|
chunks:
|
video-test-mongodb-2 1
|
video-test-mongodb-1 1
|
{ "_id" : { "$minKey" : 1 } } -->> {
|
"_id" : {
|
"u" : NumberLong(92860164),
|
"n" : 1,
|
"au" : NumberLong(92860164),
|
"an" : 100000002
|
}
|
} on : video-test-mongodb-2 Timestamp(2, 0)
|
{
|
"_id" : {
|
"u" : NumberLong(92860164),
|
"n" : 1,
|
"au" : NumberLong(92860164),
|
"an" : 100000002
|
}
|
} -->> { "_id" : { "$maxKey" : 1 } } on : video-test-mongodb-1 Timestamp(2, 1)
|
video_user_data.films
|
shard key: { "_id" : 1 }
|
chunks:
|
video-test-mongodb-2 11
|
video-test-mongodb-1 10
|
too many chunks to print, use verbose if you want to force print
|
video_user_data.url_to_ext_film_id
|
shard key: { "_id" : 1 }
|
chunks:
|
video-test-mongodb-2 1
|
video-test-mongodb-1 2
|
{ "_id" : { "$minKey" : 1 } } -->> { "_id" : "http://rutube.ru/tracks/43531.html" } on : video-test-mongodb-2 Timestamp(2, 0)
|
{ "_id" : "http://rutube.ru/tracks/59435.html" } -->> { "_id" : "http://www.qwey.ru/watch/78424-cvet-cheremuhi" } on : video-test-mongodb-1 Timestamp(2, 2)
|
{ "_id" : "http://www.qwey.ru/watch/78424-cvet-cheremuhi" } -->> { "_id" : { "$maxKey" : 1 } } on : video-test-mongodb-1 Timestamp(2, 3)
|
video_user_data.users
|
shard key: { "_id" : 1 }
|
chunks:
|
video-test-mongodb-2 1
|
video-test-mongodb-1 1
|
{ "_id" : { "$minKey" : 1 } } -->> { "_id" : NumberLong(161207) } on : video-test-mongodb-2 Timestamp(2, 0)
|
{ "_id" : NumberLong(161207) } -->> { "_id" : { "$maxKey" : 1 } } on : video-test-mongodb-1 Timestamp(2, 1)
|
video_user_data.votes
|
shard key: { "_id" : 1 }
|
chunks:
|
video-test-mongodb-2 1
|
video-test-mongodb-1 1
|
{ "_id" : { "$minKey" : 1 } } -->> {
|
"_id" : {
|
"u" : NumberLong("4611686018550228167"),
|
"n" : 98434511,
|
"v" : NumberLong(1549920)
|
}
|
} on : video-test-mongodb-2 Timestamp(2, 0)
|
{
|
"_id" : {
|
"u" : NumberLong("4611686018550228167"),
|
"n" : 98434511,
|
"v" : NumberLong(1549920)
|
}
|
} -->> { "_id" : { "$maxKey" : 1 } } on : video-test-mongodb-1 Timestamp(2, 1)
|
{ "_id" : "video_view_counts", "partitioned" : false, "primary" : "video-test-mongodb-1" }
|
{ "_id" : "video_storage", "partitioned" : false, "primary" : "video-test-mongodb-1" }
|
{ "_id" : "meta", "partitioned" : false, "primary" : "video-test-mongodb-1" }
|
|