As part of ETL process our shell scripts are using mongosh
to execute queries and retrieve data from MongoDB. When multiple processes are attempting to use mongosh in parallel, we randomly observe Error: ENOENT: no such file or directory, lstat '~/.mongodb/mongosh/xxxxxxxxxxxxx_log'
and process gets terminated.
It appears mongosh can only store 100 log files in ~/.mongodb/mongosh
directory and the rest gets purged. When mongosh attempts to reuse an old / existing session_id (which I assume is controlled by Mongo server) and if log file with that session_id is already purged, it throws an error. We couldn’t find a way to either disable logs generated by mongosh or increase the number of log files mongosh can hold.
Has anyone experienced a similar situation? If there is any workaround or an alternate solution to try out, please do advise.
Thanks.