Enforce that metadata changes are mirrored by journal replay

Description

Currently, we modify in-memory master state over the course of RPCs, then write a journal entry at the end. When we replay the journal, entries are applied through a different code path from the original code path they are trying to simulate. This has led to multiple instances of failing to replay the journal.

To avoid this class of errors, we should directly tie all state modifications to applying a journal entry. If an RPC wants to modify state, it must first create a journal entry, then call applyAndJournal(entry). applyAndJournal(entry) will update in-memory state according to the content of the entry, and append the entry to the journal. When replaying the journal, we will apply the entry with the same apply(entry) method used by applyAndJournal(entry).

Environment

None

Assignee

Andrew Audibert

Reporter

Andrew Audibert

Labels

None

Components

Fix versions

Affects versions

Priority

Major
Configure