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 debug log when waiting for spilling on other consumers #1933

Merged
merged 2 commits into from
Mar 8, 2022

Conversation

viirya
Copy link
Member

@viirya viirya commented Mar 6, 2022

Which issue does this PR close?

Closes #1932.

Rationale for this change

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the datafusion Changes in the datafusion crate label Mar 6, 2022
@@ -340,6 +340,9 @@ impl MemoryManager {
} else if current < min_per_rqt {
// if we cannot acquire at lease 1/2n memory, just wait for others
// to spill instead spill self frequently with limited total mem
debug!(
"Cannot acquire minimum amount of memory {}, waiting for others to spill ...",
human_readable_size(min_per_rqt));
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'm also thinking if it makes sense to measure the time spent on the wait and log it?

Copy link
Member

@yjshen yjshen Mar 7, 2022

Choose a reason for hiding this comment

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

Yeah, that makes sense.

Copy link
Member

Choose a reason for hiding this comment

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

How do you like to also log memory manager status as well?

impl Display for MemoryManager {
    fn fmt(&self, f: &mut Formatter) -> fmt::Result {
        write!(f,
               "MemoryManager usage statistics: total {}, trackers used {}, total {} requesters used: {}",

Copy link
Member Author

Choose a reason for hiding this comment

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

sounds good

Copy link
Member

Choose a reason for hiding this comment

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

One more thought, based on your measure timing comments above, probably we could warn! if we've waited for a longer time than some threshold? In case reproducing the race would be hard. debug! at the first round might not be revealed in the first place?

Copy link
Member Author

Choose a reason for hiding this comment

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

warn! sounds better. Do you think we need to have warn! for all log here? Or just for longer time case?

Copy link
Member

Choose a reason for hiding this comment

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

For the longer time case, I suggest.

@viirya
Copy link
Member Author

viirya commented Mar 6, 2022

cc @yjshen

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

LGTM -- thanks @viirya and @yjshen

Copy link
Member

@yjshen yjshen left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @viirya ❤️

@viirya
Copy link
Member Author

viirya commented Mar 8, 2022

Thanks @alamb @yjshen

@houqp houqp merged commit 741eba0 into apache:master Mar 8, 2022
@houqp
Copy link
Member

houqp commented Mar 8, 2022

Thanks @viirya and @yjshen !

@viirya
Copy link
Member Author

viirya commented Mar 8, 2022

Thanks @alamb @yjshen @houqp !

@viirya viirya deleted the add_log branch March 8, 2022 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datafusion Changes in the datafusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add debug log when a memory consumer waits for spilling
4 participants