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

distsqlrun: fail gracefully if out of memory during stats creation #39738

Merged
merged 1 commit into from
Aug 20, 2019

Conversation

rytaft
Copy link
Collaborator

@rytaft rytaft commented Aug 19, 2019

This commit ensures that the sampler and sampleAggregator processors
fail gracefully if they run out of memory. Instead of causing the
entire CREATE STATISTICS job to fail in case of an out of memory error,
they will continue to collect statistics for row counts, distinct
counts and null counts, but will disable collection of histograms.

Release note: None

@rytaft rytaft requested a review from a team as a code owner August 19, 2019 14:43
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @justinj, @RaduBerinde, and @rytaft)


pkg/sql/distsqlpb/data.proto, line 282 at r1 (raw file):

    optional uint64 rows_processed = 1 [(gogoproto.nullable) = false];
    // Indicates that sample collection for histograms should be disabled,
    // likely because the sampler processor ran out of memory.

[nit] a sampler processor

This commit ensures that the sampler and sampleAggregator processors
fail gracefully if they run out of memory. Instead of causing the
entire CREATE STATISTICS job to fail in case of an out of memory error,
they will continue to collect statistics for row counts, distinct
counts and null counts, but will disable collection of histograms.

Release note: None
Copy link
Collaborator Author

@rytaft rytaft left a comment

Choose a reason for hiding this comment

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

TFTR!

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @justinj and @RaduBerinde)


pkg/sql/distsqlpb/data.proto, line 282 at r1 (raw file):

Previously, RaduBerinde wrote…

[nit] a sampler processor

I think "the" sampler processor works here because it corresponds to whichever sampler processor is sending this metadata message (same reason we use "the" sampler processor in the line above for rows_processed).

Although I also don't really feel strongly -- happy to change it if you think it would be clearer with "a".

Copy link
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @justinj)


pkg/sql/distsqlpb/data.proto, line 282 at r1 (raw file):

Previously, rytaft (Rebecca Taft) wrote…

I think "the" sampler processor works here because it corresponds to whichever sampler processor is sending this metadata message (same reason we use "the" sampler processor in the line above for rows_processed).

Although I also don't really feel strongly -- happy to change it if you think it would be clearer with "a".

👍

@rytaft
Copy link
Collaborator Author

rytaft commented Aug 19, 2019

bors r+

@craig
Copy link
Contributor

craig bot commented Aug 19, 2019

Build failed

@rytaft
Copy link
Collaborator Author

rytaft commented Aug 20, 2019

bors r+

craig bot pushed a commit that referenced this pull request Aug 20, 2019
39738: distsqlrun: fail gracefully if out of memory during stats creation r=rytaft a=rytaft

This commit ensures that the `sampler` and `sampleAggregator` processors
fail gracefully if they run out of memory. Instead of causing the
entire `CREATE STATISTICS` job to fail in case of an out of memory error,
they will continue to collect statistics for row counts, distinct
counts and null counts, but will disable collection of histograms.

Release note: None

Co-authored-by: Rebecca Taft <becca@cockroachlabs.com>
@craig
Copy link
Contributor

craig bot commented Aug 20, 2019

Build succeeded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants