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

Add more clear logs when oap-cluster-internal data format is inconcsistent #13059

Merged
merged 2 commits into from
Feb 21, 2025

Conversation

wu-sheng
Copy link
Member

  • If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #.
  • Update the CHANGES log.

@wu-sheng wu-sheng added the chore Chores about the project, like code cleaning up, typos, upgrading dependencies, etc. label Feb 21, 2025
@wu-sheng wu-sheng added this to the 10.2.0 milestone Feb 21, 2025
@@ -117,24 +117,33 @@ public void onNext(RemoteMessage message) {
String nextWorkerName = message.getNextWorkerName();
RemoteData remoteData = message.getRemoteData();

try {
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't change much. I just replaced this try/catch by several others.

remoteInTargetNotFoundCounter.inc();
LOGGER.warn(
"Data is discarded due to worker not found. Check OAL/MAL script, make sure they are aligned in the whole cluster. The data is {}",
message
Copy link
Member

Choose a reason for hiding this comment

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

I think this is unhelpful. Message doesn't have a readable toString representation

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a proto object. Isn't it output the data? I read this from decompiling codes.

  @Override
  public final String toString() {
    return TextFormat.printer().printToString(this);
  }

Copy link
Member Author

Choose a reason for hiding this comment

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

For safety, I run the demo codes locally

public static void main(String[] args) {
        RemoteMessage obj = RemoteMessage.newBuilder()
                                             .setNextWorkerName("dbc").build();
        System.out.println("Default toString(): " + obj.toString());
        System.out.println("TextFormat: " + TextFormat.printer().printToString(obj));

        try {
            System.out.println("JsonFormat: " + JsonFormat.printer().print(obj));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
Default toString(): nextWorkerName: "dbc"

TextFormat: nextWorkerName: "dbc"

JsonFormat: {
  "nextWorkerName": "dbc"
}

@wu-sheng wu-sheng merged commit d98f74d into master Feb 21, 2025
163 checks passed
@wu-sheng wu-sheng deleted the enhance-logs branch February 21, 2025 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Chores about the project, like code cleaning up, typos, upgrading dependencies, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants