I have a 3 shard mongo cluster running 5.0v
Each shard is a 3 node replicaSet
It’s fronted by a 3 node config server replicaset and finally by a mongos server
Pretty standard
The application is connecting to the mongos server using pymongo 3.7 (tested on 3.13 as well)
Issue:
**Collection A of Db B is present on SHARD3 . The collection isn’t sharded **. # This is Important to remember.
CRUD operations are working fine on this collection.
But, as soon as I start watching for changes on collection A,
with collectionA.watch(start_at_operation_time=Timestamp(some_date_present_in_oplog,1)) as stream:
for change in stream:
print(change)
Exception:
‘Error on remote shard SHARD2:port
Executor error during getMore :: caused by :: Resume of change stream was not possible, as the resume point may no longer be in the oplog.
First it wasn’t clear what’s going on so I check the oplog entries on each of the SHARDS(1,2,3)
SHARD3 is where my collection is present has oplog entries way before my supplied timestamp, then after checking the error, realised it is trying to read oplog from SHARD2 instead of SHARD3 where indeed the oplog is quite recent.
On SHARD2
rs.printReplicationInfo()
configured oplog size: 30374.423828125MB
log length start to end: 99129secs (27.54hrs)
oplog first event time: Tue Jun 25 2024 10:48:49 GMT+0530 (IST)
oplog last event time: Wed Jun 26 2024 14:20:58 GMT+0530 (IST)
now: Wed Jun 26 2024 14:20:58 GMT+0530 (IST)
On SHARD3
rs.printReplicationInfo()
configured oplog size: 30374.4169921875MB
log length start to end: 8905804secs (2473.83hrs)
oplog first event time: Fri Mar 15 2024 12:31:39 GMT+0530 (IST)
oplog last event time: Wed Jun 26 2024 14:21:43 GMT+0530 (IST)
now: Wed Jun 26 2024 14:21:47 GMT+0530 (IST)
Help Required:
I am right now not able figure out what’s causing it to query SHARD2 while watching changes. Need help figure this out
Trying going through the documentation and change logs to see if this issue was addressed but couldn’t find anything