[SERVER-11026] sh.status() not reflecting dropped databases Created: 03/Oct/13  Updated: 10/Dec/14  Resolved: 07/Oct/13

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

Type: Bug Priority: Critical - P2
Reporter: Howard Lee Assignee: Unassigned
Resolution: Done Votes: 0
Labels: dropDatabase, sh, sh.status(), shard, status()
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

CentOS Linux release 6.0 (Final)


Operating System: Linux
Steps To Reproduce:

1. log into mongo shell in both primaries.
2. db.dropDatabase()
3. log into mongo shell for mongos
4. sh.status()

Participants:

 Description   

Setup:
Two shards both in 3-member replica set

Problem:
sh.status() not reflecting changes, still shows databases that are dropped.

In all members of replica set:

s1:PRIMARY> show dbs
admin   (empty)
config  (empty)
local   1.03076171875GB
 
s0:PRIMARY> show dbs
admin   (empty)
config  (empty)
local   1.03076171875GB

But in mongos:

mongos> sh.status()
--- Sharding Status ---
  sharding version: {
        "_id" : 1,
        "version" : 3,
        "minCompatibleVersion" : 3,
        "currentVersion" : 4,
        "clusterId" : ObjectId("52379d1365ee53adcc8cad42")
}
  shards:
        {  "_id" : "s0",  "host" : "s0/chelarcpoc008.karmalab.net:27017,chelarcpoc009.karmalab.net:27017,chelarcpoc010.karmalab.net:27017" }
        {  "_id" : "s1",  "host" : "s1/chelarcpoc011.karmalab.net:27017,chelarcpoc012.karmalab.net:27017,chelarcpoc013.karmalab.net:27017" }
  databases:
        {  "_id" : "enron",  "partitioned" : true,  "primary" : "s0" }
                enron.messages
                        shard key: { "headers.From" : 1 }
                        chunks:
                                s1      6
                                s0      7
                        { "headers.From" : { "$minKey" : 1 } } -->> { "headers.From" : "bruce.lundstrom@enron.com" } on : s1 Timestamp(2, 0)
                        { "headers.From" : "bruce.lundstrom@enron.com" } -->> { "headers.From" : "dan.dietrich@enron.com" } on : s1 Timestamp(3, 0)
                        { "headers.From" : "dan.dietrich@enron.com" } -->> { "headers.From" : "e..haedicke@enron.com" } on : s1 Timestamp(4, 0)
                        { "headers.From" : "e..haedicke@enron.com" } -->> { "headers.From" : "ginger.dernehl@enron.com" } on : s1 Timestamp(5, 0)
                        { "headers.From" : "ginger.dernehl@enron.com" } -->> { "headers.From" : "jeffrey.shankman@enron.com" } on : s1 Timestamp(6, 0)
                        { "headers.From" : "jeffrey.shankman@enron.com" } -->> { "headers.From" : "kevinscott@onlinemailbox.net" } on : s1 Timestamp(7, 0)
                        { "headers.From" : "kevinscott@onlinemailbox.net" } -->> { "headers.From" : "marcus.nettelton@enron.com" } on : s0 Timestamp(7, 1)
                        { "headers.From" : "marcus.nettelton@enron.com" } -->> { "headers.From" : "michael.tribolet@enron.com" } on : s0 Timestamp(1, 7)
                        { "headers.From" : "michael.tribolet@enron.com" } -->> { "headers.From" : "phillip.love@enron.com" } on : s0 Timestamp(1, 8)
                        { "headers.From" : "phillip.love@enron.com" } -->> { "headers.From" : "rudwell.johnson@enron.com" } on : s0 Timestamp(1, 9)
                        { "headers.From" : "rudwell.johnson@enron.com" } -->> { "headers.From" : "stanley.horton@enron.com" } on : s0 Timestamp(1, 10)
                        { "headers.From" : "stanley.horton@enron.com" } -->> { "headers.From" : "trials@stockbottom.com" } on : s0 Timestamp(1, 11)
                        { "headers.From" : "trials@stockbottom.com" } -->> { "headers.From" : { "$maxKey" : 1 } } on : s0 Timestamp(1, 12)
        {  "_id" : "admin",  "partitioned" : false,  "primary" : "config" }
        {  "_id" : "dummy",  "partitioned" : false,  "primary" : "s1" }
        {  "_id" : "test",  "partitioned" : false,  "primary" : "s0" }

Why is sh.status() still showing databases that I've deleted? Almost an hour now.



 Comments   
Comment by Daniel Pasette (Inactive) [ 07/Oct/13 ]

You must run dropDatabase from a mongos to register the change in the config database, which is being used for sh.status().

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