Metadata-Version: 2.1
Name: ftw.catalogdoctor
Version: 1.2.1
Summary: ftw.catalogdoctor
Home-page: https://github.com/4teamwork/ftw.catalogdoctor
Author: 4teamwork AG
Author-email: mailto:info@4teamwork.ch
License: GPL2
Keywords: ftw catalogdoctor
Classifier: Framework :: Plone
Classifier: Framework :: Plone :: 4.3
Classifier: Framework :: Plone :: 5.1
Classifier: License :: OSI Approved :: GNU General Public License (GPL)
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.7
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: ftw.upgrade
Requires-Dist: Plone
Requires-Dist: plone.api
Requires-Dist: setuptools
Provides-Extra: tests
Requires-Dist: ftw.builder; extra == "tests"
Requires-Dist: ftw.testbrowser; extra == "tests"
Requires-Dist: ftw.testing; extra == "tests"
Requires-Dist: plone.app.contenttypes; extra == "tests"
Requires-Dist: plone.app.testing; extra == "tests"
Requires-Dist: plone.testing; extra == "tests"
Requires-Dist: pytz; extra == "tests"
Requires-Dist: zope.configuration; extra == "tests"

.. contents:: Table of Contents


Introduction
============

The package ``ftw.catalogdoctor`` provides healthcheck to find
inconsistencies in ``portal_catalog`` and surgery to remove some of them. It
can be run via a ``zopectl.command``.


Healthcheck
===========

Lists inconsistencies detected in ``portal_catalog``. Finds inconsistencies by
inspecting the catalog's internal data structures. It currently uses ``paths``
(the rid-path mapping), ``uids`` (the path-rid mapping), the ``UID`` index and
catalog metadata to determine if the catalog is healthy or if there are
problems. Healtcheck is a read-only operation and won't modify the catalog.

It can be run as follows:

.. code:: sh

    $ bin/instance doctor healthcheck


Surgery
=======

Attempts to fix issues found by ``healthcheck``. Will do a healtchcheck before
surgery, then attempt surgery and finally do a post-surgery healthcheck.
Surgery is a write operation but changes are only committed to the database if
the post-surgery healtcheck yields no more health problems.
Currently the set of available surgery is limited to problems we have observed
in production.


It can be run as follows:

.. code:: sh

    $ bin/instance doctor surgery


There is also a `--dry-run` parameter that prevents committing changes.

.. code:: sh

    $ bin/instance doctor --dry-run surgery


Debugging
=========

If you need to debug/analyze issues that ``ftw.catalogdoctor`` cannot fix yet
have a look at the ``debug`` module. It provides useful functions to ``pprint``
or inspect catalog state.


Installation
============

- Add the package to your buildout configuration:

::

    [instance]
    eggs +=
        ...
        ftw.catalogdoctor


Compatibility
-------------

Plone 4.3.x
Plone 5.1.x


Development
===========

1. Fork this repo
2. Clone your fork
3. Shell: ``ln -s development.cfg buildout.cfg``
4. Shell: ``python bootstrap.py``
5. Shell: ``bin/buildout``

Run ``bin/test`` to test your changes.

Or start an instance by running ``bin/instance fg``.


Links
=====

- Github: https://github.com/4teamwork/ftw.catalogdoctor
- Issues: https://github.com/4teamwork/ftw.catalogdoctor/issues
- Pypi: http://pypi.python.org/pypi/ftw.catalogdoctor


Copyright
=========

This package is copyright by `4teamwork <http://www.4teamwork.ch/>`_.

``ftw.catalogdoctor`` is licensed under GNU General Public License, version 2.

Changelog
=========


1.2.1 (2024-10-14)
------------------

- Delay import of Testing module in zopectl command to not accidently create a demo storage. [buchi]


1.2.0 (2020-10-06)
------------------

- Defer reindex until removal from indexes is done, introduce post-op. [deiferni]


1.1.0 (2020-09-30)
------------------

- Drop duplicate objects from Acquisition when fixing UID index. [deiferni]
- Implement reindexing objects when still traversable for orphaned rids. [deiferni]
- Check for shorter path rather than direct parent in surgery safeguard. [deiferni]
- Use extra rid removal surgery for new symptoms. [deiferni]


1.0.0 (2019-07-08)
------------------

- Initial implementation.
