Skip to content

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

Merged
abhishekrb19 merged 7 commits intoapache:masterfrom
abhishekrb19:update_supervisor_topic_error
Apr 3, 2024
Merged

Update error messages when supervisor's checkpoint state is invalid#16208
abhishekrb19 merged 7 commits intoapache:masterfrom
abhishekrb19:update_supervisor_topic_error

Conversation

@abhishekrb19
Copy link
Copy Markdown
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

final boolean startMetadataMatchesExisting;
int startMetadataGreaterThanExisting = 0;
boolean startMetadataGreaterThanExisting = false;
Copy link
Copy Markdown
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
@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.

4 participants