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

colexec: close disk resources in tests #106459

Merged
merged 3 commits into from
Sep 9, 2023
Merged

Conversation

michae2
Copy link
Collaborator

@michae2 michae2 commented Jul 7, 2023

Fixes: #106119

colcontainer: close PDQ during TestPartitionedDiskQueueSimulatedExternal

Close the PartitionedDiskQueue at the end of TestPartitionedDiskQueueSimulatedExternal/HashJoin.

Release note: None


colexecutils: close SpillingBuffer during TestSpillingBuffer

Release note: None


colexec: make some operators implement colexecop.Closer interface

This commit makes the following adjustments that fix "leaked files" in
the disk-spilling tests:

  • orderedDistinct now implements colexecop.Closer (needed for
    TestExternalDistinct)
  • orderedAggregator and distinctChainOps now implement
    colexecop.Closer (needed for TestExternalHashAggregator)
  • TestCrossJoiner is adjusted to explicitly close all closers when
    non-empty ON expression is used (in this case we have selection and
    projection operators on top of the cross joiner which currently don't
    implement the Closer interface).

Release note: None

@michae2 michae2 requested a review from a team as a code owner July 7, 2023 22:48
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @michae2 and @rharding6373)


-- commits line 21 at r3:
I'm not sure about this. We have this best-effort notion that closing the head operator should trigger closing operators in the whole tree, and I'd rather investigate which operators don't do that. I'm a bit concerned that this commit could be hiding some problems. Even though at the vectorizedFlow level we track most closers separately, it'd still be nice to improve our best-effort closing of everything by closing the head. Thoughts?

Copy link
Collaborator Author

@michae2 michae2 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 (waiting on @rharding6373 and @yuzefovich)


-- commits line 21 at r3:

Previously, yuzefovich (Yahor Yuzefovich) wrote…

I'm not sure about this. We have this best-effort notion that closing the head operator should trigger closing operators in the whole tree, and I'd rather investigate which operators don't do that. I'm a bit concerned that this commit could be hiding some problems. Even though at the vectorizedFlow level we track most closers separately, it'd still be nice to improve our best-effort closing of everything by closing the head. Thoughts?

SGTM. I will try to figure out exactly which operators are not being closed.

@michae2 michae2 removed the request for review from rharding6373 July 18, 2023 17:05
Close the `PartitionedDiskQueue` at the end of
`TestPartitionedDiskQueueSimulatedExternal/HashJoin`.

Fixes: cockroachdb#106119

Release note: None
@yuzefovich yuzefovich requested review from a team as code owners September 8, 2023 21:07
@yuzefovich yuzefovich requested review from RaduBerinde and removed request for a team and RaduBerinde September 8, 2023 21:07
@yuzefovich
Copy link
Member

@cockroachdb/storage friends please ignore this PR (I temporarily cherry-picked #106195 to see what CI says).

@michae2 hope you don't mind that I looked into this. I investigated several failures in colexec package, and I think I fixed them all in the last commit. Thus, I don't think we need the third commit that always closes the closers in the test harness (my thinking is that we should think through each test case separately, to see whether any "close-propagation" is missing).

Copy link
Collaborator Author

@michae2 michae2 left a comment

Choose a reason for hiding this comment

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

Thanks for picking this up! I'm sorry I let it fester. Last commit :lgtm:

Reviewed 3 of 3 files at r6, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @yuzefovich)

This commit makes the following adjustments that fix "leaked files" in
the disk-spilling tests:
- `orderedDistinct` now implements `colexecop.Closer` (needed for
`TestExternalDistinct`)
- `orderedAggregator` and `distinctChainOps` now implement
`colexecop.Closer` (needed for `TestExternalHashAggregator`)
- `TestCrossJoiner` is adjusted to explicitly close all closers when
non-empty ON expression is used (in this case we have selection and
projection operators on top of the cross joiner which currently don't
implement the `Closer` interface).

Release note: None
@yuzefovich
Copy link
Member

No worries! The only exposed failure was in kvserver package (filed #110293), so we should be good.

bors r=yuzefovich,michae2

@craig
Copy link
Contributor

craig bot commented Sep 8, 2023

👎 Rejected by too few approved reviews

Copy link
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

Reviewed 33 of 34 files at r4, 3 of 3 files at r6, 2 of 2 files at r7, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @michae2)

Copy link
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

bors r=yuzefovich,michae2

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

@yuzefovich yuzefovich changed the title colexec: close operators at the end of colexec tests colexec: close disk resources in tests Sep 8, 2023
@craig
Copy link
Contributor

craig bot commented Sep 9, 2023

Build succeeded:

@craig craig bot merged commit 0fd3da5 into cockroachdb:master Sep 9, 2023
@yuzefovich
Copy link
Member

blathers backport 23.1

@mgartner
Copy link
Collaborator

Should we also backport this to 23.2 to fixed #112868?

@yuzefovich
Copy link
Member

It was merged before 23.2 was cut, so #112868 is a separate issue.

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.

sql: flakes caused by leaked goroutine diskHealthCheckingFile in tests
4 participants