Skip to content

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

Merged
wu-sheng merged 2 commits intomasterfrom
enhance-logs
Feb 21, 2025
Merged

Add more clear logs when oap-cluster-internal data format is inconcsistent#13059
wu-sheng merged 2 commits intomasterfrom
enhance-logs

Conversation

@wu-sheng
Copy link
Copy Markdown
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
String nextWorkerName = message.getNextWorkerName();
RemoteData remoteData = message.getRemoteData();

try {
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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