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

UCP: util/memory: fix misleading log information when spilling to disk #15467

Merged
merged 5 commits into from
Mar 23, 2020
Merged

UCP: util/memory: fix misleading log information when spilling to disk #15467

merged 5 commits into from
Mar 23, 2020

Conversation

yzwqf
Copy link
Contributor

@yzwqf yzwqf commented Mar 18, 2020

What problem does this PR solve?

close #15401

What is changed and how it works?

Hide the unrelated quotas as the issue says.

Check List

Tests

  • Unit test
  • Integration test

@yzwqf yzwqf requested a review from a team as a code owner March 18, 2020 10:16
@sre-bot sre-bot added the contribution This PR is from a community contributor. label Mar 18, 2020
@ghost ghost requested review from qw4990 and XuHuaiyu and removed request for a team March 18, 2020 10:16
@github-actions github-actions bot added the sig/execution SIG execution label Mar 18, 2020
@SunRunAway SunRunAway changed the title util/memory/tracker: Misleading log information when spilling to disk util/memory: Misleading log information when spilling to disk Mar 18, 2020
t.mu.children[i].toString(indent+" ", buffer)
t.mu.children[i].bytesLimit = tmp
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi,
I think it's not necessary to change this method, we can just print the Consumed and Limit memory of the Tracker itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually I think so too, the code I changed is too ugly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TestSetDDLErrorCountLimit success on my own machine...

}
fmt.Fprintf(buffer, "%s \"consumed\": %s\n", "", t.BytesToString(t.BytesConsumed()))
buffer.WriteString("}\n")
logutil.BgLogger().Info("memory exceeds quota, spill to disk now.", zap.String("memory", buffer.String()))
Copy link
Contributor

@SunRunAway SunRunAway Mar 18, 2020

Choose a reason for hiding this comment

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

Suggested change
logutil.BgLogger().Info("memory exceeds quota, spill to disk now.", zap.String("memory", buffer.String()))
logutil.BgLogger().Info("memory exceeds quota, spill to disk now.", zap.Int64("qonsumed", t.BytesConsumed()), zap.Int64("quota", t.GetBytesLimit()))

We can just print the plain text instead of constructing JSON.

Copy link
Member

Choose a reason for hiding this comment

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

s/qonsumed/consumed/?

Copy link
Contributor

Choose a reason for hiding this comment

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

sorry about that.
@yzwqf Please fix this typo.

@yzwqf
Copy link
Contributor Author

yzwqf commented Mar 20, 2020

@qw4990 @XuHuaiyu thxthxthx

@XuHuaiyu XuHuaiyu changed the title util/memory: Misleading log information when spilling to disk util/memory: fix misleading log information when spilling to disk Mar 23, 2020
Copy link
Contributor

@XuHuaiyu XuHuaiyu left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@SunRunAway SunRunAway left a comment

Choose a reason for hiding this comment

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

LGTM

@SunRunAway SunRunAway added the status/can-merge Indicates a PR has been approved by a committer. label Mar 23, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Mar 23, 2020

/run-all-tests

@sre-bot sre-bot merged commit fd0235d into pingcap:master Mar 23, 2020
@yzwqf yzwqf changed the title util/memory: fix misleading log information when spilling to disk UCP: util/memory: fix misleading log information when spilling to disk Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution This PR is from a community contributor. sig/execution SIG execution status/can-merge Indicates a PR has been approved by a committer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Misleading log information when spilling to disk
5 participants