[SERVER-8271] Replace serverStatus.locks with array of dbs Created: 22/Jan/13  Updated: 06/Dec/22  Resolved: 09/Aug/18

Status: Closed
Project: Core Server
Component/s: Admin, Diagnostics
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Scott Hernandez (Inactive) Assignee: Backlog - Replication Team
Resolution: Won't Fix Votes: 0
Labels: serverstatus
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Replication
Participants:

 Description   

Currently server.locks returns a document with a field for each db, but db names can have chars that are not allowed for storage in mongodb ("$", ".")

If we return an array instead of a document then we can save them.

"locks" : {
  "." : {
    "timeLockedMicros" : {
      "R" : NumberLong(0),
      "W" : NumberLong(10898)
    },
    "timeAcquiringMicros" : {
      "R" : NumberLong(0),
      "W" : NumberLong(4990)
    }
  },
  "admin" : {
    "timeLockedMicros" : {
      "r" : NumberLong(20),
      "w" : NumberLong(0)
    },
    "timeAcquiringMicros" : {
      "r" : NumberLong(2),
      "w" : NumberLong(0)
    }
  },
  "local" : {
    "timeLockedMicros" : {
      "r" : NumberLong(36),
      "w" : NumberLong(0)
    },
    "timeAcquiringMicros" : {
      "r" : NumberLong(9),
      "w" : NumberLong(0)
    }
  }

should become:

"locks" : [
  { "database" : ".", 
    "timeLockedMicros" : {
      "R" : NumberLong(0),
      "W" : NumberLong(10898)
    },
    "timeAcquiringMicros" : {
      "R" : NumberLong(0),
      "W" : NumberLong(4990)
    }
  },
  { "database" : "admin", 
    "timeLockedMicros" : {
      "r" : NumberLong(20),
      "w" : NumberLong(0)
    },
    "timeAcquiringMicros" : {
      "r" : NumberLong(2),
      "w" : NumberLong(0)
    }
  },
  { "database" : "local",
      "timeLockedMicros" : {
      "r" : NumberLong(36),
      "w" : NumberLong(0)
    },
    "timeAcquiringMicros" : {
      "r" : NumberLong(9),
      "w" : NumberLong(0)
    }
  }
]


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