I did remove a few results from db.actions using this syntax: db.actions.updateOne({"_id": "<model_uuid>:<action_id>"}, ($set: {"results": {} }})
Doing a find("_id": "<model_uuid>:<action_id>"}) shows an empty results entry.
Now when running a script (pylibjuju) the deltas still contains the previous data, as emptying results is not committed.
To let you know about the size of the model this morning.
Between the 18th around 11am, size=349717
This morning 21th around 05am, size=349964
So no much than 200 bytes fairly good.
Two thoughts.
The script is reduced to two “run” calls.
action = await unit_instance.run_action('backup') <= which obviously is the backup action, which should generate a first “delta”
action = await unit_instance.run(cmd.format()) <= and this, which will launch a cmd on the remote host, generating a second “delta”.
Thus, the minimum of deltas are created.
the second cmd is a string a of shell commands, to be performed after the dump from the backup run_action, where the backup folder is packed, move to storage, then things are cleaned up.
Each shell command is redirected to a local log file, minimizing the delta results entries.
Many thanks to all,
Know a bit more of juju internals.
Honestly, we shouldn’t be including the content of the action results in the all watcher delta. We could include the fact that an action has been run/status changed/etc, but the output of the action should not be in a Watcher stream.