Hello,
We're trying to use MongoDB as a global lock across multiple VMs. We've created a lock collection with a unique index on the type of lock, and we lock by trying to insert a record with a certain lock type value. If there's a duplicate exception, we know it's already locked. Otherwise, we know we're locked.
The problem now that we upgraded to 2.6.5 from 2.4 is that mongo sees the duplicate key exception as a user error and is logging it into our log files and counting it internally as a user error. So, our monitoring software keeps flagging this as an exception, whereas it's really the way the system was designed to run.
Any ideas how to suppress this behavior? Is there a way to configure the E11000 to be considered a normal use-case and not a user-exception? Maybe on a database or collection level? If not, is there another way to accomplish what we're trying to do without angering our monitoring software?
Thanks!