feat: add structured metrics for deleteIfUnchanged outcomes in GlueSync#143
Merged
jamespfaulkner merged 2 commits intoJul 7, 2026
Merged
Conversation
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>
99c1e9f to
3186d33
Compare
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>
jmnunezizu
approved these changes
Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DeleteOutcomeenum (DELETED,SKIPPED,NOT_FOUND) as the return type ofdeleteIfUnchanged, replacing the previousvoidreturn that forced callers to record misleading metrics (the guardsuppressing 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/deletedbucket
NOT_FOUNDis consolidated: both thegetTableand the TOCTOUdeleteTableEntityNotFoundExceptionpaths are handled insidedeleteIfUnchanged, removing the separate catch block inonDropTableoperation=rename_tableinstead ofalter_table, making them independently filterable and dashboardableonDropTableanddoRenameOperation, and the TOCTOU delete raceTest plan
mvn test -pl hive-event-listeners/apiary-gluesync-listener— all 128 tests passoutcome=delete_skippedwhen a stale DROP fires after a renameoperation=rename_tableappears in JMX for table rename events🤖 Generated with Claude Code