swift/swift/obj
Samuel Merritt b971280907 Let developers/operators add watchers to object audit
Swift operators may find it useful to operate on each object in their
cluster in some way. This commit provides them a way to hook into the
object auditor with a simple, clearly-defined boundary so that they
can iterate over their objects without additional disk IO.

For example, a cluster operator may want to ensure a semantic
consistency with all SLO segments accounted in their manifests,
or locate objects that aren't in container listings. Now that Swift
has encryption support, this could be used to locate unencrypted
objects. The list goes on.

This commit makes the auditor locate, via entry points, the watchers
named in its config file.

A watcher is a class with at least these four methods:

   __init__(self, conf, logger, **kwargs)

   start(self, audit_type, **kwargs)

   see_object(self, object_metadata, data_file_path, **kwargs)

   end(self, **kwargs)

The auditor will call watcher.start(audit_type) at the start of an
audit pass, watcher.see_object(...) for each object audited, and
watcher.end() at the end of an audit pass. All method arguments are
passed as keyword args.

This version of the API is implemented on the context of the
auditor itself, without spawning any additional processes.
If the plugins are not working well -- hang, crash, or leak --
it's easier to debug them when there's no additional complication
of processes that run by themselves.

In addition, we include a reference implementation of plugin for
the watcher API, as a help to plugin writers.

Change-Id: I1be1faec53b2cdfaabf927598f1460e23c206b0a
2020-12-26 17:16:14 -06:00
..
watchers Let developers/operators add watchers to object audit 2020-12-26 17:16:14 -06:00
__init__.py Initial commit of Swift code 2010-07-12 17:03:45 -05:00
auditor.py Let developers/operators add watchers to object audit 2020-12-26 17:16:14 -06:00
diskfile.py Remove md5_factory function 2020-12-15 14:39:48 -08:00
expirer.py replace md5 with swift utils version 2020-12-15 09:52:55 -05:00
mem_diskfile.py replace md5 with swift utils version 2020-12-15 09:52:55 -05:00
mem_server.py Per-policy DiskFile classes 2015-04-14 00:52:16 -07:00
reconstructor.py Stop invalidating suffixes post-SSYNC 2020-11-16 08:30:07 -06:00
replicator.py Fix up some log message grammar 2020-12-17 09:24:51 -08:00
server.py replace md5 with swift utils version 2020-12-15 09:52:55 -05:00
ssync_receiver.py ssync: Tolerate more hang-ups 2020-11-24 21:08:08 +00:00
ssync_sender.py py3: port ssync 2019-06-05 13:26:18 -07:00
updater.py Merge "object-updater: Ignore ENOENT when trying to unlink stale pending files" 2020-05-17 05:08:59 +00:00