Skip to content

feat(core): add audit history journal backfill change - #982

Open
bercianor wants to merge 3 commits into
masterfrom
feat/journal-backfill
Open

bercianor wants to merge 3 commits into
masterfrom
feat/journal-backfill

Conversation

@bercianor

Copy link
Copy Markdown
Member

Summary

  • Add JournalBackfillChange to copy historical audit entries into journal streams without modifying audit history; registration and execution ordering remain outside this change.
  • Preserve history order and source payloads, reuse persistence instances by stage, and exclude the backfill change's own audit records.
  • Require journal events to be enabled and stop on unsuccessful appends; document that retries with a fresh instance may duplicate earlier entries.

Testing

  • Added six unit tests covering feature gating, empty history, payload and ordering preservation, stage-specific persistence reuse, append failures, and retry behavior.
  • Tests were not rerun for this PR; automated validation remains pending CI.


logger.info("Backfilling audit history into journal streams");
this.persistenceFactory = persistenceFactory;
for (AuditEntry auditEntry : persistenceFactory.get(SYSTEM_STAGE_ID).getAuditHistory()) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that David's comment is not solved in PR #986, or at least not the expecting change. I think the comment was related to get the persistence instance shared from the same map. In this line you are getting an instance directly from the persistenceFactory, without asking for an instance in the existing map (at this moment we know that the map will be empty, but we should add the instance to it allowing next access to be present and don't instanciate another instance for the same stage id).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants