Skip to content

content_add: Write to the objstorage before the DB or Kafka

Must add to the objstorage before the DB and journal. Otherwise:

  1. in case of a crash the DB may "believe" we have the content, but we didn't have time to write to the objstorage before the crash
  2. the objstorage mirroring, which reads from the journal, may attempt to read from the objstorage before we finished writing it

This is already done in the postgresql backend unintentionally since !360 (closed).

This commit documents it, makes the cassandra backend behave that way too, and adds a test.

Resolves swh-journal#2003 (closed).


Migrated from D5246 (view on Phabricator)

Merge request reports