Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update error messages when supervisor's checkpoint state is invalid #16208

Merged

Conversation

abhishekrb19
Copy link
Contributor

@abhishekrb19 abhishekrb19 commented Mar 27, 2024

Updating the topic name for a supervisor results in the following error:

[java.lang.RuntimeException: Inconsistent metadata state. This can happen if you update input topic in a spec without changing the supervisor name. Stored state: ...

Changing the supervisor's name makes it a completely different supervisor. Update the error message to instead suggest resetting the supervisor as the primary way to fix it when this happens. The updated error message is as follows:

org.apache.druid.error.DruidException: Inconsistency between stored metadata state[ObjectMetadata{theObject={foo=baz}}] and target state[ObjectMetadata{theObject=null}]. Try resetting the supervisor.
  • Also, update the error message when the start metadata is ahead of the last committed state.

Other cleanup changes:

  • Switch startMetadataGreaterThanExisting from an integer to boolean type to make the intent clear.
  • Replace an anonymous code block with lambda.
  • Use DruidException instead of RuntimeException in SegmentPublishResult failure calls.
  • Clean up a few code comments, redundant info log and include more information in the SegmentPublishResult error itself.

This PR has:

  • been self-reviewed.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.

Suggest resetting the supervisor when the topic changes instead of changing
the supervisor name which is actually making a new supervisor.
@abhishekrb19 abhishekrb19 requested a review from kfaraz April 3, 2024 02:38
@abhishekrb19 abhishekrb19 changed the title Suggest resetting a supervisor when the topic is updated Update error messages when supervisor's checkpoint state is invalid Apr 3, 2024
@@ -2395,17 +2388,19 @@ protected DataStoreMetadataUpdateResult updateDataSourceMetadataWithHandle(
}

final boolean startMetadataMatchesExisting;
int startMetadataGreaterThanExisting = 0;
boolean startMetadataGreaterThanExisting = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks!

@abhishekrb19 abhishekrb19 merged commit 75fb57e into apache:master Apr 3, 2024
85 checks passed
@abhishekrb19 abhishekrb19 deleted the update_supervisor_topic_error branch April 3, 2024 17:34
@adarshsanjeev adarshsanjeev added this to the 30.0.0 milestone May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants