Skip to content

Fixing the crawler framework to handle ddb outage scenario#6207

Merged
san81 merged 3 commits into
opensearch-project:mainfrom
san81:crawler-source-coordinator-fix
Oct 30, 2025
Merged

Fixing the crawler framework to handle ddb outage scenario#6207
san81 merged 3 commits into
opensearch-project:mainfrom
san81:crawler-source-coordinator-fix

Conversation

@san81

@san81 san81 commented Oct 29, 2025

Copy link
Copy Markdown
Collaborator

Description

Crawler framework relay on Source Coordinator framework which uses DDB as its store for state management. In an event when DDB store becomes unreachable, the expectation is that, pipeline should fully recover back to normal state as soon as ddb is accessible. In its current state, leader scheduler is holding onto an expired ownership record, which is preventing it from fully recovering after DDB comes back to normal state. The fix is to give up the partition when ddb store is unavailable so that it can freshly require when the store comes back online and reachable.

Check List

  • New functionality includes testing.
  • New functionality has a documentation issue. Please link to it in this PR.
    • New functionality has javadoc added
  • Commits are signed with a real name per the DCO

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Santhosh Gandhe <1909520+san81@users.noreply.github.com>
graytaylor0
graytaylor0 previously approved these changes Oct 30, 2025
// it should give up leader partition and require whenever ddb store reachable again
// Not giving up will make this to continue hold on to an ownership expired record which will create inconsistent state issues
// if you are not the owner in ddb table, then you are not supposed to hold the ownership
leaderPartition = null;

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.

Please include a unit test for this scenario and the expected outcome.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Added a unit test to validate reacquiring scenario.

…ition state after ddb calls succeed

Signed-off-by: Santhosh Gandhe <1909520+san81@users.noreply.github.com>
});
}

@Test

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.

You can move your comment to the test name to make it easier to read.

@Test("Ensure that if DynamoDB becomes unreachable, the leader gives up the partition and retries acquisition")

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Added @DidsplayName annotation with the description

Signed-off-by: Santhosh Gandhe <1909520+san81@users.noreply.github.com>
@san81 san81 requested a review from dlvenable October 30, 2025 19:13
@san81 san81 merged commit 094db94 into opensearch-project:main Oct 30, 2025
45 of 47 checks passed
vecheka pushed a commit to vecheka/data-prepper-m365-specific-metric-names that referenced this pull request Oct 31, 2025
…h-project#6207)

* Fixing the crawler framework to handle ddb outage scenario

Signed-off-by: Vecheka Chhourn <vecheka@amazon.com>
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