Skip to content

Add tombstone records for deleted documents #1106

@MatMoore

Description

@MatMoore

From https://trello.com/c/ap5pQF5R/20-add-tombstone-records-for-deleted-documents

In the new govuk index, an unpublishing (non-withdawn) message causes rummager to delete the document from the index. This can lead to a race condition if a publishing and unpublishing message arrive out of order.

If a publisher publishes and then immediately unpublishes a document, but the unpublishing message arrives first, the document will be removed from the index. Then the stale publishing message arrives, so rummager will incorrectly re-add the document to the index.

We could avoid this by adding temporary "tombstone" records when a document is deleted, i.e. keep the document in the index with a flag marking it as unpublished. The document will be removed when the index is next recreated, but while it exists it would prevent the document from being republished because Elasticsearch's versioning would cause the stale write to fail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions