[SERVER-16728] Show collection doesn't show some collections Created: 01/Jan/15 Updated: 05/Feb/16 Resolved: 09/Mar/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Storage |
| Affects Version/s: | 2.4.9 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Shaked S | Assignee: | Ramon Fernandez Marina |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL |
| Participants: |
| Description |
|
Hello, We have a problem in the production where show collections doesn't show all of the collections, This happened on 3 servers - 2 Cetons, and 1 windows. Some time after (about 3 weeks) the bug just disappear, and after changing the mongo tables, starts again - not always, just sometimes. We have no sharding, we do run the "use" command, and we cannot reproduce this. Restarting mongod service doesn't solve this. |
| Comments |
| Comment by Ramon Fernandez Marina [ 05/Feb/16 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
matt@clenchmedia.com, a 2.4.14 shell will have trouble with some operations on a 3.0+ server, so that could easily explain the behavior you're seeing. I'm thinking of Since 2.4.14 is quite old at this stage I'd strongly recommend you upgrade to a recent version (3.2.1 is the latest stable, 3.2.2-rc0 release candidate was released today). If after the upgrade you're still experiencing problems please open a new SERVER ticket and we'll take a closer look. Thanks, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Matt Vincelli [ 05/Feb/16 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Update to the previous comment. I noticed that the mongo shell version was different on my two systems (2.4.14 vs 3.0.9). I upgraded mongodb-org per the instructions at https://docs.mongodb.org/manual/tutorial/install-mongodb-on-red-hat/ and retried the commands on the remote server. Lo and behold, it worked correctly! My only guess is that I am using WiredTiger collections and the 2.4.14 shell can only read Mmap collections (since WiredTiger was introduced in 3.0+). But if that were the case, then why could the shell perform a db.record.count() correctly, but couldn't show the collections??? Regards, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Matt Vincelli [ 05/Feb/16 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I just started to experience this issue on my server. It is a single node Replica set, so it is the Primary. Nothing shows up in the logs that I can see. The command "show databases" works fine, but "show collections" returns an empty array. Although I can still access data in a collection if I know the name of the collection.
In doing some testing on this, it seems to only be affected when remotely connecting to a mongo server. If I connect directly to the server running mongod, then everything works.
I have not repaired my tables at all. The tried restarted mongod (using Mongo MMS), but the situation persisted. Could it be a permissions issue? Regards, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ramon Fernandez Marina [ 09/Mar/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thanks for letting us know shaked. Yes, if this happens again re-opening the ticket and sending full logs will be the first steps – we'll cross that bridge if/when we get to it. Regards, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Shaked S [ 09/Mar/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hello, No problem. Actually, this hasn't happened again since the creation of this issue (no change in packages versions, or in uploaded databases). When this behaviour will occur again, I will be happy to send full log (only /var/log/mongo folder, right?) to the private and secure upload you suggested. Thank you, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ramon Fernandez Marina [ 05/Mar/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Apologies for the long delay shaked; the information about --repair makes me wonder if there's a race condition somewhere or an "accounting error" when keeping track of collections. If this happens again, would you be able to upload the database file(s) containing the affected collection(s) so we can investigate further? Having full server logs may be useful as well. I can provide a private and secure upload so your data is only accessible to MongoDB staff for the purpose of troubleshooting this ticket – please let me know and I'll send you the details on the upload procedure. Thanks, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Shaked S [ 06/Jan/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Yes this is the case. The servers are no replica sets, but just stand alone servers. And yes - we sometimes dropping and creating the collections anew (part of some process we need). We found out that after `mongod --repair` command the collections disappear, and we can create them again. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ramon Fernandez Marina [ 05/Jan/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
shaked, if I understand correctly, the scenario you're describing is as follows:
Is this the case? Can you please provide some more information about your setup, including the MongoDB version? You mention three servers – do they form a replica set or are they stand-alone? Can you also elaborate on what you mean when you say "after changing the mongo tables"? Do you have multiple clients creating and dropping collections? |