Mgopurge 1.7.1 released

I have officially published a 1.7.1 of mgopurge available from:

There isn’t a huge change from 1.7. It’s mostly ‘slightly less verbose’ in the default logging (it was TRACE), and fixing a bug where we accidentally set the txn pruning batch size to 100k instead of 1M.

Generally, mgopurge should only be used if you are having database corruption issues. Otherwise all of the important steps that can be run on a live system are already being run by Juju. However, if you want to give it a go, you can do something like:

  $ juju ssh -m controller 0
  $$ sudo snap install mgopurge
  $$ agent=$(cd /var/lib/juju/agents; echo machine-*)
  $$ pw=$(sudo grep statepassword /var/lib/juju/agents/${agent}/agent.conf | cut '-d ' -sf2)
  $$ mgopurge -password ${pw} -user ${agent} -stages prune

The ‘prune’ stage is one that is safe to be run on a live controller (juju itself should be running that code every hour or so.) The ‘resume’ stage is also safe, but juju should be running that every 5 minutes.

It also has other stages that look for corrupted transactions, and also compacts all the collections in the database, since after running a cleanup, many collections get a lot smaller. However, things like compact take out a lock on the database, and so block running operations, so should not be done on a live system.

2 Likes