Skip to content

feat: add structured metrics for deleteIfUnchanged outcomes in GlueSync#143

Merged
jamespfaulkner merged 2 commits into
mainfrom
feat/NO-JIRA/gluesync-delete-outcome-metrics
Jul 7, 2026
Merged

feat: add structured metrics for deleteIfUnchanged outcomes in GlueSync#143
jamespfaulkner merged 2 commits into
mainfrom
feat/NO-JIRA/gluesync-delete-outcome-metrics

Conversation

@jamespfaulkner

Copy link
Copy Markdown
Contributor

Summary

  • Adds a DeleteOutcome enum (DELETED, SKIPPED, NOT_FOUND) as the return type of deleteIfUnchanged, replacing the previous void return that forced callers to record misleading metrics (the guard
    suppressing a delete was silently counted as outcome=deleted)
  • SKIPPED (guard fired — identity params diverged, indicating a concurrent rename overwrote the slot) is now a distinct, alertable metric outcome rather than being swallowed into the success/deleted
    bucket
  • NOT_FOUND is consolidated: both the getTable and the TOCTOU deleteTable EntityNotFoundException paths are handled inside deleteIfUnchanged, removing the separate catch block in onDropTable
  • Rename operations now emit operation=rename_table instead of alter_table, making them independently filterable and dashboardable
  • 128 tests passing; new tests cover the guard-fires path for both onDropTable and doRenameOperation, and the TOCTOU delete race

Test plan

  • mvn test -pl hive-event-listeners/apiary-gluesync-listener — all 128 tests pass
  • Verify JMX metrics surface outcome=delete_skipped when a stale DROP fires after a rename
  • Verify operation=rename_table appears in JMX for table rename events

🤖 Generated with Claude Code

Replaces the flat 'deleted' outcome tag on drop/rename events with a
typed DeleteOutcome enum (DELETED, SKIPPED, NOT_FOUND) so each code
path through the optimistic delete guard is independently observable.

- deleteIfUnchanged now returns DeleteOutcome instead of void, letting
  callers record the correct metric without a switch statement
- SKIPPED (guard fired — identity params diverged) is now a distinct
  metric outcome rather than silently counting as success/deleted
- NOT_FOUND is consolidated: both the getTable and the TOCTOU
  deleteTable EntityNotFoundException paths return NOT_FOUND from
  deleteIfUnchanged, removing the separate catch block in onDropTable
- Rename operations now emit operation=rename_table instead of
  alter_table, making them independently filterable in dashboards
- 128 tests, all passing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jamespfaulkner jamespfaulkner requested a review from a team as a code owner July 6, 2026 16:05
@jamespfaulkner jamespfaulkner force-pushed the feat/NO-JIRA/gluesync-delete-outcome-metrics branch from 99c1e9f to 3186d33 Compare July 6, 2026 16:26
Surfaces distinct metric outcomes (deleted, delete_skipped, not_found,
concurrent_delete) for the optimistic delete guard so alerting can
distinguish a skipped guard from a successful delete.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jamespfaulkner jamespfaulkner merged commit ba30eeb into main Jul 7, 2026
1 check passed
@jamespfaulkner jamespfaulkner deleted the feat/NO-JIRA/gluesync-delete-outcome-metrics branch July 7, 2026 08:51
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.

2 participants