[SERVER-17922] Insert fails capped collection which is completely filled Created: 08/Apr/15  Updated: 10/Apr/15  Resolved: 10/Apr/15

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: None

Type: Question Priority: Major - P3
Reporter: Arati Sethy Assignee: Sam Kleinman (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

Hi,
I have mongodb with few capped collections up and running for last one month. I have used c-driver for insertition. Now i see a weired problem that , one of the capped collections does not rotate the data and does not insert the new records. Collection stats shows count > 45000, where as find does not print a single recored from the collection. This issue is happening only with one of the collection where as others are working fine.

MongoDB shell version: 2.2.2
connecting to: test
> use log
> db.log.find()
> db.log.stats()
{
"ns" : "log.log",
"count" : 45198,
"size" : 49610304,
"avgObjSize" : 1097.621664675428,
"storageSize" : 50335744,
"numExtents" : 1,
"nindexes" : 1,
"lastExtentSize" : 50335744,
"paddingFactor" : 1,
"systemFlags" : 1,
"userFlags" : 0,
"totalIndexSize" : 1684256,
"indexSizes" :

{ "_id_" : 1684256 }

,
"capped" : true,
"max" : 2147483647,
"ok" : 1
}
> db.log.find().limit(1)

I could see below logs from mongod server for sometime.

Wed Mar 11 04:18:24 [conn1] insert: couldn't alloc space for object ns:log.log capped:1

Please guide how to debug and resolve this issue.



 Comments   
Comment by Sam Kleinman (Inactive) [ 10/Apr/15 ]

Hello,

According to our support policy, 2.2 has reached end-of-life. You can see our support policy although I understand the complication in upgrading for your case, we are not able to continue to maintain and update 2.2. You can always reach out to the google group for help on issues with upgrading or issues with older versions and special situations. I'm going to close this ticket for now, but we'd be happy to look into this issue again if we can reproduce it on a current version of MongoDB.

Regards,
sam

Comment by Arati Sethy [ 09/Apr/15 ]

Hi Sam,
I am using mongod v2.2.2. It is being deployed last year.I used old libmongoc driver, libmongoc-0.7.
I can access the DB from shell as well as using above c-driver with tailable functionality.
Other working collections are also capped collections.
Details of data files for DB are as follows
total 209M
rw------ 1 root root 64M Apr 9 12:09 log.0
rw------ 1 root root 128M Apr 9 12:09 log.1
rw------ 1 root root 16M Apr 9 12:09 log.ns

drwxr-xr-x 2 root root 4.0K Apr 9 08:15 journal/
-rwxr-xr-x 1 root root 5 Mar 10 21:03 mongod.lock*
>ls journal/
total 3.1G
rw------ 1 root root 1.1G Apr 9 08:15 j._156
rw------ 1 root root 1.0G Apr 9 12:10 j._157
rw------ 1 root root 88 Apr 9 12:10 lsn
rw------ 1 root root 1.0G Jan 8 04:26 prealloc.2

My Application is running on a 4GB RAM box with 450GB hard disk out of which 330G is still free.

I have neither restarted mongod server nor dropped and created the collection again. I have same application running on 100 such server, this issue is seen only on one server. So I guess, there is no straing forward condition to reproduce this issue.
Hope this helps you to figure out the root cause. Please let me know if any further information is required.
I am not in favour of upgrading the db to 2.4 and so on , as it is running quite stable almost for a year.

Thanks,
Arati

Comment by Sam Kleinman (Inactive) [ 08/Apr/15 ]

The shell example that you posted uses version 2.2 of the shell. Is the mongod that you're using also 2.2? If you are using 2.2, is there anything that's preventing you from upgrading to a more recent version of MongoDB?

Once we can ensure that we're running one of the currently supported versions of MongoDB (at least 2.6 and preferably 3.0), it would be good to understand:

  • Which version of the driver are you using?
  • Can you access the data with the shell or another driver?
  • Are the other collections that still work capped or conventional? Are they part of the same database?
  • Can you reproduce this issue with a new capped collection?
  • How large your data files? What is your available storage? How much data is MongoDB actually storing?

For upgrade information see the following documents:

You can also contact one of our support channels for more help with upgrade-related issues.

I hope this helps and that we can help discover the underlying cause of the behavior that you're seeing as quickly as possible.

Cheers,
sam

Generated at Thu Feb 08 03:46:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.