Deleted documents but disk space is not released

  • version: 4.4
  • type: replica set

Is there any solution to release the disk space after document deletion? (would be great if the solution does not cause any downtime.)

Hello, welcome to the MongoDB community

After deleting the data, it is necessary to run a compact and then reduce the disk size.

same issues i need help please

NoSQL and SQL Database systems never release used disk space to operating system, even when a large amount of data were deleted. While in a SQL database, reorganizing tables or indexes regularly could lower storage requirement, MongoDB also needs “compact” operation to defragment space used.

Run the compression procedure on the read replicas, failover, and run on the old primary. This will solve your problem.