Skip to content

Conversation

@rajeshwar-nu
Copy link

@rajeshwar-nu rajeshwar-nu commented Jan 8, 2026

Pull Request type

  • Bugfix
  • Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • WHOSUSING.md
  • Other (please describe):

Changes in this PR

Motivation

Workflow removal currently risks data loss when index operations fail. We want consistent behavior across archive and non‑archive removals so the source of truth (ExecutionDAO) is only deleted after index changes succeed. Also, index deletions should be idempotent: a missing index record should not block DAO
removal because it likely means a prior step already removed it.

Changes

  • Reordered removeWorkflow to always perform workflow/task index operations before deleting from ExecutionDAO.
  • Treated index “not found” as a non‑blocking condition for non‑archive removals (workflow + task index).
  • Applied the same idempotent handling to removeWorkflowWithExpiry.
  • Added comments explaining the ordering and idempotency logic.
  • Added tests covering non‑archive index “not found” cases and archive failure cases.

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.

1 participant