-
Notifications
You must be signed in to change notification settings - Fork 11.5k
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
[ISSUE #3136] TraceDataEncoder add SubAfter trace bean timestamp #3137
Conversation
Very responsible for this issue closed, thanks ~ |
subAfterContext.setTimeStamp(Long.parseLong(line[7])); | ||
subAfterContext.setGroupName(line[8]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code here is used for compatible reason, if the message is produced by old versions of producer, there will be group name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get it.
I removed it because I thought this value is useless, maybe add the branch line.length >= 9 back is a better way.
// compatible with the old version
if (line.length >= 8) {
subAfterContext.setTimeStamp(Long.parseLong(line[7]));
}
if (line.length >= 9) {
subAfterContext.setGroupName(Long.parseLong(line[8]));
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not recommended to modify this format in the current state. The previous version upgrade brought many compatibility issues.
@yuz10 @duhenglucky Thanks for your comment. For subAfterContext, in the previous version, it was already defined line[7] is TimeStamp and line[8] is GroupName, it means for compatible reason in new revision we should still follow this protocol. The subAfter GroupName is duplicated with subBeofre, so based on performance considerations(I guess), it was removed it by https://github.com/apache/rocketmq/pull/3005/files We have several ways to make it compatible. Option1 ( Prefer )Just follow the previous version subAfter protocol. ( line[7] is TimeStamp and line[8] is GroupName ) Props
Cons
Option2If line[8] GroupName was never used, just remove it as if it not exist. Props
Cons
Do you have any suggestions for this? |
@StyleTang I prefer just add 2 back and keep the same with 4.9.0. |
Go ahead~ Designed well is what we have advocated. The previous disturbing is the obvious lack of this point. |
For this problem, Who said before and after must be atomic exit? |
@yuz10 @vongosling org.apache.rocketmq.client.impl.consumer.ConsumeMessageConcurrentlyService.ConsumeRequest#run if (ConsumeMessageConcurrentlyService.this.defaultMQPushConsumerImpl.hasHook()) {
consumeMessageContext = new ConsumeMessageContext();
ConsumeMessageConcurrentlyService.this.defaultMQPushConsumerImpl.executeHookBefore(consumeMessageContext);
}
try {
status = listener.consumeMessage(Collections.unmodifiableList(msgs), context);
} catch (Throwable e) {
}
// System crash happen
if (ConsumeMessageConcurrentlyService.this.defaultMQPushConsumerImpl.hasHook()) { ConsumeMessageConcurrentlyService.this.defaultMQPushConsumerImpl.executeHookAfter(consumeMessageContext);
} |
@duhengforever @duhenglucky pls help to look at this issue, especially compatibility backword:-0 |
I think it is necessary for us to add Timestamp and GroupName back. |
Yes, I would like to hear any compatible issues that resolved from the opinion of the other @duhengforever @zongtanghu I think this pr apache/rocketmq-externals#769 would resolve the problem from the dashboard viewpoint. |
apache#3137) * [ISSUE apache#3136] TraceDataEncoder add SubAfter trace bean timestamp * add SubAfter TraceBean TimeStamp and GroupName back
Make sure set the target branch to
develop
What is the purpose of the change
TraceDataEncoder add SubAfter trace bean timestamp
Mentioned in PR-744 , the timeStamp and consumeGroup have been deleted by this commit.
(It is fine for deleting SubAfter consumeGroup because we can find consume group from SubBefore traceContext by messageId and requestId)
I use subBefore timestamp+costTime instead of subAfter timestamp, but it is not reasonable.
Brief changelog
TraceDataEncoder add SubAfter trace bean timestamp
Verifying this change
Unit Tests succeed
Follow this checklist to help us incorporate your contribution quickly and easily. Notice,
it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR
.[ISSUE #123] Fix UnknownException when host config not exist
. Each commit in the pull request should have a meaningful subject line and body.mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle
to make sure basic checks pass. Runmvn clean install -DskipITs
to make sure unit-test pass. Runmvn clean test-compile failsafe:integration-test
to make sure integration-test pass.