[SERVER-60988] empty chunk mongo 5.0 Created: 20/Oct/21  Updated: 06/Dec/22  Resolved: 03/Nov/21

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

Type: Question Priority: Major - P3
Reporter: Manu Manu Assignee: Backlog - Triage Team
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Server Triage
Participants:

 Description   

Dear mongo dev,

 

With mongodb 5.0, if i have a shard collection with a key {"serial":1}, and a datetime TTL.

i can get a chunk with serial 1, another chunk with serial 2. but one day i can have the chunk with serial 1 empty.

How i can remove the unnecessary chunk, how can i know this chunk is empty ?

with mongodb 5.0 scripts like :

var ns = "ns.col";
var key = db.getSiblingDB("config").collections.findOne({_id: ns}).key;
db.getSiblingDB("config").chunks.find({ns : ns}).forEach(function(chunk) {
  var ds = db.getSiblingDB(chunk.ns.split(".")[0]).runCommand({datasize:chunk.ns, keyPattern:key, min:chunk.min, max:chunk.max, estimate:true});
  var size = ds.size/(1024*1024);
  printjson({chunk:chunk._id, datasize_MB: size});
});

doesn't work anymore because in config.chunk doesn't have NS now.

 

Moreover i think mongodb should remove empty chunk automatically.

 

 



 Comments   
Comment by Edwin Zhou [ 03/Nov/21 ]

Hi emmanuel.bial@forcewan-lelab.fr,

Thank you for your report. The SERVER project is reserved for reporting bugs related to the MongoDB server. As this appears to be a question, we'd like to encourage you to start by asking our community for help by posting on the MongoDB Developer Community Forums.

If the discussion there leads you to suspect a bug in the MongoDB server, then we'd want to investigate it as a possible bug here in the SERVER project.

Best,
Edwin

Comment by Tim Fogarty [ 26/Oct/21 ]

Hi emmanuel.bial@forcewan-lelab.fr, the Tools Jira project is for tracking bugs and features of the MongoDB Database Tools (that's mongoimport, mongorestore, etc). It sounds like you're asking about the server, so I will move this ticket to the Server project so the most relevant team can take a look.

Generated at Thu Feb 08 05:51:15 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.