Hi
The very same insert was running fine for years and nothing else changed
Although perhaps your application doesn’t change, the data in your database definitely changed over the years. If you have many inserts and deletes, data inside the data files would eventually be fragmented and thus would slow down the database in some cases.
warning: slow scan in allocFromFreeList (in write lock)
This message typically shows up on ext3 filesystem and usually doesn’t show up when the underlying filesystem is XFS as recommended in the Production Notes for MongoDB 2.4. To ensure smooth operation, please make sure that your deployment follows all the recommendations put forth in the Production Notes.
Since you have a replica set, the best way forward is to perform an initial sync on the problematic node. This would remove the datafiles fragmentation. See https://docs.mongodb.com/v2.4/core/replica-set-sync/ for more details.
Performing initial sync is a major maintenance procedure. Please ensure you have backups and tested the procedure thoroughly before executing it in production.
We are currently using 2.4.9 mongodb
This version was released in January 2014 and is not supported anymore. Your issue could be caused by SERVER-14082 which was fixed. Note that you cannot upgrade from 2.4.9 straight into the latest version. That is, the upgrade procedure involve upgrading to successive major versions, so to upgrade to the latest MongoDB version (currently 3.6.0), you would have to do 2.4 -> 2.6 -> 3.0 -> 3.2 -> 3.4 -> 3.6. Note that this doesn’t involve upgrading to the WiredTiger storage engine, which is orthogonal to the versions upgrade.
Best regards
Kevin