rwynn/monstache

When run in an AWS multinode environment monstache throws error "Error starting change stream...cannot run with a readConcern other than 'majority'..."

shagidelic opened this issue · 1 comments

I am working on a monstache (v.6.7.10), elasticsearch (v.7.17.8), and mongodb (v.4.4) multi-node replicaset.
Everything works great locally with a docker-compose setup, however, when deployed on AWS where containers might be running on separate VMs, monstache container generates following error:

`ERROR 2023/03/14 02:51:26 Error starting change stream. Will retry: (InvalidOptions) Command aggregate does not support { readConcern: { level: "available", provenance: "clientSupplied" } } :: caused by :: Aggregation stage $changeStream cannot run with a readConcern other than 'majority'. Current readConcern: available
Event
Level (err)
Type (0x6F411005)
Retain
Export

command
/bin/monstache -f ./monstache.config.toml`

We have generated a monstache plugin too that we are using for mapping fields.

Same project is running fine locally, why is it generating this issue?

Locally, the readConcern is 'majority' which is set by default, however, on production it seems to be set to 'available'.

Any clues?

Found the issue. Our deployment team was sending the readConcernLevel as part of connection string and it was set to available. All we had to do was change it to majority for monstache container and it solved the issue.