Sachin Mittal
05/24/2025, 5:37 AMcom.mongodb.MongoCommandException: Command failed with error 286 (ChangeStreamHistoryLost): 'PlanExecutor error during aggregation :: caused by :: Resume of change stream was not possible, as the resume point may no longer be in the oplog.' on server xxxx.yyy.mongodb.net:27017. The full response is {"errorLabels": ["NonResumableChangeStreamError"], "ok": 0.0, "errmsg": "PlanExecutor error during aggregation :: caused by :: Resume of change stream was not possible, as the resume point may no longer be in the oplog.", "code": 286, "codeName": "ChangeStreamHistoryLost", "$clusterTime": {"clusterTime": {"$timestamp": {"t": 1747876810, "i": 30}}, "signature": {"hash": {"$binary": {"base64": "8rIRtcVyp/u8ddzGnA4Z5r1L79A=", "subType": "00"}}, "keyId": 7448674344508588123}}, "operationTime": {"$timestamp": {"t": 1747876810, "i": 30}}}
Now I have instantiated my Source as:
MongoDBSource.<T>builder()
...
.startupOptions(StartupOptions.initial())
.batchSize(2048)
.connectionOptions("heartbeat.interval.ms=5000")
.heartbeatIntervalMillis(5000)
.closeIdleReaders(true)
.deserializer(...)
.build();
As mentioned in docs, I have added heartbeat so for infrequently changed oplogs it does not fail, however it looks like these settings have no effect on the failure and still fails when I did not have the heartbeat.
Can anyone tell me what else I could fix here?
Are there any settings missing from the mongodb side?