[SERVER-73867] Improve logging at compact end Created: 10/Feb/23  Updated: 29/Oct/23  Resolved: 28/Feb/23

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

Type: Improvement Priority: Major - P3
Reporter: Yujin Kang Park Assignee: Yujin Kang Park
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Storage Execution
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2023-03-06
Participants:

 Description   

On finalizing a collection (and indices) compact call, the amount of freed space is logged here.

It is possible for compact to actually cause the file size to grow instead of shrink, if there is little free space. This is because compacts also cause checkpoints to happen, which need to grow the file. If the compact operation results in no space reduction, and the checkpoint causes the file to grow, we will have a situation where pre-compact size is smaller than post-compact one.

Size diff is computed as an unsigned long, so this results in an underflow and a very large number of freed bytes being reported.

For instance, this can be observed in all runs of compact.js:

[fsm_workload_test:compact] Fixture status:
...
[j0] | 2023-02-03T03:45:28.578-05:00 I  STORAGE  20286   [conn850] "Compact end","attr":{"namespace":"test28_fsmdb0.compact_1","freedBytes":18446744073709441024}...

 



 Comments   
Comment by Githook User [ 28/Feb/23 ]

Author:

{'name': 'Yu Jin Kang Park', 'email': 'yujin.kang@mongodb.com', 'username': 'ykangpark'}

Message: SERVER-73867 Improve logging at compact end
Branch: master
https://github.com/mongodb/mongo/commit/2293380500c18cfeb8eaa3d0f1353aae34f799f0

Comment by Gregory Noma [ 14/Feb/23 ]

We might want to just report the before/after separately

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