ATLAS-5375: Fix stale PUT response for /api/atlas/v2/relationship block/unblock propagation - #729
Open
sheetalshah1007 wants to merge 1 commit into
Open
ATLAS-5375: Fix stale PUT response for /api/atlas/v2/relationship block/unblock propagation#729sheetalshah1007 wants to merge 1 commit into
sheetalshah1007 wants to merge 1 commit into
Conversation
…ck/unblock propagation
mandarambawane
requested review from
chaitalicod,
mandarambawane,
pinal-shah and
rkundam
August 19, 2026 09:17
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.
[ATLAS-5375] Fix stale PUT response for
/api/atlas/v2/relationshipblock/unblock propagationProblem
When
atlas.tasks.enabled=true, relationship PUTs that changepropagateTagsorblockedPropagatedClassificationsqueue a background propagation task. Previously, the HTTP 200 body could return stale edge state (blockedPropagatedClassifications,propagatedClassifications) because the response did not reflect the requested block/direction change while entity tag updates ran asynchronously.Task GUIDs stored on the relationship edge (
__pendingTasks) had two additional issues:Solution
This patch updates the relationship edge synchronously on PUT and keeps downstream entity tag propagation in the background task.
Key changes
Synchronous edge updates: Refactored
DeleteHandlerV1.updateTagPropagations()to write edge properties (propagateTags, blocked IDs) before the API returns. Tasks are queued only whenpropagateTagsor the blocked list actually changes (no-op PUTs skip task queue).Pre-change state in task params:
ClassificationTaskpassesoldTagPropagationandoldBlockedClassificationsinto the worker so entity tag updates use pre-PUT edge state. The worker does not assume the edge is still in its old state (edge is already updated).API visibility for
pendingTasks: Added read-onlypendingTasksonAtlasRelationship.EntityGraphRetrievermaps edge__pendingTasksinto JSON when non-empty.Edge list-property persistence fix:
AtlasGraphUtilsV2.addItemToListProperty/removeItemFromListPropertynow use copy-on-write (new ArrayList+setListProperty) so queue/remove of task GUIDs persists andpendingTasksclears after COMPLETE/FAILED.Testing
ClassificationPropagationWithTasksTestand updated related task tests (ClassificationPropagationTasksTest,ClassificationTaskTest,ClassificationPropagateTaskFactoryTest).mvn -pl repository -Dtest=ClassificationPropagationWithTasksTest,ClassificationPropagationTasksTest,ClassificationTaskTest,ClassificationPropagateTaskFactoryTest testCoverage includes:
pendingTaskspopulated while work is in flight; cleared after COMPLETEpropagateTagschange wins over blocked change in the same PUT (if/else)Optional manual check:
dev-support/atlas-scripts/atlas5375_pr_review_test.shCompatibility & API impact
pendingTasksfield only.pendingTasksomitted when empty (@JsonInclude(NON_NULL)); treat missing field as none in flight."relationship".GET /api/atlas/admin/tasks?guids={guid}(admin).isLegacyTask.propagateTagsrequired on PUT — omitting it retains legacy NPE risk (out of scope).Trade-off
Edge metadata commits before entity tags. If the background task fails after retries, edge rules may differ from downstream classifications; recover by re-PUT, admin task DELETE + re-PUT, or manual tag correction.
Attachments
Design doc: ATLAS-5375-design-document.md — implementation notes for reviewers (problem/flow, API behavior, tests, trade-offs). Reference only; not part of the runtime deliverable.