Releases: juju/mgopurge
1.9.1
This release has 2 key features:
- CLI argument
-skip-stages. This is in contrast with-stages. Instead of supplying the list of stages that you want to run, you supply just the list of stages that you want to skip. (egmgopurge -skip-stages compact). This avoids having to remember all of the stages that could be run, just to skip one. - New stage
invalidreferences. This is the converse of thepurgemissingstage. Instead of finding documents that reference transactions that are no longer present, this finds transactions that reference documents that are no longer present. It sets the stage of the transaction from 'prepared' back to 'preparing', which under normal operation causes the assertions to fail and the transaction to get rejected.
Behind the scenes this also moves the build system away from GB to using regular go.mod to pin the versions of dependencies that we need, which simplifies the build infrastructure and makes it easier to support the latest snapcraft features. It is also built core18, which is the same core image that the Juju snap currently utilizes. But it should be easy to move to core20 when the time comes.
mgopurge v1.8
Update mgopurge to prune transactions in a more incremental fashion.
Rather than grabbing all of the txn ids and then iterating all
documents, we can assume that a txn won't be referenced by anything
other than the documents that it refers to. And then we know that some
documents are going to be referenced many times over, so we cache
recently viewed documents so we don't have to reread the database.
This greatly speeds up the time-to-first removal. Further, we changed
the algorithm to parallelize the removal of txns, which is the bulk of
the time spent. This shows up to a 5x improvement in how quickly we are
able to cleanup the database. Both of these should prevent us from
ending up in a backlog of transactions that we are not able to keep up
with.
Also make sure that we are using the latest versions of mgo and other
dependencies.
Performance wise, we've seen speeds as high as 30,000 transactions/second
on an idle system, and even 15,000 txns/s while a system was otherwise loaded.
1.7.1 Released
This has a couple small updates vs 1.7. Most notably:
- Improvements in logging. Both better update messages and a default to less verbosity. See -logging-config to override the default logging information.
- Fix the number of txns to batch (we accidentally were set to 100k, when we wanted 1M).
- Now available as the snap 'mgopurge' from the snap store.
v1.7
This updates our dependency trees and provides 2 new pieces of functionality:
- Avoids compacting system.* tables
- Trimming transactions now properly handle transactions that involve inserting a new doc (where the actual transaction queue in question is in txns.stash not the table that the document will end up in).
v1.6
This version adds a new trim stage which cleans up txn-queue fields with a length over 1000 which is a symptom of mgo/txn metadata corruption. Cleaning up these oversized txn-queue fields means that the "resume" phase no longer gets stuck trying to execute the huge number of piled up transactions.
Additionally, the "compact" phase now also compacts the Juju logs database, releasing space used by deleted log data back to the operating system.
v1.5
This release pulls in the latest transaction pruning work from http://github.com/juju/txn. This means that pruning works on with MongoDB 2.4 again, and mgopurge is now more careful about transaction pruning, preserving the last hour of transactions.
1.4
This release pulls in the latest github.com/juju/txn changes so that all completed transactions are removed from documents, resulting in the most comprehensive cleanup of transaction data. This means that the "machines" and "apihostports" stages are no longer required and have been removed.
Additionally, the "resume" stage was moved to run before "prune" so that any transactions completed by the resume stage can also be cleaned up in "prune".
v1.3
These release has two changes:
- New "presence" stage which removes the presence database. The presence database can often be large and will be recreated when controllers restart.
- The
compactcommand is now used to recover disk space when the WiredTiger storage engine is in use. This requires much less free disk space.
v1.2
v1.1
Highlights:
-
New txn pruning algorithm: much faster and doesn't consume vast amount of RAM.
-
Ability to selectively run any set of mgopurge's cleanup stages. Stages will still always be run in the correct order. This changes the command line somewhat. The old flags to enable and disable stages have been removed and replaced with
-stages.
$ ./mgopurge -list # list available stages
apihostports: Repair runaway transactions for apiHostPorts document
purgemissing: Purge orphaned transactions
machines: Remove references to completed transactions in machines collection
prune: Prune unreferenced transactions
compact: Compact database to release disk space
resume: Resume incompleted transactions
$ ./mgopurge ... -stages prune,compact # selectively run the prune and compact stages
...
If -stages isn't provided, all stages are run (as before).